I have to develop the application into Four(4) languages (English, French, Italic, Spanish).
So, for that I want to know is there any way to display different language data using only one(1) .xib file in the top bar.
Example:
I have the Setting.xib (.xib file) in
which there are four labels in the
view part and in the top bar of that
Nib file I want to change the label
names according to the set language
using One & Only one Nib file.
So, please give me the appropriate solution.
Which will take less time for the loading.
First of all, I don’t understand why you can’t simply use
NSLocalizedStringwhen setting the label text, it does exactly what you want, loading the appropriate version of the text, according to the device’s language.Anyway, I think you could find something useful here.
I actually did something similar, with six languages and only a single Nib but in my case I could have had the language changed inside the app, so I needed to be able to forcefully tell it to load me the localized version of a string from the specific bundle.
Here’s the exact code that should help you in case your problem is more like mine and a simple NSLocalizedString is not enough:
Since you will probably have more than one label, it would be a good idea to have the path stored as a class property and set in viewDidLoad, so you will be able to access it from any method/function inside that class.