Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

How to achieve cross-platform multi-line localization strings?

$
0
0

This may be a bug, or a difference in how XCode/Mac/iOS handles XML parsing from i18n slightly differently from Android/JavaSDK.

I'm using Ti Studio 3.3x to build a mobile app. I've recently upgraded from iOS only to both iOS and Android. I have also migrated all strings in the UI to be in proper lang file i18n/en/strings.xml.

A few of my L( ) strings need to span multiple lines. I started out on Android. I put real line breaks into the xml file and it all ran together, so I added \n at the front of each new line... so in effect my strings.xml has some nodes that span multiple lines with actual line breaks, along with backslash-n char combos as well. The content becomes the hintText of a textArea...

Now everything seemed to be working on Android. But when I view it in iOS, the line breaks are preserved as well as the backslash-n's meaning on iOS my text has twice as many line breaks.

Is it possible to use CDATA without \n explicitly? Or should I be using four separate lang keys to achieve four lines of text in the project? That would seem redundant.

It's almost like iOS has preserve white space on, while Android does not. Any advice?


Viewing all articles
Browse latest Browse all 7655

Trending Articles