Monday, July 18, 2016

iOS Localization

Normally, below are the items localized

The text in the storyboards
The cover image
The dynamic message displayed by code
The name of the app as displayed in home screen

The "Message" given here is optional. "BOOK_PURCHASE" is checked in the Localizable string and they are substituted here. If not found, "BOOK_PURCHASE" itself will be displayed. 

- (IBAction)buy:(id)sender
{
    [[[UIAlertView alloc] initWithTitle:@"Confirmation"
                                message:NSLocalizedString(@"BOOK_PURCHASE", @"Message")
                               delegate:nil
                      cancelButtonTitle:@"OK"
                      otherButtonTitles:nil] show];
}

references:

No comments:

Post a Comment