Import Localizations crash if source code includes nonexistent tableName
| Originator: | Laura.Savino | ||
| Number: | rdar://24085080 | Date Originated: | Jan 6, 2016 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 7.1 |
| Classification: | Crash | Reproducible: | Always |
Summary:
If a project's source code includes an NSLocalizedString function referencing a nonexistent table, as in:
NSLocalizedString("let's go", tableName: "invalid-table-name", comment: "A string saved in a custom table")
the export proceeds without complaint (rdar://24084898), but after translation, the import results in a crash (see attached crash report).
Removing the line with the nonexistent table name fixes the crash.
Steps to Reproduce:
1. Include the line below anywhere in source code covered by localization exports:
let title = NSLocalizedString("let's go", tableName: "invalid-table-name", comment: "A string saved in a custom table")
2. Export localizations.
3. See that the exported file includes an invalid <file> node (see attached xliff file).
4. Have the file translated.
5. Import translations.
6. See the 'missing resource' warning but continue merrily. (see attached image)
Expected Results:
Xcode should either:
+ Show an error and refuse to continue until the file name is resolved.
+ Show a warning and offer to create a matching .strings file.
Actual Results:
Xcode crashes (see attached crash log)
Version:
Xcode 7.1, OS 10.11.2
Notes:
This could be alleviated by addressing rdar://24084898 (though not fixed, since file configurations can always change between export and import).
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!