Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5313] Ti.Locale.setLanguage("en") does not select iso country code regions eg en-US, en-GB - Defaults to en.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2017-11-19T20:53:21.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterMichael Buxton
AssigneeShak Hossain
Created2017-10-27T10:08:24.000+0000
Updated2017-11-19T20:53:21.000+0000

Description

We have a multi-lingual app. Supporting EN, EN-gb, EN-us, DE, FR, PT, JA and ES (English, British English, American English, German, French, Portuguese and Spanish) Our i18n files are the following: de, en, en-gb, en-US, es, fr, ja, pt. .XML files. Letting the app automatically select the language if the user is in the UK or US correctly sets en-gb or en-US. Giving the user the chance to manually change their language using Ti.Locale.setLanguage("en") on iOS only accepts an ISO 639-1 country code, eg "en". We've then found it chooses the first file it finds in the i18n folder that matches it - "en". So when manually setting right now it does not allow country specific languages, eg American English. You would assume it would pick up the country code that a user is in after the language is selected, eg en-US, en-GB. Deleting the country "en" .xml file from the i18n folder, to test if this will fix it does not work as then en's root is missing and sets the language to the next iso language alphabetically in the list (Which is DE - German).

Comments

  1. Sharif AbuDarda 2017-10-28

    Hello, Can you provide a sample app which demonstrates the behavior? Thanks.
  2. Mostafizur Rahman 2017-11-15

    Hello [~mbuxton],
Just passing a followup here.Are you able to get that sorted out?  Please let us know if you need more help with this issue. Regards
 Axway Appcelerator Support

JSON Source