{ "id": "79072", "key": "TIMOB-4972", "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": [ { "id": "12083", "description": "", "name": "Sprint 2011-43", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-10-26T14:34:29.000+0000", "created": "2011-08-09T23:09:21.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [ { "id": "28928", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "114064", "key": "TIDOC-1162", "fields": { "summary": "Titanium.Platform.locale different value between Android and iOS", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:22:29.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": "The behavior described below may be an SDK issue or a doc issue. The behavior is not consistent across platforms. The documentation is also misleading when you are dealing with iOS. I am setting it to the \"iOS\" component to start with.\r\n\r\nh4. Docs\r\nThe Blog ( http://developer.appcelerator.com/blog/2010/08/dealing-with-multiple-screens-and-multiple-languages.html ) says that you can use \"en-US\" as a folder for your strings.xml to refer to \"United States English\". For \"British English\" the code is \"en-GB\".\r\n\r\nh4. iOS\r\niOS 4.3 only provides two English language options \"English\" which returns \"en\" from Ti.Locale.currentLanguage, and \"British English\" which returns \"en-GB\" \r\n\r\nIf you have 2 i18n folders \"en-GB\" and \"en-US\", it will use the \"en-GB\" folder when you have the Language set to either \"English\" or \"British English\". \r\n\r\nIf you have 2 i18n folders \"en-GB\" and \"en\", it will use \"en\" when you have the Language set to \"English\" and \"en-GB when you have the Language set to \"British English\".\r\nTested with:\r\nTiSDK 1.7.2\r\niOS Simulator 4.3 \r\n\r\nh4. Android\r\nAndroid works as expected and uses the \"en\" or \"en-US\" folder when the Language is set to \"English (United States)\" as well as using the \"en-GB\" folder when Language is \"English (United Kingdom)\". Also, \"en-US\" is used when \"English (United States)\" is selected and the \"en\" folder is present (as expected).\r\nTested with:\r\nTiSDK 1.7.2\r\nAndroid Emulator 2.2\r\n\r\nh4. Repro Case\r\nNote: to change the language in iOS go to Settings>General>International>Language\r\n\r\nStep 1: attached is a file named \"i18n.zip\", unzip it and put it in the root of your project. \r\nStep 2: copy the code below into your app.js\r\nStep 3: launch the app\r\nStep 4: if the language is set to \"English\", the label will show \"EN GB\" but it should show \"EN US\"\r\nStep 5: change the language to \"British English\", the label will still show \"EN GB\".\r\nStep 6: in the i18n folder change the name of your \"en-US\" folder to \"en\" and in the strings.xml file that is in that folder change the label of test from \"EN US\" to \"EN\"\r\nStep 7: build and run your app again\r\nStep 8: Now, if the language is set to \"English\", the label will show \"EN\" as it should\r\nStep 9: change the language to \"British English\", the label will show \"EN GB\" as it should\r\n\r\n{code:title=\"app.js\"}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'blue'\r\n});\r\n\r\nvar label = Ti.UI.createLabel({\r\n\ttext: L('test'),\r\n\ttop: 20,\r\n\twidth: 300,\r\n\theight: 40\r\n});\r\nlabel.addEventListener('click', function(e){\r\n Ti.API.info(\"Ti.Locale.currentCountry: \" + Ti.Locale.currentCountry);\r\n Ti.API.info(\"Ti.Locale.currentLanguage: \" + Ti.Locale.currentLanguage);\r\n Ti.API.info(\"Ti.Locale.currentLocale: \" + Ti.Locale.currentLocale);\r\n});\r\n\r\nwin.add(label);\r\nwin.open();\r\n{code}\r\n\r\nh4. Workaround\r\nUse the folder name \"en\" instead of \"en-US\" and it will work as expected.\r\n\r\nh4. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-225593", "attachment": [ { "id": "22430", "filename": "i18n.zip", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-09T23:09:21.000+0000", "size": 2072, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: localization does not work as expected based on documentation", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.7.2\r\niOS Simulator 4.3", "comment": { "comments": [ { "id": "169519", "author": { "name": "james.wragg", "key": "james.wragg", "displayName": "James Wragg", "active": true, "timeZone": "Europe/London" }, "body": "Any news on when this may be tackled? I have an immediate need for this functionality.\r\n\r\nThanks,\r\nJames (the person who originally reported this to Jon Alter)", "updateAuthor": { "name": "james.wragg", "key": "james.wragg", "displayName": "James Wragg", "active": true, "timeZone": "Europe/London" }, "created": "2011-10-18T04:16:02.000+0000", "updated": "2011-10-18T04:16:02.000+0000" }, { "id": "170571", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Apple actually doesn't have any internalization based on dialect , it can only done based on Language, this can be read \r\n\r\nhttp://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/Articles/LanguageDesignations.html#//apple_ref/doc/uid/20002144-SW3\r\n\r\nThe fact that there exist en-GB & en is because apple treats this as a different Language (English and British English)and it can be seen that there is no en-US/en-AU/etc....\r\n\r\nThe entire list of Languages supported are en, fr, de, ja, nl, it, es, pt, pt-PT, da, fi, nb, sv, ko, zh-Hans, zh-Hant, ru, pl, tr, uk, ar, hr, cs, el, he, ro, sk, th, id, ms, en-GB, ca, hu, vi \r\n\r\nOtherwise: English , British English (UK), French (France), German, Traditional Chinese, Simplified Chinese, Dutch, Italian, Spanish, Portuguese (Brazil), Portuguese (Portugal), Danish, Swedish, Finnish, Norwegian, Korean, Japanese, Russian, Polish, Turkish, Ukrainian, Hungarian, Arabic, Thai, Czech, Greek, Hebrew, Indonesian, Malay, Romanian, Slovak, Croatian, Catalan, and Vietnamese", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-26T14:32:27.000+0000", "updated": "2011-10-26T14:33:33.000+0000" }, { "id": "415671", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:22:29.000+0000", "updated": "2017-03-24T18:22:29.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }