NSLocalizedString问题 [英] NSLocalizedString Problem

查看:78
本文介绍了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];
}

在Localizable.strings中:

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

怎么了?

推荐答案

使Localizable.strings文件可本地化(单击它,按cmd + i并按使文件可本地化"按钮),然后将德语和英语本地化添加到它.然后将德语本地化版本写入文件的德语版本,并保留英语版本,如下所示:

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";

这篇关于NSLocalizedString问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆