Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the development language in Xcode

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

like image 458
AppsDev Avatar asked Sep 16 '14 14:09

AppsDev


People also ask

Can you use other languages in Xcode?

Xcode supports source code for the programming languages: C, C++, Objective-C, Objective-C++, Java, AppleScript, Python, Ruby, ResEdit (Rez), and Swift, with a variety of programming models, including but not limited to Cocoa, Carbon, and Java.

How do I change the language in Swift?

There is a language setting within the "Settings" app (a system app), and there the user can set the language. All installed apps will use this language setting.

What language is used for iOS Dev?

Swift is a powerful and intuitive programming language for iOS, iPadOS, macOS, tvOS, and watchOS. Writing Swift code is interactive and fun, the syntax is concise yet expressive, and Swift includes modern features developers love.

Is Xcode its own language?

Language SupportThe Xcode IDE supports the Swift programming language and gives developers the flexibility to write code in C, C++, Objective-C, Objective-C++, Java, Applescript, Python, React.


Video Answer


1 Answers

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:

Project info

File info

like image 172
lensovet Avatar answered Oct 13 '22 05:10

lensovet