简体   繁体   English

iOS Settings.bundle本地化困难

[英]iOS Settings.bundle localization difficulties

From what I can read I'm not the only having this problem; 从我所看到的,我不是唯一有这个问题; except this is just happening in my Settings.bundle in my app it's all fine… 除了这只是在我的应用程序中的Settings.bundle中发生的一切都很好......

My app is localized in English (primary) and French. 我的应用程序本地化为英语(主要)和法语。

My Root.strings file isn't getting called in at all, for English and French. 对于英语和法语,我的Root.strings文件根本没有被调用。 If I put my iPhone in French the Settings bundle will be defaulted to the title declared in my Root.plist . 如果我将我的iPhone放入法语,则设置包将默认为我的Root.plist声明的标题。 Now in whatever language my iPhone's set to (English or French), let's say I add a group entitled "hello" and set the corresponding string to "world" I'll just get "hello" as my "localized" string… 现在用我的iPhone设置的任何语言(英语或法语),假设我添加了一个名为“hello”的组,并将相应的字符串设置为“world”,我将“hello”作为我的“本地化”字符串......

Thanks 谢谢

I've been struggling with the same problem. 我一直在努力解决同样的问题。 Using version 5.0 of the iOS simulator and Xcode 4.2, the localizations don't appear to take effect when the Root.strings file is changed. 使用iOS模拟器和Xcode 4.2的5.0版本,当Root.strings文件更改时,本地化似乎不会生效。

My setup has a Settings.bundle which contains a Root.plist and a directory for each language supported containing a Root.strings file: 我的设置有一个Settings.bundle,其中包含Root.plist和支持的每种语言的目录,其中包含Root.strings文件:

Settings.bundle:
    Root.plist
    en.lproj:
        Root.strings
    fr.lproj:
        Root.strings

This is pretty much the standard setup which Apple documentation suggests. 这几乎是Apple文档建议的标准设置。

When simulator is using the english localization, I change the matching Root.strings file and recompile, the changes don't appear to take effect. 当模拟器使用英文本地化时,我更改了匹配的Root.strings文件并重新编译,这些更改似乎没有生效。 But if I uninstall the app, clean the project, and then re-run, the localization takes effect. 但是,如果我卸载应用程序,清理项目,然后重新运行,本地化将生效。 It seems like an Xcode or iOS Simulator bug. 它似乎是一个Xcode或iOS模拟器错误。

My solution : uninstall the app from the simulator, then run it again from Xcode to see the changes. 我的解决方案 :从模拟器卸载应用程序,然后从Xcode再次运行它以查看更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM