Home Forums General Technology Computer Zone PC Apllications Xliff Editor 2.8.1 – Xcode localization made easy Welcome to Ramleague, Ramleague - the best site for pinoy chat, games chat and mobiles chat.
Xcode 6 introduced a new localization workflow which uses the open.XLIFF format. Xcode extracts the strings from NSLocalizedString, strings in storyboards / XIB files and creates a single XLIFF file for each localization. I'm looking for good localization tools that translators can use to open and edit the files exported by Xcode. XLIFF is a XML-based format to standardize the localization of software applications. It's allegedly used by professional translation services and it's been recommended by Symfony since the beginning. Stop using XLIFF in our own translation files (validators.xlf, security.xlf, etc.). This document defines version 2.1 of the XML Localisation Interchange File Format (XLIFF). The purpose of this vocabulary is to store localizable data and carry it from one step of the localization process to the other, while allowing interoperability between and among tools.
Question: Let's localize your iPhone app!
Localize an iPhone app. Preparing your iOS app for localization in Xcode 9 and Xcode 10
Now your iPhone app can speak that
Preparing your iOS app for localization in Xcode
iOS and Mac apps rely on something called base internationalization. Here's how it works.
Introduction to Base Internationalization
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 automatically. 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.Enabling Base Internationalization in Xcode 9 and Xcode 10
- Turn on Base Internationalization. Recent versions of Xcode turn on base internationalization by default, but let's just make sure your project is using it. Select your project in Xcode's file navigator. (Make sure you're looking at the Project, not the target, and that the Info panel is highlighted blue.) This is the screen to verify or enable base internationalization, there at the bottom.
- Add any resource files you plan to localize into your
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). - Add languages using the menu command Editor > Add Localization. Or right from the Info panel, press the button and choose the language you want to add. Xcode will again ask which resources you plan to localize, and create a [language code].lproj folder for each.
- Finally, enable Auto Layout in your views. Why? Other languages are going to take up either less or (more likely) much more space than your current language. German words take up about 30% more room than English, and Chinese takes about 15% less. Eliminate all fixed origins, widths, and heights in your views so that the localized text can reflow automatically when the language or locale changes. Auto Layout is enabled by default in Xcode for new projects, but for existing projects you can enable it for any view.
See also: Apple's Auto Layout Guide. - Don't forget to add comments. Starting from Xcode 7 came the ability to add comments for the translators directly in Interface Builder. Make sure to mention if something is a button, a headline, or anything else that might help give context.
Hint: Add more resources at any time using the File inspector. Just press the 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.Extract your hard-coded app strings for iOS localization
Xcode's Base Internationalization will export your storyboards and xib texts automatically. That leaves your hard-coded strings and labels, which you can also prepare for export using the NSLocalizedString macro.
Change hard-coded strings to 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. If you're still programming in Objective-C, note that the correct macro isNSLocalizedStringWithDefaultValue
. Let's begin by making sure your coded strings are ready for iPhone localization. That means you'll want to change all user-facing strings to: - Always include a unique key and 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. Also make sure your key is absolutely unique. That will ensure that you can translate a string like 'Clear' as both a button to remove text, AND as an adjective describing the color of something. In other languages, these two words are certain to be different! - Advanced users: Since version 6, Xcode has decided to hide the Localizable.strings file for your English strings by default. 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 theen.lproj
folder.You can, however, change this behavior by creating your own Localizable.strings file, or using the helpfulgenstrings
command. OpenTerminaland 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 theen.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.
Use Xcode's handy import/export localization features
Since Xcode 6, Apple has embraced the XLIFF format for handing off to your translation team
Importing and exporting localizations with XLIFF
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 has 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, select where to save the export. Generally speaking, as translators, we only need the Development language, which is usually English. But if you have existing translations to share, you will also want to send those. You can export any language from the list of available ones for your project.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!New in Xcode 10: Xcode will now export even more stuff in a folder it called an Xcode catalog, or
.xcloc
. In addition to the xliff file, it also exports some Source context (storyboards) and creates a Notes folder where you can put some screenshots for your translators or other instructions. - 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 likezh-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 Import button to finish.
Create a free account in our developer portal to help test out your localization, get free price estimates, and expert advice
See also: Mirror for panasonic tv 3 5 1.
Translate your App Store metadata too
Even before you publish your localized app, translating your app description and keywords is a great way to see which languages are most likely to succeed in your internationalization efforts.
Pseudolocalization — testing you've found every string
Once you've finished preparing your .strings file you're probably having doubts that you actually managed to find every hard-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!
Start translating your app right away using this free Multilingual iOS Term Glossary.
It contains common translations for iOS terms, including things like Settings, Tap, etc. in a dozen languages.
It contains common translations for iOS terms, including things like Settings, Tap, etc. in a dozen languages.
What to send to the translator
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.
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 »
Now your app can speak that
Hiring a team for iOS localization.
1. Send your iPhone localization strings.
Calculate the word count and cost of your
XLIFF
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.
Budget localizations using a free App Localization Cost Calculator
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.
See Press Release: San Francisco iOS App Localization Service Says No to the Factory Model, Introduces Cost Estimator
Multilingual iOS application iPhone localization examples
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!
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? »
Phrase Official Site
Is your App Store description going to sell?
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 »
Tell your users in their language.
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.
Professional iOS localization
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.
The process of localization is sometimes tedious and unorganized. Lokalise helps you solve this problem. In this tutorial, we’ll focus on enabling localization in your application and adding, managing and integrating localizations in your project.
This tutorial is based on Xcode 8.2.1, which shows how to setup localization from zero to hero and use Lokalise as the translation management platform. If you are a seasoned localization master, we’d still recommend going through and take notes of some specific localization details.
Step 1: Create Localizable.strings
Localizable.strings stores app strings as key-value pairs for each language. Let’s create this file for the base language first. Select File → New → File… or just tap ⌘-N. Search for strings and you will get Strings File in Resource window.
Choose this option and name the file Localizable.
Now, let’s select Localizable.strings in the Navigator. In Utilities, you will see localization panel.
Click Localize… and select English from the dropdown menu.
Step 2: Adding languages
Let’s add some languages and create .strings file for each of the languages.
Select your root project file, then the project panel. Down in localization section simply click + and add the languages you need. Select only Localizable.strings for localization. We will add German and Russian for demo purposes.
Let’s find Localizable.strings using Navigator. Now you can expand it and see a Localizable.strings for every language.
Step 3: Working with localizations
Xliff Editor 2.8.1 – Xcode Localization Made Easy | RAMLeague
Now once Localizable.strings files are ready, let’s populate these. As mentioned earlier, the localization process involves keys and values. Key is usually an ID of the copy you want to put in place on elements. Let’s add two entries into each of the .strings files.
Localizable.strings (English)
Localizable.strings (German)
Localizable.strings (Russian)
Once the keys are set up, let’s learn how to get the translations for these. To do that we will use NSLocalizedString method. Modify application:didFinishLaunchingWithOptions: method of your delegate to test-drive the localization system.
Hurray! You should get Welcome printed in the console.
Tip #1: the shortcut
Typing NSLocalizedString(“key”, comment: “comment”) all the time will annoy you and make your code look heavier and harder than it needs to be. To make your life easier, choose one of two options:
Option 1. Add String extension
Option 2: Add postfix operator Pantone 000c.
Tip #2: easy testing
You can change the language of your app by modifying your Scheme. Select your scheme and click Edit Scheme…
Then in Options tab select Application Language that you want to test.
Now your application is set up and you know the basics of localization process on iOS, so let’s see what’s the fuzz is all about. Imagine thousands of keys across tens of language files, making sure all are in sync, are translated and proofread. Pretty scary, huh? We’ve built Lokalise to help you avoid all the chaos.
Step 1: Create a project in Lokalise
Once you sign up to Lokalise, just tap “Add another project” button (or explore the Sample Project if you wish to get more familiar with Lokalise features first). Give your project a name and optionally a description. You can change the base language setting later if you change your mind about it.
Each project has a unique ID (you can see it in project settings), that is used when referring to a project over API.
Step 2: Upload your files or add new keys
Import your .strings file to Lokalise. Click upload and drag Localizable.strings to drop area. Alternatively, you can do it the other way – start by adding keys in Lokalise first.
Step 3: Invite team members
Getting localization work done quick requires a team of contributors. Switch to the Contributors section by clicking the icon in the project’s icon bar and start adding teammates. Any user can be granted admin privileges, i.e. the same rights on the project as you. If a user is not an admin, you can specify per-language access to the project specifying some languages as reference (read-only) or contributable (read and update). Only admins have access to key modification, importing, exporting, settings, etc.
Step 4: Edit!
Lokalise editor is feature-packed. We’ve worked hard to deliver light and responsive interface while still offering all the features you would need while working with app or web project copy. Feel free to explore Sample Project or just take a look at Documentation to read about the basic concepts and options.
Finally, the translation part is done. How to get the information out of Lokalise and make it usable in your app? There are four options, choose the one you prefer:
Option 1: Download the files
Click Download icon in your project icon bar and select Apple Strings as the exporting format. Click Build and download to finish and get the file. Then move .lproj folders from the downloaded archive into your project replacing the existing localization, that’s it.
Option 2: Use Fastlane actions we’ve built
If you are using Fastlane, then use lokalise.rb provided in this Github repository. Let us know in support chat if you have additional questions related to the action scripts.
Option 3: Use API or CLI tool
Depending on your project deployment setup, you may want to use either Lokalise API or the CLI tool – both approaches give you a simple way to automatically generate and download localization files.
Option 4: Integrate using Lokalise iOS SDK
Using our framework gives an opportunity to update your app texts over-the-air without the need to resubmit for Appstore review. Please refer to Lokalise iOS SDK instructions.