[TIMOB-2560] Android: Locale strings with quotes/apostrophes cause syntax errors in generated strings.xml
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:59:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M02 |
Components | Android |
Labels | android, defect, locale, release-1.6.0, strings |
Reporter | Marshall Culpepper |
Assignee | Bill Dawson |
Created | 2011-04-15T03:22:47.000+0000 |
Updated | 2011-04-17T01:59:27.000+0000 |
Description
Android strings inside a <string>
tag must be
escaped if they use quotes or apostrophes. From the ADT strings.xml
editor:
"If you use an apostrophe or a quote in your string, you must
either escape it or enclose the whole string in the other kind of
enclosing quotes."
The escape character is simply "\"
Attachments
File | Date | Size |
---|---|---|
quotestring.zip | 2011-04-15T03:22:48.000+0000 | 770498 |
To QA:
You can test this by importing the attached project in QuoteString.zip. In the failcase, it won't even compile when you click 'Launch', because it has some values in i18n/en/strings.xml which contain single and double quotes that are not preceded by backslashes (required by the Android resource compiler.)
After you install the fixed version of the mobile sdk, the project should launch fine, and you'll see two labels (about Jimmy Stewart) which should match each other. One is typed directly into the .JS file, the other is getting the string from the i18n/en using our localization framework.
(from [9bdcc77bd04c006be3b9c1bd739d45f37fdd4b4f]) [#2560 state:fixed-in-qa] In string resources (i18n), check for quotes and double-quotes not preceded by backslashes and fix them https://github.com/appcelerator/titanium_mobile/commit/9bdcc77bd04c006be3b9c1bd739d45f37fdd4b4f"> https://github.com/appcelerator/titanium_mobile/commit/9bdcc77bd04c...
[INFO] Titanium SDK version: 1.6.0 (01/04/11 08:01 e49700d) emulator 2.2, device 2.2.1 droid 1 and 1.6 g1.