Embedded quotation marks in NSLocalizedString misinterpreted by XLIFF export tool
| Originator: | alex | ||
| Number: | rdar://19235112 | Date Originated: | 12-Dec-2014 01:10 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 6.1.1 (6A2008a) |
| Classification: | Bug | Reproducible: | 100% |
When exporting localizations from an Xcode project into XLIFF format, base translations that contain escaped quotation marks aren't handled correctly. The example I've used is NSLocalizedString(@"A \"Quote\" in a value", @"Test key"); In the XLIFF produced by exporting the English localizations, the "source" attribute of the translation unit is "A \" - it's just taking what appears between the first two quotation marks instead of correctly reading passed escaped characters. When this is sent to translators, the results come back with dangling quotation marks at the ends of values in Localizable.strings "key" = "A \"; In addition to being an incorrect translation, this causes the build to fail for improper formatting. Steps to Reproduce: 1. Create a new project 2. Define a string containing quotes using NSLocalizedString(@"A \"Quote\" string", @"Test string") 3. Export the project for localization Expected Results: en.xliff should contain a translation unit with source "A \"Quote\" string" Actual Results: en.xliff contains a translation unit with source "A \"
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!