Плагин для Android Studio

This plugin lets you integrate your project in Android Studio with Crowdin. Upload new source strings and existing translations to the system instantly as well as download translations from your Crowdin project.

Установка

  1. Install the plugin via JetBrains Plugin repository.
  2. create a file with project credentials named crowdin.properties in the root directory of the project.
project-id=your-project-id api-token=personal-access-token

Source Files and Translations

The plugin will automatically find strings.xml file in the values directory, and if updated, the changes will be uploaded to Crowdin instantly. If you have more source files or the source file name differs from the default strings.xml, specify it in the sources parameter.

sources=file1.xml, file2.xml

By default, translations are exported to the Resources folder (**/resources/values-uk/strings.xml, **/resources/values-fr/strings.xml, …)

To set up your own source and translation pattern, use the following configuration in the crowdin.properties file:

files.source=/values/*.xml files.translation=/values-%android_code%/%original_file_name%

files.1.source=/another/path/*.xml files.1.translation=/another/path-%android_code%/%original_file_name%

Read more about the Placeholders to put the appropriate variables.

Note: Currently, %original_path% placeholder is not supported.

Additional Options

For Android Studio projects that use a git VCS, the plugin will automatically create corresponding branches in Crowdin. If you do not use branches feature in Crowdin, add disable-branches=true parameter into the configuration file.

disable-branches=true

Add auto-upload=false to prevent automatic file upload to Crowdin.

auto-upload=false

Использование

To upload source files to Crowdin manually, use the menu Tools > Crowdin > Upload Sources or click the right mouse button on the file and select Upload to Crowdin.

To upload existing translations, use the menu Tools > Crowdin > Upload Translations.

To download translations from Crowdin, use the menu Tools > Crowdin > Download Translations.

Примечания

  1. For versions 0.5.x see the branch 0.5.x. Please note that these versions are no longer supported.
  2. Migration from version 0.5.x to 1.x.x requires changes in your crowdin.properties file.

Была ли эта статья полезной?