Apple XIB
XIB and Xcode localization for Apple applications.
Translate what Xcode exports from your XIB files, storyboards, and strings, reuse earlier translations, check format specifiers, and give Xcode a translated file to import. Your Xcode project keeps the interface, the build, and the final check.
- Input
- The XLIFF from Xcode's Export Localizations, or XIB, storyboard, and
.stringsfiles - Output
- A translated XLIFF for Import Localizations, or
de.lproj\Main.strings - Runtime
- The app picks the
.lprojfolder by the user's languages - Preview
- None: strings are translated in the table
On this page
Tutorial
Localize an Xcode project with Lingobit, step by step.
Four steps from Export Localizations to Import Localizations.
Xcode exports, Lingobit translates, Xcode imports.
Export Localizations collects the text of your XIB files, storyboards, .strings files, and String Catalogs into one XLIFF file. Lingobit translates it and writes a translated XLIFF for each language. Import Localizations puts the translations into the .lproj folders of your project.
Lingobit does
- Translates every string of the export, grouped by its XIB, storyboard, or strings file, with Xcode's notes.
- Reuses earlier translations and the translation memory.
- Checks format specifiers such as
%@and%lld, empty and too long translations, and more. - Writes a translated XLIFF for each language, or translated
.stringsfiles.
Your Xcode project keeps
- The interface in XIB files and storyboards, and Auto Layout.
- Export Localizations and Import Localizations.
- Loading the right language at runtime.
- The final test in the running application.
Reference
At startup, the app picks the .lproj folder by the user's languages.
Import Localizations writes the German text into de.lproj. When the user's first language is German (Germany), the app looks for de-DE.lproj, then de.lproj, so one German folder serves every German-speaking country.
- A missing translation shows the Base text in XIB files and storyboards; it does not break the application.
- A language you do not ship is skipped: the app takes the next language in the user's list, then the development language.
Choose the language.
On Apple platforms the user chooses the language, not the app: in the system settings, for all apps or for yours alone. To test a language without changing the system:
- Set App Language in the scheme options of your Xcode project.
- Or pass the language at launch with
-AppleLanguages "(de)". - Check each window in German, French, and Japanese, with the longest texts.
open -a MyApp --args -AppleLanguages "(de)"
What Lingobit reads from an Xcode project.
The Xcode export is the recommended input: it carries the text of every XIB file, storyboard, strings file, and String Catalog, with notes for translators. XIB and storyboard files can also be added directly, without the export.
Lingobit reads XLIFF 1.2, which Xcode writes. A unit with inline markup is left out and stays as it is; Output reports how many.
| Input | In Lingobit | Lingobit writes |
|---|---|---|
| XLIFF from Export Localizations | Strings grouped by their file; Xcode's note is the comment for translators; units marked translate="no" are not shown | The same XLIFF with translations and target-language, by default de\en.xliff; Xcode imports it |
.strings files | Each key and its text, in UTF-8 or UTF-16 | de.lproj\Main.strings in UTF-8, without comments |
.plist files | String values, in XML, binary, or text format | The same file in de.lproj |
.xib and .storyboard files | The text of labels, buttons, fields, windows, and menus, keyed by the object ID; current files and the older Interface Builder 3 format | The same file in de.lproj, such as de.lproj\Main.xib |
Do and don't.
Do
- Export Localizations again before every handoff, and run Scan for Changes.
- Write comments for translators in Xcode: they arrive in Lingobit as notes.
- Use numbered specifiers such as
%1$@when translators may need to change the order. - Use Auto Layout, so longer German text has room.
Don't
- Build sentences in code from translated pieces.
- Send Swift, Objective-C, or Xcode project files to translators.
Troubleshooting.
| Symptom | Likely cause | What to do |
|---|---|---|
| The application stays in English | The translations were not imported, German is not added to the project's localizations, or German is not in the user's languages | Import the XLIFF in Xcode, check Localizations in the project settings, and test with App Language |
| Some strings are missing in Lingobit | They contain inline markup, which Lingobit leaves out, or they are marked not to translate | See the Output panel for the count; translate those strings in Xcode |
| The application fails with one language | A translation drops or changes a format specifier such as %@ | Run Validation: it reports specifiers that do not match the source |
| German text is cut off | There is no preview in Lingobit, so long text shows only in the running application | Set a maximum length for the strings in Lingobit; Validation reports translations that exceed it. Check the windows with App Language |
The samples.
Localizer installs two Apple samples with their projects.
- Xcode export:
en.xlifffrom an app with a storyboard,Localizable.strings, andInfoPlist.strings, in German and French. The project writesde.xliffandfr.xliffnext to it for Import Localizations. - Apple Property List:
.plistfiles in XML, binary, and text format, translated into.lprojfolders.
More about Apple localization.
Base internationalization and localized strings
Xcode keeps the XIB layout in Base.lproj and stores translated text separately for each language. Developers keep control of the Interface Builder layout, translators work with text instead of project structure, and existing translations are reused when the UI changes.
Base.lproj/MainMenu.xib
de.lproj/MainMenu.strings
fr.lproj/MainMenu.strings
String Catalogs and compiled files
String Catalogs reach Lingobit through the XLIFF that Export Localizations writes; .xcstrings files themselves are not read. Compiled .nib files are not read either: translate the .xib and .storyboard files or the export.
Visual review stays in Xcode
Longer translations need more room in labels, buttons, menus, and windows. Lingobit does not preview Apple windows or views, so check for cropped text, overlapping controls, and buttons that became too small in the running application. Interface Builder layout, Auto Layout fixes, Swift or Objective-C code, and packaging the application bundle stay in Xcode.
Related paths
- Localization QA — Validation, format specifier checks, and more.
- Translation workflow — XLIFF 1.2 for translators and their CAT tools.
- Release workflow — Scan for Changes and translated files for every release.
- Supported formats — XLIFF, Apple strings and property lists, and more.