{ "id": "138275", "key": "TIMOB-17885", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2014-10-29T07:52:12.000+0000", "created": "2014-10-20T05:54:26.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "TCSupportTriage" ], "versions": [], "issuelinks": [ { "id": "46771", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "144647", "key": "TIMOB-18570", "fields": { "summary": "i18n: Only en strings load on simulator", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-23T21:19:20.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "In IOS 8.1 simulator (not on device), Titanium.Locale.currentLanguage can only return \"en\", no matter what the system language is set to.\r\n\r\nThis is the code that sets the default locale: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiLocale.m#L31", "attachment": [], "flagged": false, "summary": "iOS 8.1: Titanium.Locale.currentLanguage only returns \"en\" as language", "creator": { "name": "aee", "key": "aee", "displayName": "aee Q", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aee", "key": "aee", "displayName": "aee Q", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "xcode 6.1\r\n ios 8.1 simulator\r\n tisdk 3.4.0", "comment": { "comments": [ { "id": "328705", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You might review TIDOC-1162 for an alternate approach.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-20T22:16:22.000+0000", "updated": "2014-10-20T22:16:22.000+0000" }, { "id": "328739", "author": { "name": "aee", "key": "aee", "displayName": "aee Q", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ti.Locale.currentLanguage returns same result.\r\nBut it is ok on ios8.1 device. ", "updateAuthor": { "name": "aee", "key": "aee", "displayName": "aee Q", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-21T02:24:56.000+0000", "updated": "2014-10-21T02:24:56.000+0000" }, { "id": "328746", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Tested with Ti.Locale.currentLanguage on Xocde 6, iPhone 6 simulator. \r\nIt works well. ", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-10-21T03:39:00.000+0000", "updated": "2014-10-21T03:39:00.000+0000" }, { "id": "328788", "author": { "name": "aee", "key": "aee", "displayName": "aee Q", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes,Xocde 6 is ok, only on xcode6.1,ios8.1 simulator", "updateAuthor": { "name": "aee", "key": "aee", "displayName": "aee Q", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-21T12:58:26.000+0000", "updated": "2014-10-21T12:58:26.000+0000" }, { "id": "328790", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~aee] Please provide a code sample, and you say it _only_ fails on iOS 8.1 simulator, not on 8.1 device? [~sliang] can you please test on Xcode 6.1 with iOS 8.1?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-21T13:49:12.000+0000", "updated": "2014-10-21T13:49:58.000+0000" }, { "id": "328957", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Tested with Xcode 6.1, problem can be reproduced.\r\n\r\nh6.Reproduced Step:\r\n1.Update Xcode to 6.1.\r\n2.Run the following simple app on iOS 8.1 simulator.\r\n3.Got \"en\" language result.\r\n4.Change language setting to Chinese.\r\n\r\nh6.Actual Result:\r\nStill got \"en\" language result.\r\n\r\nh6.Expect Result:\r\nshould be \"zh-cn\".\r\n\r\nAlso tried French, same problem.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({ \r\n backgroundColor: '#fff',\r\n});\r\n \r\nTi.API.info(Ti.Locale.currentLanguage);\r\nalert(Ti.Locale.currentLanguage);\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-10-22T01:39:41.000+0000", "updated": "2014-10-22T01:39:41.000+0000" }, { "id": "328978", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I just drafted up a project in Xcode 6.1 using both the [official|https://developer.apple.com/library/Mac/qa/qa1391/_index.html] and [Titanium|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiLocale.m#L31-L41]'s code:\r\n\r\n{code}\r\n NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];\r\n NSDictionary * globalDomain = [defaults persistentDomainForName:@\"NSGlobalDomain\"];\r\n NSArray * languages = [globalDomain objectForKey:@\"AppleLanguages\"];\r\n NSLog(@\"%@\\n\", languages);\r\n \r\n NSArray* languages2 = [[NSUserDefaults standardUserDefaults] objectForKey:@\"AppleLanguages\"];\r\n NSLog(@\"%@\\n\", languages2);\r\n{code}\r\n\r\nand ran this on my iPhone 6 running 8.1 that has Dutch (nl) as the default language and correctly got:\r\n\r\n{code}\r\n2014-10-22 08:52:45.580 loale[764:229685] (\r\n nl,\r\n en\r\n)\r\n2014-10-22 08:52:45.581 loale[764:229685] (\r\n nl,\r\n en\r\n)\r\n{code}\r\n\r\nRunning the same code in iOS 8.1 Simulator gives:\r\n\r\n{code}\r\n2014-10-22 08:59:03.854 loale[3687:210933] (null)\r\n2014-10-22 08:59:03.857 loale[3687:210933] (\r\n en\r\n)\r\n{code}\r\n\r\nRunning the same code in iOS 7.1 Simulator (build from Xcode 6.1) gives:\r\n\r\n{code}\r\n2014-10-22 09:02:41.046 loale[3824:607] (\r\n nl,\r\n en,\r\n fr,\r\n de,\r\n \"zh-Hans\",\r\n \"zh-Hant\",\r\n ja,\r\n it,\r\n es,\r\n ko,\r\n pt,\r\n \"pt-PT\",\r\n da,\r\n fi,\r\n nb,\r\n sv,\r\n ru,\r\n pl,\r\n tr,\r\n uk,\r\n ar,\r\n hr,\r\n cs,\r\n el,\r\n he,\r\n ro,\r\n sk,\r\n th,\r\n id,\r\n ms,\r\n \"en-GB\",\r\n ca,\r\n hu,\r\n vi\r\n)\r\n2014-10-22 09:02:41.047 loale[3824:607] (\r\n nl,\r\n en,\r\n fr,\r\n de,\r\n \"zh-Hans\",\r\n \"zh-Hant\",\r\n ja,\r\n it,\r\n es,\r\n ko,\r\n pt,\r\n \"pt-PT\",\r\n da,\r\n fi,\r\n nb,\r\n sv,\r\n ru,\r\n pl,\r\n tr,\r\n uk,\r\n ar,\r\n hr,\r\n cs,\r\n el,\r\n he,\r\n ro,\r\n sk,\r\n th,\r\n id,\r\n ms,\r\n \"en-GB\",\r\n ca,\r\n hu,\r\n vi\r\n)\r\n{code}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-10-22T06:53:46.000+0000", "updated": "2014-10-22T07:03:40.000+0000" }, { "id": "329291", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Thanks [~fokke] for the testing and results. \r\nAfter reviewing Xcode 6.1 release notes, simulator has some changes that might have caused this.\r\nhttps://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc6_release_notes.html\r\nParticularly the following:\r\n*Settings changed in the Settings app on iOS Simulator may not persist. (18238018)*\r\n*In some situations, [NSLocale currentLocale] may return en_US instead of the chosen locale in the iOS 8.1 simulator. (18512161)*\r\n\r\nWhich is why Titanium.Locale.currentLanguage works in device and NOT simulator.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-10-24T03:27:23.000+0000", "updated": "2014-10-24T03:27:45.000+0000" }, { "id": "415386", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T21:19:20.000+0000", "updated": "2017-03-23T21:19:20.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }