在 Xcode 中更改开发语言 [英] Changing the development language in Xcode

查看:41
本文介绍了在 Xcode 中更改开发语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将西班牙语设置为 iOS 应用的开发语言.我已经在使用 Xcode 6,并且我将应用程序 Info.plist (CFBundleDevelopmentRegion) 中的 Localization native development region 条目从en"更改到es".但是,在 Project > Info > Localizations 中,英语仍然设置为开发语言.

I need to set Spanish as development language for an iOS app. I'm already using Xcode 6, and I changed the Localization native development region entry in app's Info.plist (CFBundleDevelopmentRegion) from "en" to "es". However, in Project > Info > Localizations, English remains set as Development Language.

As said in Information Property List Key Reference, CFBundleDevelopmentRegion specifies the default language. I need to set Spanish to the default language, what am I missing?

Thanks

解决方案

Here's how you can do this:

  1. Add the language you want to be your Base language first. Uncheck all of the files that Xcode offers to localize for you.
  2. In the Info.plist, change the development region to the language that you want to be your base language. Note that the property is a bit misnamed, because its value should be a language code (with an optional country code), rather than a region or country code.
  3. Close your project in Xcode. In another code editor, open projectname.xcodeproj/project.pbxproj and search for developmentRegion. You should see a line like developmentRegion = English;. Change this to reference the same language you put in your Info.plist file.
  4. Reopen the project in Xcode. Go through all your localizable files and check the boxes next to English to generate the localizable resources. Note that for storyboards and xibs, Xcode might create a storyboard instead of a strings file. If that happens, just change the filetype to strings file.

Here's an example of the result for me using fr as the Base language:

这篇关于在 Xcode 中更改开发语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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