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.
- Xliff Editor 2 1 – Xcode Localization Made Easy Tutorial For Beginners
- Xliff Editor 2 1 – Xcode Localization Made Easy Tutorial Pdf
- Xliff Editor 2 1 – Xcode Localization Made Easy Tutorials
- Xliff Editor 2 1 – Xcode Localization Made Easy Tutorial Download
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.
Following the same steps as before, set the proper flag image for the German localization as well. Other Xcode 6 Features. The industry standard file format for exchanging and sharing data for translation is the XLIFF type. Files of such format are used worldwide by translators, translating companies, developers, even simple users. . This tutorial uses Xcode 6 and iOS 8. Auto Layouts today are inevitable for any application. Be it an iPhone or an iPad application. That is because the device sizes are ever changing and also because of new iOS features like multi tasking for iPad makes the available screen size for your application dynamic.
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.
Xliff Editor 2 1 – Xcode Localization Made Easy Tutorial For Beginners
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
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 4video mp3 converter v5 1 63.
Option 2: Add postfix operator
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. Cudatext 1 83 14. 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
Xliff Editor 2 1 – Xcode Localization Made Easy Tutorial Pdf
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.
This wasn’t especially difficult, but it was a little tedious to track down.
I’ve relied on a handy little build phase script (I wish I remember where I found it) for automating build numbers from git commits for iOS apps since Apple gave us access to TestFlight via iTunes Connect. This same script didn’t work for my Apple Watch app as I anticipated, so it took a little bit to work out the kinks for AppStore submission.
It boils down to this
- Set the build number = the number of git commits on the branch.
- Change the Info.plist build numbers for the iOS app target, the Watch App target, and the Watch Extension target. This is done in a script build phase before the “Copy Bundle Resources” phase.
- Reset the Info.plist build numbers after all the build phases have run (another script build phase)
Xliff Editor 2 1 – Xcode Localization Made Easy Tutorials
See the gist I posted for the complete script. Make sure to check the directory paths for the correct app name. Iflicks 2 2 4 download free.
Xliff Editor 2 1 – Xcode Localization Made Easy Tutorial Download
Happy building!