{ "id": "159867", "key": "TIMOB-23307", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-05-27T18:48:20.000+0000", "created": "2016-04-28T11:15:17.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-06-30T12:01:12.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": "SDK: 5.4.0.v20160426000033\r\n\r\nWhen setting the text property of a Ti.UI.label object to something containing '\\n' to represent new line, the '\\n' is printed in the UI instead of inserting a new line.\r\n\r\n", "attachment": [ { "id": "59101", "filename": "Screen Shot 2016-04-28 at 13.16.09.png", "author": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "created": "2016-04-28T11:17:29.000+0000", "size": 35415, "mimeType": "image/png" }, { "id": "59432", "filename": "win10_test.png", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-27T18:37:29.000+0000", "size": 28269, "mimeType": "image/png" } ], "flagged": false, "summary": "Windows: Localized strings in strings.xml don't handle \\n newlines", "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": null, "closedSprints": [ { "id": 631, "state": "closed", "name": "2016 Sprint 11 SDK", "startDate": "2016-05-21T00:06:10.029Z", "endDate": "2016-06-04T00:06:00.000Z", "completeDate": "2016-06-06T07:30:39.854Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "384433", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nI am unable to reproduce this issue. When setting the {{text}} property of a {{Ti.UI.label}} a new line is printed for {{\\n}} rather than '\\n'. \r\n\r\nSample String: \"A long label with\\n a few line breaks\\n and unicode (UTF8)\\n symbols such as\\n a white chess piece \\u2655\\nand the euro symbol \\u20ac\\nlooks like this!\\n'\"\r\n\r\n[Screenshot| https://i.imgsafe.org/903d5b7.png]\r\n\r\n*app.js:*\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n exitOnClose: true,\r\n fullscreen: false,\r\n layout: 'vertical',\r\n title: 'Label Demo'\r\n});\r\n\r\nvar label = Ti.UI.createLabel({\r\n color:'blue',\r\n text: 'A long label with\\n a few line breaks\\n and unicode (UTF8)\\n symbols such as\\n a white chess piece \\u2655\\nand the euro symbol \\u20ac\\nlooks like this!\\n',\r\n textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,\r\n top: 30,\r\n width: 300, height: 200\r\n});\r\n\r\nwin.add(label);\r\nwin.open();\r\n{code}\r\n\r\n*Environment*:\r\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", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-05-02T09:04:21.000+0000", "updated": "2016-05-02T09:06:28.000+0000" }, { "id": "384436", "author": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "body": "My text is set via the i18n stings.xml, like this:\r\n\r\n{code}\r\nThe app will use your phone position to determine your country location.\\nPlease review and accept the Privacy Policy.\r\n{code}\r\n\r\nand then in my .js: \r\n{code}\r\n$.upperTitle.text = L('EulaTitle');\r\n{code}", "updateAuthor": { "name": "jonasbjurhult", "key": "jonasbjurhult", "displayName": "Jonas Bjurhult", "active": true, "timeZone": "Europe/Stockholm" }, "created": "2016-05-02T09:25:06.000+0000", "updated": "2016-05-02T09:26:07.000+0000" }, { "id": "384546", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nI am able to reproduce this issue when the string is defined in strings.xml file. So it seems that the issue is not related to Label but with localized string values.\r\n*Steps:*\r\n1. Create a default classic project for windows phone.\r\n2. Replace app.js file code with following.\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n exitOnClose: true,\r\n fullscreen: false,\r\n layout: 'vertical',\r\n title: 'Label Demo'\r\n});\r\n\r\nvar label = Ti.UI.createLabel({\r\n color:'blue',\r\n text: L('TestText'),\r\n textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,\r\n top: 30,\r\n width: 300, height: 200\r\n});\r\n\r\nwin.add(label);\r\nwin.open();\r\n{code}\r\n3. Create strings.xml file in the folder \"i18n\\en\".\r\n4. Replace content of strings.xml file with following.\r\n{code}\r\n\r\n\tA long label with\\n a few line breaks\\n and unicode (UTF8)\\n symbols such as\\n a white chess piece \\u2655\\nand the euro symbol \\u20ac\\nlooks like this!\\n\r\n\r\n{code}\r\n5. Build and run the app on Windows device. >> It is seen in the label that newline is not printed in case of '\\n' rather {{\\n}} is printed. [Screenshot| https://i.imgsafe.org/8160c00.png].\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", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-05-03T06:55:08.000+0000", "updated": "2016-05-03T06:55:08.000+0000" }, { "id": "387014", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/722", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-05-27T08:12:58.000+0000", "updated": "2016-05-27T08:12:58.000+0000" }, { "id": "389573", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified using:\r\n\r\nWindows 10 Pro\r\nTi SDK: 5.4.0.v20160629063537\r\nAppc NPM: 4.2.7-2 \r\nAppc CLI: 5.4.0-23\r\nAppc Studio: 4.7.0.201606220541\r\nLumia 930: 10.0\r\nLumia 520: 8.1\r\n\r\nUsing the example attached the string displayed now matches what is shown on iOS.\r\n\r\nClosing ticket.", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-06-30T12:01:05.000+0000", "updated": "2016-06-30T12:01:05.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }