I'm beginning to learn how to localize iOS applications and hit a wall while trying to localize my UITabBarItems.
Note that these were created in interface builder (using XCode 4).
Is there a way to do this or would I need to create the UITabBarController using just code and manually inserting a localized string for each UITabBarItem?
Cheers
PS:
I do know that I can set the tile of a UITabBarItem by setting the view controller's title like so:
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = NSLocalizedString(@"Test", @"");
}
... but this only woks once you hit the tab bar item. Before that it just shows what you put in interface builder...
Select your root project file, and then proceed to the project panel. Find the Localization section section, click the “plus” (+) icon, and add the desired languages. Select only the Localizable. strings file for localization.
To add a tab, first drag a new View Controller object to the storybard. Next control-drag from the tab bar controller to new view controller and select view controllers under Relationship Segue . Your tab bar controller will update with a new tab.
It seems to work if you set title
in awakeFromNib
instead:
- (void)awakeFromNib
{
self.title = NSLocalizedString(@"Test", @"");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With