I'm trying to localize a storyboard where the work has been done solely in the storyboard view (ie nothing has been done programmatically).
There are numerous elements like this in the storyboard and as such they do not appear in my Localizable.strings file (which does properly translate all elements, these elements have been programmatically added to the storyboard in various view controllers), however a "MainStoryboard-iPhone.strings (french)" is generated and as shown below:
contains the elements which I wish to translate.
Below is the highlighted element in the storyboard:
My question is: "How do I translate the storyboard elements using this .strings file? (there are no changes even when the text is translated in the .strings file), or is there another way to localize these storyboard elements?"
Thank you for your time.
appendix
A.
Related
I am localizing my app, and I have a custom storyboard I created called Into.storyboard. When I added a language to the app, it gave me an option to create strings files for Main.storyboard and LaunchScreen.storyboard, but not for my custom storyboard. How do I create one so that it automatically fills in the object IDs like it did for the other two storyboards? Thank you
At the right side inspector you can find button localize. Press it and choose languages.
Example
I am working in an internationalized Xcode project with two UIStoryboard files en.lproj/Main.storyboard and nl.lproj/Main.storyboard.
Is the consequence of this, that if I want to add a new element, say a UIButton to the storyboard, I have to add it twice, one for each file (and thus set the constraints etc also twice)?
This is how it looks in the navigator:
But selecting the base file actually selects the en.lproj/Main.storyboard, and after adding a button there it looks like I have to follow the same process in the other file.
Is this just the way it works?
No. The usual way is that you only have one storyboard that contains all the UI elements, constraints etc. in your "Base" language (e.g. English). For every additional language (e.g. German) you have a strings file that contains translations for all the texts (buttons, labels etc.) in your storyboard.
I have a localized Storyboard (Base and Spanish), and I just realized that after making some changes to the storyboard it did not make the corresponding changes on the Spanish version. Some of the changes I made were button color, added a new label, etc.
Any ideas as to why this happened? I'm assuming there is a correct flow that I did not follow for making updates.
I just realized that on this particular storyboard I had a localized storyboard instead of a localized strings file for the storyboard. In this case you have to edit the two storyboards separately. What I actually wanted was a localized strings file for the storyboard instead of two storyboards.
I am wanting to localize my storyboard into German. Xcode does a great job of creating a main.strings file for my storyboard. However, I am using prototype cells for many of my table views. Each of those cells just uses dummy text in the UILabels since I replace the text later when I load the data to populate the table view.
Prototype Cell:
Storyboard Strings file:
Strings file string that I don't want:
Is there a way to tell Xcode to ignore certain strings so that they don't even show up in the strings file? I don't want to have to pay a translator to translate dummy text.
I like to have some example text in storyboard labels that will be set at run-time.
This text should never be translated, and is only used to make the storyboard look more like the finished product.
I'd like to exclude that text from being in the .strings file that's generated every time I update the storyboard.
Is there any way to do that?
A way to indicate to the translator that this text isn't to be localized would be better than nothing.
You cannot exclude these labels from being in the string files, these files are an extract from the storyboard and thus need to be there.
A trick I use is to use a naming convention for these labels, so I know afterwards they don't need to be translated, for instance I would name a label "Username" -> "lbl_Username". It still looks decent enough in the Storyboard and I'm sure not to waste my time translating them when doing the localization