Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19566] Ti.Locale.currentLanguage returns locale on iOS 9

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-10-05T21:22:51.000+0000
Affected Version/sRelease 5.0.0
Fix Version/sRelease 5.2.0
ComponentsiOS
Labelslocale
ReporterFokke Zandbergen
AssigneeAngel Petkov
Created2015-09-22T13:31:10.000+0000
Updated2016-01-22T00:51:36.000+0000

Description

Since iOS 9 the same Titanium SDK returns a different value for Ti.Locale.currentLanguage. It now returns the full locale instead of just the language: *app.js*
console.log('currentLanguage ' + Ti.Locale.currentLanguage);
console.log('currentCountry ' + Ti.Locale.currentCountry);
console.log('currentLocale ' + Ti.Locale.currentLocale);
*iOS 8.4*
[INFO]  currentLanguage en
[INFO]  currentCountry US
[INFO]  currentLocale en-US
*iOS 9*
[INFO]  currentLanguage en-US
[INFO]  currentCountry US
[INFO]  currentLocale en-US
*Code* * https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/LocaleModule.m#L26-L29 * https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiLocale.m#L32-L42 Found by Q&A user https://community.appcelerator.com/topic/3430/ti-locale-getcurrentlanguage-on-ios-9-returns-en-us-instead-en

Comments

  1. Angel Petkov 2015-09-29

    Thanks you for including so much detail in your ticket , should display the language without the location now. *PR* https://github.com/appcelerator/titanium_mobile/pull/7254
  2. Fokke Zandbergen 2015-10-08

    [~apetkov] this issue should be high pro because apps break on iOS9 without the fix. If we do a 5.0.3 this should be in it and for sure it must be in 5.1.0.
  3. Harry Bryant 2016-01-22

    Verified as fixed as of 5.1.1.GA onwards. compared values of Ti.Locale.currentLanguage for iOS 9.2 & 8.4. Tested on: iPhone 6s Plus Device (9.2) & iPhone 6 Plus Device (8.4) Mac OSX El Capitan 10.11 (15A284) Ti SDK: 5.2.0.v20160114021251 & 5.1.1.GA Appc NPM: 4.2.3-1 App CLI: 5.2.0-231 Xcode 7.2 Node v4.2.3 *Closing Ticket.*

JSON Source