{ "id": "159924", "key": "TIMOB-23301", "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": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-05-03T17:48:31.000+0000", "created": "2016-05-02T13:39:49.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-5.3.0" ], "versions": [], "issuelinks": [ { "id": "51533", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "159714", "key": "TIMOB-23296", "fields": { "summary": "Windows: Implement Ti.Locale.setLanguage", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2016-05-09T20:53:28.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": "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", "attachment": [], "flagged": false, "summary": "Windows: Ti.API.log doesn't handle single argument", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "SDK 5.3.0.v20160418111755", "closedSprints": [ { "id": 624, "state": "closed", "name": "2016 Sprint 09 SDK", "startDate": "2016-04-23T00:39:45.452Z", "endDate": "2016-05-07T00:39:00.000Z", "completeDate": "2016-05-09T03:43:10.279Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "384452", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "My best guess is that in the Ti.Locale constructor where we do:\r\n{code:cpp}\r\ncurrentLocale__ = TitaniumWindows::Utility::ConvertString(GlobalizationPreferences::Languages->GetAt(0));\r\n{code}\r\nThat's failing because {{GlobalizationPreferences::Languages}} is empty?", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-02T13:43:01.000+0000", "updated": "2016-05-02T13:43:01.000+0000" }, { "id": "384453", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/656\r\nhttps://github.com/appcelerator/titanium_mobile_windows/pull/657", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-02T14:04:17.000+0000", "updated": "2016-05-02T14:04:17.000+0000" }, { "id": "384589", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "The problem is Ti.API.log.\r\n{code:javascript}\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.currentLanguage;\r\nTi.API.info(\"Initial Language: \" + lan);\r\n{code}\r\nThis works\r\n\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.API-method-log\r\nlevel is not working correctly on Windows", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-03T14:24:11.000+0000", "updated": "2016-05-03T14:24:11.000+0000" }, { "id": "384599", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Hmm, I'm not even sure this is valid JS here. The Ti.API.log method takes two arguments, but in this sample there's only one arg. That's the likely cause of the issue here.\r\n\r\nI would say we should better handle this single arg call, though. It looks like Android handles this case and assume INFO level logging when we only get a single argument, and that the argument is the message. See https://github.com/appcelerator/titanium_mobile/blob/415bd6c66dcc55b1a59a59574f3babd3c3a84ede/android/runtime/v8/src/native/modules/APIModule.cpp#L188", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-03T15:27:00.000+0000", "updated": "2016-05-03T15:27:00.000+0000" }, { "id": "385185", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed\r\nTested on:\r\nNokia Lumia 928 (8.1) \r\nWindows Simulator (8.1) \r\nMicrosoft Lumia 640 (10) \r\nWindows Simulator (10) \r\nWindows 10 \r\nStudio: 4.6.0.201605030516\r\nTi SDK: 5.3.0.v20160509074015\r\nAppc NPM: 4.2.5-5 \r\nApp CLI: 5.3.0-44 \r\nNode v4.4.3\r\n\r\n*Closing Ticket.*", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-09T20:53:15.000+0000", "updated": "2016-05-09T20:53:15.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }