本地化问题Xcode [英] Localization issue Xcode

查看:92
本文介绍了本地化问题Xcode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做什么错??

NSString * ew= NSLocalizedString (@"CITY",nil); //Add items [listOfItems addObject:ew ]; 我有我的localized.string "CITY" =布拉格";

NSString * ew= NSLocalizedString (@"CITY",nil); //Add items [listOfItems addObject:ew ]; and I have my localized.string in which I have "CITY" = "Prague";

....在iPhone模拟器或设备中均不起作用. 如果我放置它,它将显示CITY而不是Prague.

.....doesn't work neither in iPhone simulator or device. if I dislay it, it display CITY instead of Prague.

谢谢

语言设置正确,在Localizable.strings中,我有两个要本地化的字符串. 他们是这样的:

Language is set properly and in Localizable.strings I have two strings to localize. and they are so:

"TITLE" =可用城市"; "CITY" =布拉格";

"TITLE" = "Availiable cities"; "CITY" = "Pragues";

我拥有的其他本地化版本

other localizations I have

"TITLE" =翻译"; "CITY" =翻译";

"TITLE" = "Translation"; "CITY" = "Translation";

推荐答案

由于本地化字符串取决于设备的语言,因此在测试之前,请确保已在设备/模拟器上更改了您的语言.如果您的语言设置为英语,那么您将永远不会看到布拉格",因为该字符串将始终映射到本地化字符串的英语版本.

As localized string is device's language dependent, make sure your language has been changed on device/simulator before testing this. If your language is set to English, you will never see "Prague" as the string will always be mapped to the English version of the localized string.

祝你好运.

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

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