crowdin / crowdin-cli-v1

A command-line client for the Crowdin API v1
MIT License
84 stars 29 forks source link

Invalid android langauges codes #69

Open rosenpin opened 5 years ago

rosenpin commented 5 years ago

This is my crowdin yml configuration:

project_identifier: ....
api_key: ...
base_path: ...

files:
  -
    source: '/app/src/main/res/values/strings.xml'
    translation: '/app/src/main/res/values-%android_code%/%original_file_name%'
    translate_attributes: '0'

This is my website configuration: image

After running java -jar crowdin-cli.jar download all the files are downloaded in the following format: image

But when trying to compile the project I get the following error:

- app/src/main/res/values-kab-rKAB: Error: Invalid resource directory name

It seems like some of the language codes are incorrect and cause compilation errors.

When I use the 2 letters code it works, but it causes me to loose some of the translation languages.

Is this a known error and is there a solution?

mamantoha commented 5 years ago

Hi @rosenpin .

What is the expected name for app/src/main/res/values-kab-rKAB? You can use Languages mapping feature if you need non-standard names for language.

rosenpin commented 5 years ago

I don't know what is the expected name, that's the name generated by the crowdin cli android language code.

I managed to fix it using languages mapping and overriding the default android language code for Kabyle language, but my point is that the default language code is wrong/invalid as android doesn't actually support it, causing a compilation error