Leo*_*eon 4 objective-c nslocalizedstring
我有:
-(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];
}
Run Code Online (Sandbox Code Playgroud)
在Localizable.strings中:
/* Title of AlertView */
"About" = "Über";
/* Cancel Button Title */
"Back" = "Zurück";
Run Code Online (Sandbox Code Playgroud)
我的问题:当语言是德语时它是德语但是当我将语言改为英语时,警报视图仍然是德语
怎么了?
Vic*_*orT 32
如果你使用xCode 4,你将面临这样的问题.尝试下一步:
使Localizable.strings文件可本地化(单击它,按cmd + i并按"Make file localizable"按钮)并向其添加德语和英语本地化.然后将德语本地化写入该文件的德语版本,并保留英文版本如下:
/* Title of AlertView */
"About" = "About";
/* Cancel Button Title */
"Back" = "Back";
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
11000 次 |
最近记录: |