【问题标题】:Using Localizable.strings in iPhone application在 iPhone 应用程序中使用 Localizable.strings
【发布时间】:2010-03-02 12:25:17
【问题描述】:

我下载了three20库:

http://three20.info/

我打开了这个库附带的 TTCatalog 示例项目:

http://img16.imageshack.us/img16/3183/screenshot20100302at752.png

如您所见,有很多 Localizable.strings 文件。

当我打开 iPhone 模拟器并在设置中将其语言更改为例如法语时,按钮上的文本仍然是英文:

http://img69.imageshack.us/img69/9775/screenshot20100302at812.png

我已经检查了法语的Localization.strings中肯定有文本“查看全部”的对应条目。

为什么以及使用 Localizable.strings 文件的步骤是什么?

(此示例项目不附带任何 nib/xib 文件)

编辑:

在 Info.plist 中添加以下 XML 后:

...
<dict>
...
    <key>CFBundleLocalizations</key>
    <array>
    <string>de</string>
    <string>en</string>
    <string>es</string>
    <string>fr</string>
    <string>it</string>
    <string>ja</string>
    <string>zh_cn</string>
    <string>zh_tw</string>  
    </array>
</dict>
...

现在可以了!

【问题讨论】:

    标签: iphone xcode localization three20


    【解决方案1】:

    这个帖子对http://groups.google.com/group/three20/browse_thread/thread/bee3d5525a32d476有帮助吗?

    引用文字,以防链接不可用:

    要使包内的本地化工作正常,您的应用本身必须具有一些本地化资源,因为可用的本地化是通过查看主包中可用的本地化资源来确定的。或者,您可以使用“CFBundleLocalizations”键将可用的本地化作为设置添加到 Info.plist 中。请注意,此键的值必须是一个数组,XCode 的 Info.plist 编辑器不支持,您可以“手动”编辑文件以获取其中的本地化。如果您只需要一种本地化,您可以简单地将键“CFBundleDevelopmentRegion”设置为您选择的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-24
      • 2010-11-13
      相关资源
      最近更新 更多