• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

lukin0110/poeditor-gradle: Gradle plugin to manage translations with POEditor

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

lukin0110/poeditor-gradle

开源软件地址(OpenSource Url):

https://github.com/lukin0110/poeditor-gradle

开源编程语言(OpenSource Language):

Groovy 99.6%

开源软件介绍(OpenSource Introduction):

poeditor-gradle

Build Status

Gradle plugin to manage translations easily within a POEditor project. The plugin enables you to include downloading and uploading of translations in your Gradle build file.

This gradle plugin depends on poeditor-java, a java client for the POEditor API.

  1. Install

Add the following 2 lines of code to your gradle.build file.

In the dependencies section:

classpath 'be.lukin.poeditor:gradle:0.3.3'

Include the plugin:

apply plugin: 'poeditor'

The plugin requires at minimum Java 7 and Gradle 2.x.

  1. Configure

Add configuration about your POEditor project to the gradle.build file. You need an api key and project id from POEditor.

Example configuration:

poeditor {
    apikey 'your api key here'
    projectId 'your project id here'
    type 'android_strings'
    tagsNew '1.0'

    terms 'App/src/main/res/values/strings.xml'
    trans 'en', 'App/src/main/res/values/strings.xml'
    trans 'nl', 'App/src/main/res/values-nl/strings.xml'
    trans 'fr', 'App/src/main/res/values-fr/strings.xml'
    
    filters 'nl', 'translated'
    filters 'fr', 'translated, automatic'
}
Parameter Description
apiKey api key to access the api, can be obtained in your Account
projectId id of the project on POEditor
type file format: po, pot, mo, xls, apple_strings, xliff, android_strings, resx, resw, properties, json
terms point to the file that contains all the terms, probably this is your default language
trans receives 2 parameters: language code & file path of a translation
filters receives 2 parameters: language code & comma separated list of filters. Check the API Reference for all available filters

Now you're all set to manage your translations.

  1. Usage

After your have created your translation project on POEditor you can can initialize your project based on your c onfiguration.

Initialize

gradle poeditorInit

This will create terms and add languages to your project.

Download translations

gradle poeditorPull

Upload translations

gradle poeditorPush
Argument Description
languages specify the languages that you want to upload, by default everything is uploaded
override force to override the translation on POEditor

Example:

gradle poeditorPush -Planguages=nl,fr -Poverride=true

Add terms

gradle poeditorPushTerms

A few example configurations can be found in the example projects folder.

License

Copyright 2015 Maarten Huijsmans

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap