- Xliff Editor 2 1 – Xcode Localization Made Easy Keyboard Layout
- Xliff Editor 2 1 – Xcode Localization Made Easy Keyboard Shortcuts
Localization. What is it? Simply put it’s translating all the human readable text in your app into one or more languages. Turbomosaic 3 0 6 – photo mosaic maker countertop. Many apps developed in the U.S. may not consider it a requirement, but a small amount of extra effort will set you up for success in the future if/when your app needs to be translated. Here is a primer on the setup and tasks involved in creating an iOS app that can be localized.
Project Setup
Older Xcode projects are not configured for localization automatically, so there’s a few steps to configure your project to make sure it supports multiple languages.
- Select the project in the Project navigator and then select the project’s settings (the project name above the target or targets).
- Click on the Info tab, find the Localizations section, and make sure “Use Base Internationalization” is enabled.
- Click the + button to add a new language and select one from the list. Another screen will pop-up and ask about localizing existing Storyboards and/or Interface Builder XIBs.
- Now add a new
.strings
file to hold translated strings in your Obj-C/Swift code. Go to File -> New -> File (or type cmd-N). You’ll find “Strings File” under the Resources section. - The filename MUST be “Localizable”.
- Select the newly created
Localizable.strings
file in the Project. navigator and open the File inspector (on the right in Utilities pane). Click the Localize button, choose the Base localization, then also click the checkbox for your new language in the File inspector.
Now you’ll see multiple versions of Localizable.strings and Storyboard/XIB .strings files, looking something like this:
Translating Text in the User Interface
Any text that will be shown in the User Interface needs to be created using
NSLocalizedString()
or one of its variants. The second argument is a comment which can be helpful for translation companies to give context to how the string is used within the app. It is optional (can be nil or empty string).It explains the role of XLIFF in the localisation process and its interaction with other related XML standards. Read the XLIFF 1.2 Specification, which defines the XML Localization 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. When referencing this specification the following citation format should be used: XLIFF-2.1 XLIFF Version 2.1. Edited by David Filip, Tom Comerford, Soroush Saadatfar, Felix Sasaki, and Yves Savourel. 07 February 2017. OASIS Commitee Specification Draft 02 / Public Review Draft 02.
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. XLIFF Tool Abstract. This is an OS X Application for editing XLIFF files generated by Xcode (Menu Editor Export for localization.). Spell-Checking in editing mode; Undo/Redo; Single-table design for an efficient workflow using the keyboard; Auto-Save and Revert; Filtering, fulltext search query; OS X Compatibility. XLIFF 2.0 Specification (HTML) or PDF (893 KB) XLIFF 2.0 Schemas. XLIFF 2.0 Core and Modules; Previous approved version. XLIFF 1.2 Specification (HTML) or PDF (1553 KB) XLIFF 1.2 Schemas. XLIFF 1.2 - Strict; XLIFF 1.2 - Transitional; Related Documents. Representation Guide for HTML (HTML) or PDF (494 KB) Representation Guide for Java Resource.
A recommended best practice is to use descriptive keys in the NSLocalizedString() macros and match them to the actual user-facing text in
.strings
file. This is very similar to how Android works with its strings.xml
file and you could actually share the same keys if you’re working on a class-platform project. At runtime, the actual translated string is inserted into the UI from the appropriate .strings
file.When writing new code, or especially if going through existing code, do not forget about alerts, warnings, buttons, or error messages that show up in
UIAlertController
Alerts or ActionSheets. There are many more advanced features of UIKit and the Cocoa frameworks, such as pluralizing words using .stringsdict
files with String.localizedStringWithFormat
and NSNumberFormatter
, but I won’t be talking about them here. You can also localize Image files, but not Asset Catalogs directly. Apple has many more details in the Internationalization and Localization Guide.If your app uses Notifications, Core Location, or other services that require a user’s permission, then you are required to add Info.plist keys explaining to the user why you are requesting those permissions. You can localize Info.plist with the File inspector as described above and add language-specific versions of each required key. These are also facilitated by Xcode’s XLIFF export & import function, which I describe next.
NOTE: One gotcha. As you create new Interface Builder files (Storyboards or XIBs) they need to have Localization enabled and the desired languges checked each time you create one. This is done in the File inspector, as described above.
Sending to the Translator
You do not have to be constantly getting translations for your non-native development language as you build your app. When you get to a good point and are ready to have a translator go through the app, Xcode makes it easy to prepare one file that will contain all the needed strings. Apple chose the
There is a GUI command for creating (Exporting) the XLIFF file but we recommend using the command line because you will get feedback about any errors that happen during export. At your shell prompt:
XLIFF
format since it is cross-platform and has been in use by professional translating services for a while. Android does not directly support XLIFF but there are tools that generate strings.xml
files from it. There are also some (relatively) inexpensive apps available if you need to do the data entry yourself.There is a GUI command for creating (Exporting) the XLIFF file but we recommend using the command line because you will get feedback about any errors that happen during export. At your shell prompt:
This will make an
es.xliff
file which can be updated with the translated strings and then imported through the Xcode GUI by selecting the project file in Project navigator and choosing Editor -> Import Localizations… When you Import the XLIFF file, Xcode has a handy sheet that highlights potential problems such as missing translations. Some warnings could be superfluous, however (such as the same string in both languages, e.g. No (en) No (es)).Some Helpful Tips
We ran into a couple issues using the
xcodebuild -exportLocalizations
command.- NSAttributedStrings created in a Storyboard or XIB file appear to be ignored. We have often had to create them in code and then add the string to the Interface Builder file.
- Multi-line string literals (a convenience of the compiler to break really long strings across multiple lines) are ignored by the Export and will actually generate an error when you use the
xcodebuild
command line tool. - Create a new Scheme (or temporarily modify an existing Scheme) to test using a different language on the Simulator. Don’t try to just change the Language settings in the Simulator.
- Also in the Scheme settings, you can enable “Double Length Psuedo Language” to test your Layout Constraints and how they handle really long translations.
- For best overall results, use a real device and just change the Language in Settings.
We hope you found this helpful. Happy Localizing!
Please enable JavaScript to view the comments powered by Disqus.Highlights for Xcode 6 Beta
Swift Language
![Xcode Xcode](https://screenshots.macupdate.com/JPG/56798/56798_1597258543_scr_uc1.jpg)
Xcode 6 Features for Swift
Additional Feature Enhancements for Xcode 6 IDE
Testing
Interface Builder
Debugger
Sprite Kit
Extensions and Frameworks
iOS Simulator
Localization
Xliff Editor 2 1 – Xcode Localization Made Easy Keyboard Layout
Compiler
Instruments
Xcode Server
Home Kit Accessory Simulator
Xliff Editor 2 1 – Xcode Localization Made Easy Keyboard Shortcuts
Compatibility
Installation
Developer Resources
About SDKs and iOS Simulator
Project Modernization
New Features in Xcode by Release
See Also
Xcode 6 베타 릴리즈 노트
'iOS' 카테고리의 다른 글
iOS SDK Release Notes for iOS 8.2 Beta 3(0) | 2014.12.19 |
---|---|
Xcode6 및 베타5 릴리즈노트 다운로드(0) | 2014.08.05 |
iOS8 베타5 SDK 릴리즈 노트(0) | 2014.08.05 |
iOS SDK Release Notes for iOS 8.0 Beta(0) | 2014.06.03 |