1

So, i have rally big issues.

First of all, i have 2 Localizable files, first it's Main.storyboard where i translate all labels, buttons.

And i have Localizable.strings where i translate error message, and some system message.

And i have something like this:

enter image description here

Translation working OK if i setup phone language.

But if i want to change manually language from the app, only translating file Localizable.strings.

Maybe it's possible to synchronize this two file in one?

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
Andrew
  • 372
  • 2
  • 5
  • 25

1 Answers1

-1

You need to change "AppleLanguages".

let defaults = NSUserDefaults.standardUserDefaults()
defaults.setObject("rs", forKey: "AppleLanguages")
Rushabh Shah
  • 396
  • 3
  • 19
  • And it's will get translation from 2 file? – Andrew Sep 07 '18 at 08:20
  • Yes, PLease try it. – Rushabh Shah Sep 07 '18 at 08:32
  • 2
    Apple recommend that you do _not_ do this… _"You're going to be swimming up stream if you attempt this. If you stomp on the AppleLanguages then various things won't behave as they normally would. Your app's user interface won't automatically flip you layout to be RTL, locale settings used for formatters won't be affected, and other things. You're going to be fighting a losing battle here so I'd strongly recommend you not go this route."_ https://forums.developer.apple.com/thread/8674 – Ashley Mills Sep 07 '18 at 08:50
  • You can change UIView appearance using below the line. UIView.appearance().semanticContentAttribute = .forceRightToLeft – Rushabh Shah Sep 07 '18 at 08:59