Hi im very much stuck on the process of localisation on ios .
heres what i do understand , how to go to the project explorer and set base localizations for diferent countries,
how to make a string file and set it to be localized to one of the particular countries chosen within base localisation
such as simplified chinese
key value pairs and how to correspond the word "HELLO WORLD" = " some other language"; with in the localized string file
how ever the app which has a simple label with the writing hello world when compiled doesnt change to chinese in a chinese simulator.
heres where i think im going wrong.
i think i need to connect the strings on the screen to the strings contained with in my localized string file.
and do i make a seperate string file for each language?
im looking to make a very very simple stub of an app containing nothing but a few labels which are translated into dif languages, so i can learn how to make it connect and work so i can use it else where.
there is a storyboard for chinese, do i have to do any work to that ? or is it left blank?
after hours of reading documents i seem to be going around in circles , im not impressed with apples documentation on this issue think its missing something,
Making it pretty
For Swift, there is better solution which makes your localizations little better - not that messy. You can use following extension:
Now, whenever you want something localized, you can just request it as string property:
And it will get localization string based on your current system language / locale.
Few tips
If you have bigger project, it is worth looking into managers, that handle the localization export / adding new languages for you. I for example use Crowdin - but you might find some services more appealing. Great thing is that you don't have to do everything by hand, you just insert keys / translations and export is done for you, for all the languages that you have.
Also, follow good naming of your keys. Based on what I've seen people do / my experience, I think it is wise to name keys by logical component / module, where they belong, for example:
This way, you can immediately see what and where you would find it.
Lastly, the localizations in general are huge pain because of number of mistakes that you can do. There is generator that can create actual code out of your localizations, so compiler will check it for you. You can get it on GitHub.
Good luck!
For localization, you need to do:
NSLocalizedString(yourKey, nil);
or
For getting the localized string of passed key.
Tutorials: