I've got:
-(IBAction)about {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"About", @"Title of AlertView")
message:@"App name \n© My name \n2010"
delegate:self
cancelButtonTitle:NSLocalizedString(@"Back", @"Cancel Button Title")
otherButtonTitles:nil];
[alert show];
[alert release]开发者_StackOverflow社区;
}
And in the Localizable.strings :
/* Title of AlertView */
"About" = "Über";
/* Cancel Button Title */
"Back" = "Zurück";
My problem: When the language is german it's german but when I change the language to english the alert view is still german
What's wrong?
If you use xCode 4 you will face with such problem. Try next steps:
- Remove application from device
- Select root node of project tree to get project's properties
- Select "Build Phases" tab
- Click "Add build phase" and select "Copy files"
- Select "Resources" in "Copy files" view
- Add Localizable.strings file
- Perform "Clean" for the project
- "Build and Run"
Make the Localizable.strings file localizable (click on it, press cmd+i and push the "Make file localizable" button) and add German and English localizations to it. Then write the German localization to the German version of the file and leave the English version like this:
/* Title of AlertView */
"About" = "About";
/* Cancel Button Title */
"Back" = "Back";
精彩评论