在 Xcode 中更改开发语言 [英] Changing the development language in 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:
- Add the language you want to be your Base language first. Uncheck all of the files that Xcode offers to localize for you.
- 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. - Close your project in Xcode. In another code editor, open
projectname.xcodeproj/project.pbxproj
and search fordevelopmentRegion
. You should see a line likedevelopmentRegion = English;
. Change this to reference the same language you put in yourInfo.plist
file. - 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屋!