{ "id": "159714", "key": "TIMOB-23296", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-06-14T19:08:21.000+0000", "created": "2016-04-20T07:12:35.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "51533", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "159924", "key": "TIMOB-23301", "fields": { "summary": "Windows: Ti.API.log doesn't handle single argument", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51532", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "159923", "key": "TIDOC-2514", "fields": { "summary": "Ti.Locale.setLanguage is undocumented", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51990", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "160318", "key": "TIMOB-23404", "fields": { "summary": "Windows parity: App name is not sourced from app.xml in folders suffixed with ISO 3166-1 Alpha-2 code", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-10-13T16:17:23.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "Both iOS and Android supports Ti.Locale.setLanguage, however the function is not documented.\r\n\r\nIs it supposed to be supported or is it deprecated?\r\n\r\n*Test code*\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({ backgroundColor: 'green' });\r\nwin.addEventListener('open', function () {\r\n Ti.Locale.setLanguage('en');\r\n Ti.API.info('current language is: ' + Ti.Locale.getCurrentLanguage());\r\n Ti.API.info('before change ' + L('this is my key'));\r\n Ti.Locale.setLanguage('en-GB');\r\n Ti.API.info('new language is: ' + Ti.Locale.getCurrentLanguage());\r\n Ti.API.info('after change ' + L('this is my key'));\r\n});\r\nwin.open();\r\n{code}\r\n\r\n{code:title=i18n/en/strings.xml}\r\n\r\n\r\n this is my value\r\n\r\n{code}\r\n\r\n{code:title=i18n/en-GB/strings.xml}\r\n\r\n\r\n this is my en-GB value\r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Windows: Implement Ti.Locale.setLanguage", "creator": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "subtasks": [], "reporter": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "environment": "SDK 5.3.0.v20160418111755", "closedSprints": [ { "id": 641, "state": "closed", "name": "2016 Sprint 12 SDK", "startDate": "2016-06-04T00:30:28.612Z", "endDate": "2016-06-18T00:30:00.000Z", "completeDate": "2016-06-20T04:25:16.065Z", "originBoardId": 114 }, { "id": 627, "state": "closed", "name": "2016 Sprint 10 SDK", "startDate": "2016-05-07T00:43:56.954Z", "endDate": "2016-05-21T00:43:00.000Z", "completeDate": "2016-05-23T02:06:04.349Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "383676", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-04-22T14:57:24.000+0000", "updated": "2016-04-22T14:57:24.000+0000" }, { "id": "383875", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nI have found that {{Ti.Locale.setLanguage}} works on Android but not on Windows Phone.\r\n*Steps:*\r\n1. Create a default classic project.\r\n2. Replace app.js code with following.\r\n{code}\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\n\r\nwin1.open();\r\n\r\nvar lan=Ti.Locale.getCurrentLanguage();\r\nTi.API.log(\"Initial Language: \"+lan);\r\nTi.Locale.setLanguage(\"fr\");\r\nlan=Ti.Locale.getCurrentLanguage();\r\nTi.API.log(\"Language Changed To: \"+lan);\r\n{code}\r\n3. Build and run the app.\r\n4.On Android following console log is produced. \r\n{code}\r\n[INFO] : Initial Language: en\r\n[INFO] : Language Changed To: fr\r\n{code}\r\nBut on Windows Phone the app fails to run and following error log is produced.\r\n{code}\r\n[ERROR] : Application Error: {\r\n[ERROR] : \"line\": 2,\r\n[ERROR] : \"column\": 10,\r\n[ERROR] : \"message\": \"Error while require(/app) invalid vector subscript\",\r\n[ERROR] : \"native_stack\": [\r\n[ERROR] : \"JSExportClass::CallNamedFunction\"\r\n[ERROR] : ]\r\n[ERROR] : }\r\n{code}\r\nThanks\r\n\r\n*Environment*:\r\n\r\n*Device info:* Nexus7 (android 6.0.1) , Microsoft Lumia 640 (Windows Phone 8.1)\r\n*Node.js Version:* 0.12.7\r\n*npm Version:* 2.11.3\r\n*Titanium SDKs:* 5.2.2.GA and 5.2.1.GA\r\n*Java Development Kit Version:* 1.8.0_73\r\n*Titanium CLI Version:* 5.0.5\r\n*Appcelerator CLI Version:* 5.2.2\r\n*Appcelerator Studio:* 4.5.0", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-26T05:51:43.000+0000", "updated": "2016-04-26T05:51:43.000+0000" }, { "id": "383878", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi [~sdarda],\r\n\r\nI am not sure what is happening with this ticket, being able to override the language that is possible in Android and iOS is NOT possible in Windows, the Windows SDK Parity list in the highly build says that the setLanguage is indeed supported, so this is a bugg in the Windows SDK and not a new feature request. The reference Ticket you are mentioning is way too old and before Win was supported. Can you please escalate this as the Win 5.3.0 GA is coming up and you may want to fix all bugs related to this...\r\n\r\nRegards", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-26T06:13:52.000+0000", "updated": "2016-04-28T04:29:16.000+0000" }, { "id": "384449", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "According to our own docs (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Locale), the country/currency/language properties are read-only and there are no set methods. But yes, after looking at the source for iOS and Android we do in fact support Ti.Locale.setLanguage. We need to support this on Windows as well.\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/415bd6c66dcc55b1a59a59574f3babd3c3a84ede/android/modules/locale/src/java/ti/modules/titanium/locale/LocaleModule.java#L90\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/415bd6c66dcc55b1a59a59574f3babd3c3a84ede/iphone/Classes/LocaleModule.m#L68", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-02T13:32:08.000+0000", "updated": "2016-05-02T13:32:08.000+0000" }, { "id": "384451", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "[~jonasbjurhult] So this looks like a combination of a few things! First, our docs don't list the method, so I opened a ticket to add it to our docs. Second, because it wasn't in our docs we missed it when implementing Ti.Locale on Windows, so this ticket is now about tracking adding support for it. Third, I'm guessing there may actually be a bug that [~nsalahin] found as well in Ti.Locale.getCurrentLanguage(). I'll clone off another ticket to track that.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-02T13:39:27.000+0000", "updated": "2016-05-02T13:41:55.000+0000" }, { "id": "384455", "author": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "body": "Thank you for the update! ", "updateAuthor": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "created": "2016-05-02T14:35:46.000+0000", "updated": "2016-05-02T14:35:46.000+0000" }, { "id": "384849", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "So looks like we should:\r\n- accept a single string argument, which may be something like \"en\" or \"en-US\".\r\n- Set Ti.Locale.currentLocale to the the value (if it's a valid locale)\r\n- tell the \"system\" to use that locale - not really sure how we programmatically change the app/system locale on Windows right now, we'll have to look.\r\n\r\nSee http://stackoverflow.com/questions/20883627/localization-on-the-fly-in-winrt-app\r\nand scenario 8 of https://code.msdn.microsoft.com/windowsapps/Application-resources-and-cd0c6eaa\r\n\r\nLooks like it boils down to using the Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride property.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-05T13:59:30.000+0000", "updated": "2016-05-05T13:59:30.000+0000" }, { "id": "387253", "author": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "body": "I just tried setLanguage() using the latest nightly and the function itself works, but there is a problem remaining.\r\nThe macro L() or Ti.locale.getString() is not affected byt the value set in Ti.Locale.setCurrentLanguage()\r\n\r\n{code}\r\nTi.Locale.setLanguage('en');\r\nTi.API.info('current language is: ' + Ti.Locale.getCurrentLanguage());\r\nTi.API.info('before change ' + L('test'));\r\nTi.Locale.setLanguage('sv');\r\nTi.API.info('new language is: ' + Ti.Locale.getCurrentLanguage());\r\nTi.API.info('after change ' + L('test'));\r\n{code}\r\n\r\nThe L() macro will give the same result no matter what language is set in setLanguage()\r\n", "updateAuthor": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "created": "2016-06-01T06:53:51.000+0000", "updated": "2016-06-01T06:53:51.000+0000" }, { "id": "387838", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/737", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-06-08T09:47:21.000+0000", "updated": "2016-06-08T09:47:21.000+0000" }, { "id": "398841", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified using:\r\n\r\nOS: Microsoft Windows 10 Pro 10.0.14393\r\nAppc core: 6.0.0-58\r\nAppc NPM: 4.2.8-7\r\nTi SDK: 6.0.0.v20161013072802\r\nAppc Studio: 4.8.0.201610060953\r\n\r\nAn apps language can now be set using Ti.Locale.setLanguage. When implementing this into your application please take [this|https://msdn.microsoft.com/pl-pl/windows/uwp/globalizing/manage-language-and-region] documentation from Microsoft into account as setting a users language may differ from what is expected due to the platforms behaviour\r\n\r\nClosing ticket", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-10-13T16:17:17.000+0000", "updated": "2016-10-13T16:17:17.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }