Exported XLIFF missing strings since Xcode 9.3

Hi,


We use 'NSLocalizedStringWithDefaultValue' to add all our strings. We use Xliff as recommended by Apple to export all the strings in our app. To do so, we can either export manually from Xcode or just run the command


xcodebuild -exportLocalizations


as stated in https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LocalizingYourApp/LocalizingYourApp.html.


This has been working ok for a couple of years exporting all the strings found using that macro across the app. We upgraded to Xcode 9.3 and since then, the exported xliff only contains strings from one of our '.m' files, omitting the other several thousand we have across the app.


Has anyone experience a similar problem?

Replies

Has anyone experience a similar problem?

I don’t have direct experience with this workflow but, given that this is a 9.3 regression that’s actively causing you problem, my recommendation is that file a bug report about it. It would be helpful if you could create a small test project that works kinda like you main project and illustrates the issue.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

We're also experiencing this at Savage. We're having to swich back to Xcode 9.2 in order to complete our translations for Procreate.


Unfortunately, because of time pressures, we may not be able to create a sample project for bug reporting - our project is complicated, and uses a number of tables (often in Modules inside the project). Figuring out a minimum test case for what's busted isn't in our power right now.


I can tell you that we're getting some exports of NSLocalizedStringFromTable(), but they're not exporting in the XLIFF to correct location. So, for example, let's say we had an extant table strings file called BlendModes.strings that lived in Resources/Localization (and subfolders therein for each language, of course), we would expect Xcode to export these strings with a file tag of something starting with

<file original="Resources/Localization/en.lproj/BlendModes.strings"


Instead, we get

<file original="Procreate/Support/en.lproj/BlendModes.strings"

which is incorrect, and surprising, because that's not where they currently live, and it's not where Xcode has previously exported them to.


All this leads to the translation team going nuts, and a heap of new files created in the wrong spots with the wrong content when we import the completed XLIFF translations. I had to go back to the original export to find out what was wrong.


Because I can't get comparisons of these files, it's difficult to tell if we're missing any translations or not, but a manual eyeballing of the files suggests that we are.


I'll try to get a bug report done, but I don't hold out any hope, what with the sample project requirement.


Best wishes, always,


Dave Williams @ Savage

We're having the exact same problem.

The `original` paramenter in the xliff used to point to "iOS App/Resources/Localization/en.lproj/Localizable.strings" in Xcode 9.2.


In Xcode 9.3, it now points to "iOS App/Supporting files/en.lproj/Localizable.strings" which is wrong.


I noticed that it uses `INFOPLIST_FILE` to determine what that new path is. If I change `INFOPLIST_FILE` to something random, the path in the xliff also points to that random location.