EddyVerbruggen / nativescript-localize

Internationalization plugin for NativeScript using native capabilities of each platform
MIT License
79 stars 31 forks source link

Issues with es-419 (latin america) culture on Android. #62

Closed spstratis closed 5 years ago

spstratis commented 5 years ago

Hi there, this plugin is great!. I have run into an interesting cross-platform problem though. When localizing an app for Latin American countries which use Latin American Spanish, it is pretty common to support es-419. iOS will actually return this culture to you and builds just fine when creating a es-419.json resource file.

Android unfortunately, does not support that culture on OS versions below 7.0 I believe. When trying to run tns build android it's failing due to there being an android resource name values-es-r419.

platforms/android/app/src/main/res/values-es-r419: Error: Invalid resource directory name

Do you know of a work-around for this? If I change it to es-mx or es-us then the build succeeds but then it will not work properly on iOS.

Appreciate any help.

lfabreges commented 5 years ago

I don't know any workaround. The best way I can think of right now would be to modify the plugin in order to enable .ios or .android file extension for i18n files.

spstratis commented 5 years ago

Ok thanks for the info. I'll go ahead and close the issue.

mihnita commented 2 years ago

The naming should be values-b+es+419

See https://developer.android.com/guide/topics/resources/multilingual-support#postN

The -b<locale_using_+_as_separator> convention should be used for everything that is not 2 char language or 2 char language + 2 char region.

So

But