I localized a part of my application with creating a base.lproj storyboard and 3 string files for it. It was a month ago and after that I added new view controller to app, b
I got a huge storyboard with a lot of strings there. Two languages base english and another arabic. The task was to add some fields and labels to storyboard and add localization for them without any scripts and NSLocalizableStrings.
For me helped next:
First: Ensure, you have git to prevent unexpectable changes.
Editor
-> Export For Localization...
. Save the ar.xliff file somewhere.Here is a script to extract strings from storyboards and xibs, and merge them with existing translations.
To run the script automatically when you build a project, put the script into your project root directory, and add a Run Script phase with the following line to a target build phases in your project settings.
./mergegenstrings.py PathToSourceDir
Or you can run the script on Terminal manually when you want to.
The script runs ibtool
as Tha Leang answered. It also runs genstrings
to extract and merge strings marked with NSLocalizedString
in your source code. The script is based on a script in this post, which merges strings after running genstrings
.
There is an app a command line tool from Apple named AppleGlot that supports incremental localisation. I haven't tried it yet, but it looks exactly like the tool you searched for (some time ago).
There are two options:
Xcode can "reload" the file by converting the file to either an [Interface Builder Cocoa Touch Storyboard] file type or a [Localizable Strings] file type.
Use ibtool to extract the strings in your storyboard.
Open the Terminal application
Locate your Base.lproj directory
Use this line to extract the strings:
ibtool MainStoryboard.storyboard --generate-strings-file file_name.strings
After ibtool extracts the strings to file_name.strings, you can copy and paste it to your original .strings file
Visit for more info: https://conyac.cc/business/columns/localization_guide_ios
You can manually add a key in your localization file. You can find the key object by selecting it on storyboard editor. Let's have a look at Object-ID
in the identity inspector. It's look like "nwc-b2-19c"
On your localization update or add translation. For example :
"nwc-b2-19c.title" = "Translated title";
This one is not for everybody, but it requires no additional tools in the terminal and it's easy for small manual changes. (Do not consider this when you want to automate your process.)
Step 0: Storyboard language setup
This step is done only once.
Now when I add something to the storyboard I do the following
Step 1: add the English localizable strings file
just mark the English line item.
This creates a completely new english localizable strings file with all the lines
Step 2: copy the new line items into the other language files
and translate them
Step 3: unmark English, remove the corresponding localizable strings file
the file was only needed to get the new line items
This is an easy and fast process, everything is done in the storyboard editor
Edit:
This process works very well with small storyboards. For example, I have a tabs based project and I have a storyboard for each tab.
Search for "storyboard reference" to find tutorials.
Good example: Storyboard reference in Xcode, where should we use it?
So each small storyboard only has a few strings to localize.