[TIMOB-23307] Windows: Localized strings in strings.xml don't handle
newlines
| GitHub Issue | n/a |
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-05-27T18:48:20.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 5.4.0 |
| Components | Windows |
| Labels | n/a |
| Reporter | Jonas Bjurhult |
| Assignee | Kota Iguchi |
| Created | 2016-04-28T11:15:17.000+0000 |
| Updated | 2016-06-30T12:01:12.000+0000 |
Description
SDK: 5.4.0.v20160426000033
When 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.
Attachments
Hello, I am unable to reproduce this issue. When setting the
textproperty of aTi.UI.labela new line is printed for\nrather than '\n'. Sample 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'" [Screenshot| https://i.imgsafe.org/903d5b7.png] *app.js:**Environment*: *Device info:* Microsoft Lumia 640 (Windows Phone 8.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.4.0.v20160429102159 *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0var win = Ti.UI.createWindow({ backgroundColor: 'white', exitOnClose: true, fullscreen: false, layout: 'vertical', title: 'Label Demo' }); var label = Ti.UI.createLabel({ color:'blue', 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', textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT, top: 30, width: 300, height: 200 }); win.add(label); win.open();My text is set via the i18n stings.xml, like this:
and then in my .js:$.upperTitle.text = L('EulaTitle');Hello, I 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. *Steps:* 1. Create a default classic project for windows phone. 2. Replace app.js file code with following.
3. Create strings.xml file in the folder "i18n\en". 4. Replace content of strings.xml file with following.var win = Ti.UI.createWindow({ backgroundColor: 'white', exitOnClose: true, fullscreen: false, layout: 'vertical', title: 'Label Demo' }); var label = Ti.UI.createLabel({ color:'blue', text: L('TestText'), textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT, top: 30, width: 300, height: 200 }); win.add(label); win.open();5. Build and run the app on Windows device. >> It is seen in the label that newline is not printed in case of '\n' rather\nis printed. [Screenshot| https://i.imgsafe.org/8160c00.png]. Thanks *Environment*: *OS :Microsoft Windows 8.1 Enterprise N *Device info:* Microsoft Lumia 640 (Windows Phone 8.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.4.0.v20160429102159 *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0https://github.com/appcelerator/titanium_mobile_windows/pull/722
Verified using: Windows 10 Pro Ti SDK: 5.4.0.v20160629063537 Appc NPM: 4.2.7-2 Appc CLI: 5.4.0-23 Appc Studio: 4.7.0.201606220541 Lumia 930: 10.0 Lumia 520: 8.1 Using the example attached the string displayed now matches what is shown on iOS. Closing ticket.