Skip to main content

Base Internationalization

·2 mins

Having answered multiple questions on Stack Overflow from people getting errors when they change their Xcode project’s deployment target to OS X 10.6, it seems time to explain the cause of these errors: base internationalization.

When you create a new Cocoa application project in Xcode 5 (base internationalization was added in Xcode 4.4, but I don’t know the specific version when base internationalization became the default option), the project has support for base internationalization. Base internationalization make localizing your application to other spoken languages easier.

Suppose you want to have three versions of your application: English, French, and Spanish. Without base internationalization you would need three copies of each xib file: English, French, and Spanish. With base internationalization, there is one copy of each xib file, a base xib, and three strings files: English, French, and Spanish.

Since the strings file is just a text file, you can give the strings file to the person translating your application, and they can translate the text of your user interface without having to edit any xib files. The combination of base internationalization and auto layout simplifies creating user interfaces that support multiple spoken languages.

At this point you may be wondering what’s the downside of base internationalization. Apple added support for base internationalization in OS X 10.8. If your project uses base internationalization, it will not run in OS X 10.6 and 10.7. Creating a new Cocoa application project and changing the deployment target to OS X 10.6 or 10.7 is going to cause problems for people running 10.6 or 10.7.

If you want to support OS X 10.6 and 10.7 in your Cocoa project, you must turn off base internationalization. Select your project from the project navigator to open the project editor. Select the project from the left side of the project editor. Click the Info button at the top of the project editor. Deselect the Use Base Internationalization checkbox.

Base Internationalization Setting