0

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?

Thanks in advance.Here is the screenshot of my project

Ashutosh Shukla
  • 358
  • 5
  • 14
  • There are many similar questions already on SO. Refer : https://stackoverflow.com/questions/9939885/manual-language-selection-in-an-ios-app-iphone-and-ipad – Sushil Sharma Sep 10 '18 at 08:22
  • Please see below link. I had managed this in one of my app [Localization in Swift - Restrict app to one language even if the app has more languages](https://stackoverflow.com/questions/46447630/localization-in-swift-restrict-app-to-one-language-even-if-the-app-has-more-la) – Yogesh Tandel Sep 10 '18 at 13:17

2 Answers2

0

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 Tried the same

Bhavin Kansagara
  • 2,866
  • 1
  • 16
  • 20
0

Refer this GitHub Link to Change the Localisation of the App in Runtime.

Vicky_Vignesh
  • 584
  • 2
  • 14