Since Xcode 5, Apple has enabled by default something called base internationalization. Here's how it works.
The idea behind base internationalization is to extract the text a user sees in your app from Interface Builder and other resources. All of those buttons names and text labels need to be translated, after all. Each piece of text is placed in a simple text format called a .strings file. Base internationalization helps collect those texts from .storyboard
and .xib
files. You can also include images and other resources that you may want to localize. Xcode moves or duplicates all of these resources into a Base.lproj folder in your project. It also creates separate folders for each language you want to translate into in order to store the localized version of these resources.
Base.lproj
folder.When you check the Base Internationalization checkbox the first time, Xcode will ask which resources to use as well as your default language (usually English). Xcode will create a Base.lproj folder if it isn't already there, and add any resource files you select. It also creates a language folder for the development language (for English, it's called en.lproj). Hint: Add more resources at any time using the File inspector. Just press the Localize... button or check the boxes for the languages you'd like. This is useful if you want to include a localized image for a PNG file that has some text in it, for example, or perhaps you want to show a particular country's flag based on the user's language.
Note: Xcode will actually create a .strings
file for each and every .xib
resource. Xcode includes many placeholders that say "Label" and "Button" that you probably never intended to pay a translator to translate! Consider deleting these from the final files you send your translators.
Xcode's Base Internationalization not only helps you get the xibs, but also the hard-coded strings using the NSLocalizedString macro.
NSLocalizedString
. Not every text a user sees comes from your .storyboard or .xib files, of course. What about those error messages and user prompts that are buried inside your code? Xcode can help you externalize your coded texts for iOS app localization too.
Any string your user will see needs to be wrapped in the NSLocalizedString
macro. Let's begin by making sure your coded strings are ready for iPhone localization. That means changing:
Always include a helpful comment for the translators. Since you will need to add the NSLocalizedString call to every string a user sees, take an extra moment to tell the translators what this string is for. Remember, they'll be seeing it totally out of context and your helpful hint here is all they have! Knowing that a text is a title or a button, a noun or a verb, can be very helpful.
Advanced users: Xcode 6 has decided to hide the Localizable.strings file for your English strings by default. This seems to be what Apple meant by "implicit .strings" files in the Xcode release notes. While you see the Localizable.strings file for, say, your French translation in the fr.lproj
folder (only AFTER you import the French XLIFF file), the English one is not in the en.lproj
folder.
You can, however, change this behavior by creating your own Localizable.strings file, or using the helpful genstrings
command. Open Terminal and navigate to your project's home directory. Then run this command:
find ./ -name "*.m" -print0 | xargs -0 genstrings -o en.lproj
This creates a strings file called Localizable.strings that extracts all NSLocalizedString calls into a single file in the en.lproj
localization directory. You can then modify the .strings file directly, and it will be exported along with the XLIFF file. This is useful if you want to use keys instead of the full English string. Do NOT rename Localizable.strings files. Otherwise Xcode won't find them.
Xcode 6 embraces the XLIFF format for handing off to your translation team
At runtime, your iPhone or iPad app is going to use the text inside those strings files you created to swap out English text for the translations. But instead of sending dozens of .strings files to your translation team, Xcode 6 adds a quick export function that creates a single XLIFF file for each language. (XLIFF is a standard XML-format supported by most translation software, including ours.)
Select your project from the File navigator. Then choose the menu item Editor > Export For Localization….
In the Save window that appears, choose to Include Development Language Only if you are sending your English file for translation. If you have existing translations you also want to send to your translators, choose Existing Translations, and choose from the list of available languages.
And, voilà. Your app will soon speak enough French to understand the word "voilà!" You have all the files you need to send to your iPhone localization team!
Your translators should return to you one file for each language using the language code as its name. That is, for French you'll receive an fr.xliff
file, for Chinese, you'll get back something like zh-Hans.xliff
.
Import the files back into Xcode using the menu command Editor > Import Localizations…. Xcode will display a window with the differences between your existing files and the ones your translators have sent you. Press the Importbutton to finish.
See also:
Inventing your own language to spot mistakes.
Once you've finished preparing your .strings file you're probably having doubts that you actually managed to find everyhard-coded string in your app. What about those error messages or that plug-in you use? Well, there is a quick way to check. It's called pseudolocalization.
Essentially, you use a program to substitute all the English (source) phrases with a fake language. Load up this gibberish Localizable.strings file into Xcode and then run your app. Check every screen and make sure all the text appears as the pseudo-localized text rather than your original. If you can't spot any missing strings, you're good to go.
Tip: Pseudolocalization is also a great way to make sure you've left enough room in your GUI for other languages. A common rule of thumb is that non-English languages are 30% longer, so tiny buttons and titles may not fit when you localize. Pseudolocalization can help you spot those cramped spaces too!
Check it out: Free Pseudolocalization from Babble-on
Send us your .strings file and we'll send you back a pseudolocalized file to test.
Don't forget iPhone App Store descriptions and keywords.
Hire a professional translator for each language, or do every language simultaneously with Babble-on iPhone app localization!
You've generated your .strings files, both from Interface Builder and coded strings from Xcode, and those go to the iPhone localization team you hire. That's not everything, though. You'll definitely want to have your app description for the App Store localized as well. Since iTunes Connect will also ask you for keywords, make sure you come up with a list of keywords for your translation team to localize. This ensures that users in other languages will find your app when searching their localized version of the App Store.
Estimate the cost of localizing your existing app description from the iTunes, Google Play, or Windows Store URL.
This might also be a good time to read through your App Store description and make sure it is the best it can be—before you have it translated into 30 languages.
Check it out: How to write an iTunes App Store description »
Hiring a team for iOS localization.
1. Send your iPhone localization strings.
Calculate the word count and cost of your Localizable.strings
file for iOS localization. Don't forget your keywords and App Store description.
2. We'll translate.
We'll produce localized Unicode text files to insert back into your iOS app in Apple's Xcode.
3. Users rejoice.
iPhones and iPads are multilingual out of the box, so your app's interface will appear localized for the user automatically.
Now that you have all your text ready for translation, you're probably wondering how many words you have and how much that will cost to translate. Use Babble-on's free iPhone app localization cost calculator to find out.
Try the cost calculator »See Press Release: San Francisco iOS App Localization Service Says No to the Factory Model, Introduces Cost Estimator
Talk to a real translator.
Interested in professional iPhone localization from a team that cares about making apps awesome? Unlike automated or cloud translation services which will translate your "bold" text as brave and "Archive" as a noun without considering it might be a verb, Babble-on is a dedicated team of translators that put as much care into localization as you do into app development.
You can talk to us about your project the whole way through, not just upload your strings and cross your fingers.
Developers, send us your strings! We localize iOS apps »
Localize iOS apps into the right languages
Using iTunes Connect, you've probably already noticed users from all over the world downloading your app. How many more users can you get by translating and localizing your iOS app into another language? Into two, or more? Once you've created the .strings file using the tutorial above, it's very simple to localize your iPhone or iPad app for the iOS App Store.
From our FAQ: Which languages are worth localizing into? »
Writing a description of your app for the App Store description is often difficult for even the best developers. How do you make your app sound great without sounding like a door-to-door salesman? How will the description translate when you localize your iPhone app, and are there any issues to consider for new markets? Babble-on helps developers with both the copywriting and translation, so we know this subject very well. Ask us for help.
Check it out: Tips for writing your iTunes App Store description »
A user can set their preferred language by going to Settings -> General -> International -> Language. Once the language is set, the iPhone/iPad will display all text, including the app's name on the home screen, in the user's local language.
We love iPhone and iPad apps and are excited to help you localize your projects and test them in multiple languages. Whether you need your iPhone app localized into Spanish, Japanese, Russian or any other language, Babble-on is ready to help.