ios - Constraints and localization in ios7 -


i'm working on app support arabic , english

arabic rtl language

english ltr language

so when working on design put constraints labels trailing space , leading space when change ios device language labels positioned correctly according selected language

what mean if have 2 labels in same line following

label 1 label 2

in case of english

label 1 label 2

label 1 position in left , label 2 right of it

in case of arabic

label 2 label 1 label 2 in left , label 1 right of it

that want , happening now

now want set language application

i put code in main.m

nsarray *lang=  [defaults objectforkey:@"applelanguages"];         [defaults setobject:@[lang[0]] forkey:@"applelanguages"];         [defaults synchronize]; 

and in button action change language code

-(ibaction)changelang:(id)sender{      nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults];     nsarray *lang=  [defaults objectforkey:@"applelanguages"];      if ([lang[0] isequaltostring:@"ar"]) {          [defaults setobject:@[@"en"] forkey:@"applelanguages"];      }else{          [defaults setobject:@[@"ar"] forkey:@"applelanguages"];      }         [defaults synchronize];      exit(0);    } 

when open application again listen language change , labels , strings localized

without exit(0) nothing happens application language still same

what want do

my application reload views without exit(0); after language change or after exit(0) open application again if possible


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -