Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localized UITabBarItem "Back" title

When the text of the previous UIViewController in UINavigationController is too long, the UITabBarItem displays "Back"

In my app, I allow the user to change the language by the following code:

[[NSUserDefaults standardUserDefaults] setObject:locale forKey:@"locale"];
[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:locale, nil] forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize];

locale would be "en" or "es" etc.

I also add to my localizable files the back text. I see that when the user opens the app, it would display "back" according to the text in the localizable files. But if the user changes the language with the above code, he would need to restart the app for the changes in AppleLanguages bundle to work.

I need also for the text on the UIPickerController e.g. Remove

How could it be fixed so the user wouldn't need to restart the app after setting the locale?

like image 653
Dejell Avatar asked Oct 20 '22 16:10

Dejell


2 Answers

@Dejel: use "TSLanguageManager" library it's change the localze text at the runtime you don't need to restart the app after setting the locale.

you can download example from below link:

https://github.com/tonisalae/TSLanguageManager

like image 63
Shubham Avatar answered Nov 27 '22 12:11

Shubham


@Dejel: use "LanguagesManager" library it's change the localze text at the runtime you don't need to restart the app after setting the locale.

you can download example from below link:

https://www.cocoacontrols.com/controls/languagesmanager

like image 34
kagmanoj Avatar answered Nov 27 '22 13:11

kagmanoj