Situation:
We use XCode exporting/importing tools to generate localizable files for our translators. This was going fine in XCode 8. Since we updated to XCode 9 we see a couple of problems.
Problems:
- When exporting a localization via Editor-->Export for localization...-->Development language only, it doesn't include
NSLocalizedString()
key/values as it should according to this documentation:When you export localizations, Xcode searches your code for the macros and includes the strings files in the exported localization file for translation.
- Comments that are added to the Localizable.strings development-language file seem to be non-existent in the export
.xliff
file. - When importing a translated
.xliff
file, XCode seems to delete all the comments that are in the file. It gets replaced by"(No Comment)"
Configuration:
- XCode 9.0 (9A235)
- Dev language: NL
- Localized languages: Base, NL, DE, BE, LU
- Objective-C & Swift hybrid project
What I've tried:
- I have tried looking at XCode 9 documentation or changelog to see what has changed in Localization, though nothing I can find mentions this change
- I can get my
NSLocalizedString()
strings to show up in the export when I first generate the developmentLocalizable.strings
file manually, by using the commandline commandfind ./ -name "*.m" -print0 | xargs -0 xcrun extractLocStrings -o .
(I run it a second time for.swift
files as my project is a swift/objc hybrid). Then combine the results, which let my strings show up in the export, however without comments, which are needed as guides for translators.
Question:
Is this an XCode 9 bug? Did I miss any documentation or new feature/option for localization exports/imports? Are there workarounds?