我需要向服务器发送特定字符串的本地化列表.
这意味着,如果我的应用程序有一个字符串Foo,其本地化为英语为@"Foo",俄语为@"Фу",我想向服务器发送如下列表:
我认为我需要做的是:
我该怎么做(1)我该怎么做(2)?
这是真的?实例化UIAlertButton时,必须为"取消"按钮传递一个显式标题,如下所示:
UIAlertView *av =
[[UIAlertView alloc]
initWithTitle:@"Error"
message:err.localizedDescription
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil];
Run Code Online (Sandbox Code Playgroud)
这意味着如果你想要一个本地化的应用程序(你当然可以这样做),你也必须本地化取消字符串,即使Apple显然已经有了规范的翻译.我真的被迫写这样的东西来处理它(或者这甚至可以)?
NSBundle* uikitBundle = [NSBundle bundleForClass:[UIButton class]];
UIAlertView *av =
[[UIAlertView alloc]
initWithTitle:NSLocalizedString(@"Error", @"Title for Alert box when error occurs")
message:err.localizedDescription
delegate:nil
cancelButtonTitle:NSLocalizedStringFromTableInBundle(@"Cancel", @"Localizable", uikitBundle, nil)
otherButtonTitles:nil];
Run Code Online (Sandbox Code Playgroud)
这对我来说太可怕了,但我必须保持自己的Apple HIG强制翻译单词(如"取消"或"确定")的想法似乎同样荒谬.