Localize-Swift
Localize-Swift copied to clipboard
A screen with Fixed Language
Suppose I am using two languages in my app first one is English and other is Arabic . When I switch from English to Arabic there is one screen that should be remain English in case of both languages . How can i achieve that functionality .
Hi
for language in Localize.availableLanguages(true) {
if language == Localize.currentLanguage() { continue } // <---- The answer to your question!
let displayName = Localize.displayNameForLanguage(language).capitalized
let languageAction = UIAlertAction(title: displayName, style: .default, handler: {
(alert: UIAlertAction!) -> Void in
Localize.setCurrentLanguage(language)
})
actionSheet.addAction(languageAction)
}
@MikhailKupriyanov Thanks for your response . The issue is not with setting the language.When we switch from English to Arabic whole view of App is flipped . What i want is a one specific ViewController of my App should not be flipped that should use same layout "LTR" in both languages.
That is fixed just changing some constraints here is the link
https://stackoverflow.com/questions/48261694/uiview-appearance-semanticcontentattribute-for-a-specific-view-ios