简体   繁体   English

iOS 8,Xcode 6-本地化不起作用

[英]iOS 8, Xcode 6 - Localization not working

I recently localized my app and followed through several tutorials on setting up localization. 我最近对我的应用程序进行了本地化,并完成了一些有关设置本地化的教程。

In my target build info settings, I have both English and Spanish set up with Base Internationalization checked. 在我的目标构建信息设置中,我同时设置了英语和西班牙语,并选中了Base Internationalization。 构建设置

I have my Localizable.strings file in my project which contain both English and Spanish translations. 我的项目中有Localizable.strings文件,其中包含英语和西班牙语翻译。

可本地化的字符串

And I have two storyboards - one for English and one for spanish..for both iPhone/iPad. 我有两个故事板-一个用于英语,一个用于西班牙语..用于iPhone / iPad。 Auto Layout is enabled and I have English and Spanish checked in the storyboard settings. 启用了自动版式,并且在情节提要设置中选中了英语和西班牙语。 故事板故事板设置

When I edit the scheme to run it through the debugger as Spanish - translations work perfectly. 当我编辑方案以使其以调试程序的形式运行为西班牙语时-转换效果很好。 I have my iOS device and simulator language set to Spanish and the correct region that all my files are associated with. 我将我的iOS设备和模拟器语言设置为西班牙语,并将所有文件与之关联的正确区域设置了。 Although when its not running through Xcode, the app will only be in English, regardless of whether or not the device settings are set to Spanish. 尽管在未通过Xcode运行时,无论设备设置是否设置为西班牙语,该应用程序都只会使用英语。

I've deleted the app, cleaned, rebuilt, and re-deployed to both simulator and iOS device. 我已删除该应用程序,将其清理,重建并重新部署到模拟器和iOS设备。 There is still no change. 仍然没有变化。 Does anyone know of anything else that I might be missing? 有人知道我可能会想念的其他东西吗? Any help would be greatly appreciated. 任何帮助将不胜感激。

After visiting the iOS Dev forms, I found my answer. 访问iOS Dev表单后,我找到了答案。

My problem was that my localization was set to Spanish (United States) while iOS only supports plain ol' Spanish and Spanish (Mexico). 我的问题是我的本地化设置为西班牙语(美国),而iOS仅支持普通西班牙语和西班牙语(墨西哥)。 Why they make that option available in Xcode if its not supported? 如果不支持,为什么他们在Xcode中提供该选项? I'm not quite sure... 我不太确定...

So, I added the plain ol' Spanish localization to my build info and had to transfer all of my storyboard files, image files, and strings to the new plain ol' Spanish files. 因此,我将普通西班牙文本地化添加到了我的构建信息中,并且不得不将我的所有情节提要文件,图像文件和字符串传输到新的普通西班牙文文件中。 Works like a charm now! 现在就像魅力一样!

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

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