kelvinhokk / cordova-plugin-localization-strings

Cordova Plugin for Localization of Strings on the App
MIT License
119 stars 106 forks source link

creating localisation with "-" fails on android #58

Closed joeldhenry closed 4 years ago

joeldhenry commented 4 years ago

Using example "pt-BR.json", during building it returns this error: "cordova/platforms/android/app/src/main/res/values-pt-BR: Error: Invalid resource directory name"

Cordova-Android: 8.1.0 cordova-plugin-localization-strings: 3.2.1

rodrigograca31 commented 4 years ago

The language is defined by a two-letter ISO 639-1 language code, optionally followed by a two letter ISO 3166-1-alpha-2 region code (preceded by lowercase r). https://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

That means its pt-rBR.json and pt-rPT.json.

On one of my projects I also have pt.json but not sure if makes a diference.... maybe test and let us know? :thinking:

Also: https://github.com/championswimmer/android-locales (This list shows the folder it creates... values-pt-rBR)

rodrigograca31 commented 4 years ago

reading my own answer answers why I have a pt.json .... its the two letter ISO 639-1.