{
"id": "160650",
"key": "AC-3680",
"fields": {
"issuetype": {
"id": "1",
"description": "A problem which impairs or prevents the functions of the product.",
"name": "Bug",
"subtask": false
},
"project": {
"id": "12217",
"key": "AC",
"name": "Appcelerator - INBOX",
"projectCategory": {
"id": "10000",
"description": "",
"name": "Customer Service"
}
},
"resolution": {
"id": "3",
"description": "The problem is a duplicate of an existing issue.",
"name": "Duplicate"
},
"resolutiondate": "2016-06-02T16:20:37.000+0000",
"created": "2016-06-01T08:35:11.000+0000",
"labels": [],
"versions": [],
"issuelinks": [],
"assignee": {
"name": "shossain",
"key": "shossain",
"displayName": "Shak Hossain",
"active": false,
"timeZone": "America/Los_Angeles"
},
"updated": "2016-06-02T16:20:37.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": [],
"description": "Setting language via Ti.Locale.setLanguage() changes language in the app, but it does not affect the language returned in Ti.Locale.getString()/L()like on iOS or Android.\r\n\r\nThe following code shows the problem:\r\n\r\nindex.js\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\ni18n/en/strings.xml\r\n{code}\r\n\r\n\tThis is a test string in English\r\n\r\n{code}\r\n\r\ni18n/sv/strings.xml\r\n{code}\r\n\r\n\tThis is a test string in Swedish\r\n\r\n{code}",
"attachment": [],
"flagged": false,
"summary": "Windows: Ti.Locale.getString()/L() does not reflect 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.4.0.v20160531005402",
"comment": {
"comments": [
{
"id": "387382",
"author": {
"name": "nsalahin",
"key": "nsalahin",
"displayName": "Nazmus Salahin",
"active": true,
"timeZone": "Asia/Dhaka"
},
"body": "Hello,\r\nI am able to reproduce this issue with given code and given steps.\r\n*Steps:*\r\n1. Create a default classic project for Windows Phone.\r\n2. Replace the app.js file with following code.\r\n{code}\r\n\r\nvar win= Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nwin.open();\r\n\r\n\r\nTi.Locale.setLanguage('en');\r\n\r\nTi.API.info('current language is: ' + Ti.Locale.getCurrentLanguage());\r\n\r\nTi.API.info('before change ' + L('test'));\r\n\r\nTi.Locale.setLanguage('sv');\r\n\r\nTi.API.info('new language is: ' + Ti.Locale.getCurrentLanguage());\r\n\r\nTi.API.info('after change ' + L('test'));\r\n\r\n{code}\r\n3. Create {{i18n/en}} and {{i18n/sv}} folder.\r\n4. In the {{i18n/en}} create strings.xml file with following content.\r\n{code}\r\n\r\n\r\n\tThis is a test string in English\r\n\r\n\r\n{code}\r\n5. In the {{i18n/sv}} create strings.xml file with the following content.\r\n{code}\r\n\r\n\r\n\tThis is a test string in Swedish\r\n\r\n\r\n\r\n{code}\r\n4. Build and run the app . Following log is produced.\r\n{code}\r\n[INFO] : current language is: en\r\n[INFO] : before change This is a test string in English\r\n[INFO] : new language is: sv\r\n[INFO] : after change This is a test string in English\r\n{code}\r\n\r\nThanks\r\n\r\n\r\n*Environment*:\r\n\r\n*OS :* Microsoft Windows 8.1 Enterprise N\r\n*Device info:* 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.4.0.v20160429102159\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\r\n",
"updateAuthor": {
"name": "nsalahin",
"key": "nsalahin",
"displayName": "Nazmus Salahin",
"active": true,
"timeZone": "Asia/Dhaka"
},
"created": "2016-06-02T05:37:06.000+0000",
"updated": "2016-06-02T05:37:06.000+0000"
},
{
"id": "387425",
"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-06-02T16:19:45.000+0000",
"updated": "2016-06-02T16:19:45.000+0000"
}
],
"maxResults": 3,
"total": 3,
"startAt": 0
}
}
}