Using the system localizations on iPhone
- by nevan
I want to make a back button for a navigation controller with the title "Back" instead of the title of the previous controller. I'm using this code:
UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
initWithTitle:NSLocalizedString(@"Back", @"Back")
style:UIBarButtonItemStyleBordered
target:nil
action:nil];
self.navigationItem.backBarButtonItem = backButton;
I'd like to be able to skip localizing the "Back" string in my app (since I can only localize it in a limited number of languages). If I give my navigation controller no title, the back button will be automatically localized into whatever the language the user has chosen, so the system has translations of "Back" in many languages.
Is there a way to access the localizations that are already present in the system and use them myself? These are things like "Back", "Cancel", "Done" and so on, which show up when creating one of the standard system buttons.