Reputation: 368
I am developing an app in Swift which supports two languages i.e. English and Norwegian. I have gone through the documentation of Apple and applied the concept of Localizable.string and Localizable files for storyboard.
Now, I have an issue where a client wants to have whole app in Norwegian irrespective of system language. I can achieve it by taking reference of each object in controller file and then assigning text based on localised string.
Could you please suggest more efficient way to handle this?
Upvotes: 0
Views: 285
Reputation: 592
Refer this GitHub Link to Change the Localisation of the App in Runtime.
Upvotes: 0
Reputation: 2916
Credit to marmelroy for this code https://github.com/marmelroy/Localize-Swift which can Localize from within the app.
For your specific case,
1) You will simply need to drag and drop the required files from the above source
2) Set a line in didFinishLaunchingWithOptions
// For Norwegian Nynorsk language.
Localize.setCurrentLanguage("nn")
This will set the current language to the needed one and will always show you the app in specified language.
Hope it helps!
EDIT
I tried the same and it's showing the auto suggestions for Localize.set
Upvotes: 0