ios - Localization failed to update storybaord RTL (Right To Left) For Urdu support -


i trying update controllers after change english language urdu (rtl) language.

means,

if tableview cell contains image present in left side , text present @ right side in tableview cell. when user select urdu language goes swap. image added in right side , text goes left side.

used auto layout this. setting proper constraint leading , trailing take care if change apple language.

used code set apple language. written 1 notification refresh views. not work immediately.

if user select urdu language

 if([preferredlangcode isequaltostring:@"ur"])     {         [[nsuserdefaults standarduserdefaults] setobject:[nsarray arraywithobjects:@"ur", nil] forkey:@"applelanguages"];         [[nsuserdefaults standarduserdefaults] synchronize];          [[nsnotificationcenter defaultcenter]postnotificationname:@"applayoutdirectiontrigger" object:nil];     } 

for refresh view

-(void)updateuiforrtlsupportconfirmedscreen:(nsnotification *)notification {     (uiview *view in self.view.subviews)     {             [view setneedsdisplay];        } } 

not update view not swap view subiviews.

it work if stop app , run again works. want immediate reflect changes.

can me out this.

regards jitendra

the recommended approach use system language, , remove language selection app. starting ios 8, users can select urdu language list, if not supported on ios system apps. this, don't have worry implementing language chooser , changing applelanguages.

keeping language chooser difficult task do. on ios 8, have remove of constraints of of views, , re-create them use opposite left , right attributes each. on ios 9, have go through every single 1 of views , update semanticcontentattribute of each view want display.


Comments