自 MonoTouch 5 以来 Localized.strings 被破坏了?
升级到 MT 5 后,我打开了一个旧的 MonoTouch 项目(用 MT 4 编码),但本地化功能不再起作用。此后没有任何改变,并且在更新之前它运行得很好。无论我做什么,它都只会从 en.lproj
加载字符串。
到目前为止我所知道的:
这不是因为 Localization.strings 没有设置为“Content”构建操作,我查看了 ~/Library/Application Support/iPhone Simulator/5.0/Applications/GUID/MyApp.app/ 通过使用“显示包内容”,它们就在那里。 (见图)
本地化图像可以工作(
Bundle.PathForResource("Images/MyImage", "png")
),只有字符串似乎损坏了(Bundle.LocalizedString("MyString", "Comment", "")
)更改
Thread.CurrentThread. CurrentCulture
或Thread.CurrentThread.CurrentUICulture
不执行任何操作。- NSBundle.MainBundle 之前指定
lang.lproj
捆绑包不会执行任何操作。
I opened up one of my old MonoTouch projects (coded in MT 4) after having upgraded to MT 5 and the localization doesn't work anymore. Nothing was changed since and it worked perfectly before the update. No matter what I do, it will only load the strings from en.lproj
.
What I know so far :
It's not because the Localization.strings are not set to the "Content" Build Action, I looked in
~/Library/Application Support/iPhone Simulator/5.0/Applications/GUID/MyApp.app/ by using "Show Package Content" and they are there. (see image)The localized images work (
Bundle.PathForResource("Images/MyImage", "png")
), only the strings seem broken (Bundle.LocalizedString("MyString", "Comment", "")
)Changing
Thread.CurrentThread.CurrentCulture
orThread.CurrentThread.CurrentUICulture
doesn't do anything.Specifying the
lang.lproj
bundle before calling LocalizedString instead of usingNSBundle.MainBundle
doesn't do anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论