The problem I am facing is that all texts, titles, labels to be translated automatically in the Storyboard are not. At the same time, all texts, labels, titles to be translated by my Swift code, using NSLocalizableStrings are working well.
Here is my environment :
Xcode v 9.4.1
Development Language : English
Localization, English - 6 files localized
Development Language : French - 2 files localized (this line is below the other, correct ?)
Main.Storyboard includes:
- Main.Storyboard (Base)
- Main.strings (English), which contains all translations in English
The .strings files are correct and contains the translations for NSLocalizable functions
I have done Export for Localization to get an en.xliff file
In the file, it says source=fr and target=en, which is good
I have translated labels, titles, texts, etc.
I have done Import for Localization with the en.xliff file
To test localization, I do Edit Scheme / Run with Application Language set to English and Application Region set to System Region
What I see :
Whatever the view, all texts to be translated by a NSLocalizableString function in the Swift code are correctly translated and displayed as expected. Good
But, all texts to be translated automatically by the Storyboard are still displayed in French. All of them (View Title, Button, Label, etc). It looks like the Main.strings (English) is not read at all.
This last part is supposed to be straight forward, isn’t it ?
I have redo the full Localization process, with no effect.
My backup solution is to move all translations into the Swift code and not take advantage of the Storyboard automated translations, but honestly this is not exciting.
Any clue ? Any help ?
Many thanks
Hi Claude31. By the time you answered, I had already launched a DTS ticket. And your answer was correct. Apple recommended me to copy the full project to another folder, in Finder. Just copy paste the folder and its content. I did and it worked immediately Unbelievable. All my environment, code, storyboard was correct except probably a tiny bug somewhere. I now run my app from this new folder and get all translations. They said they don't know why, but at least it solves the issue. Another thing I learned is that code overwrites storyboard translations. Meaning if you do a "outlet".setTitle for instance, that will overwrite any translation coming first from the storyboard. Thanks Claude31