Localize-Swift icon indicating copy to clipboard operation
Localize-Swift copied to clipboard

A screen with Fixed Language

Open mubasherkhan opened this issue 7 years ago • 3 comments

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 .

mubasherkhan avatar Jan 15 '18 07:01 mubasherkhan

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)
     }

mpkupriyanov avatar Jan 15 '18 10:01 mpkupriyanov

@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.

mubasherkhan avatar Jan 15 '18 10:01 mubasherkhan

That is fixed just changing some constraints here is the link
https://stackoverflow.com/questions/48261694/uiview-appearance-semanticcontentattribute-for-a-specific-view-ios

mubasherkhan avatar Jan 15 '18 12:01 mubasherkhan