Skip to content

Updating localizations

Eitot edited this page Mar 25, 2019 · 3 revisions

Rules

  • Never update *.strings files manually
  • Always update the source files first
  • Use Xcode's XLIFF export/import capabilities
  • Keep Crowdin up to date

Adding new strings for localization

  1. Make the changes to the source files
    • NSLocalizedString in *.m or *.swift
    • Interface Builder
  2. Export the development language (English) in Xcode
    1. Select the Vienna project in Xcode's project navigator
    2. Select "Editor" → "Export For Localization…" in the menu
    3. Select "Include: Development Language Only" in the save panel
  3. Commit the exported en.xliff file to Localizations/en.xliff and submit a pull request
  4. Upload the updated en.xliff file to Crowdin

Importing localized strings

  1. Update and build the localizations at Crowdin
  2. Merge Crowdin's pull request containing the updated XLIFF files
  3. Run make localize from the project root to import the XLIFF files into the project

Changing NSLocalizedString keys

  1. Follow the export instructions above
  2. Update the keys in the translated *.strings files
  3. Export the languages in Xcode, using "Include: Existing Translations"
  4. Upload the new XLIFF files to Crowdin manually
  5. Follow the import instructions above

Note: Do not commit the changes to the *.strings or XLIFF files. Steps 2–4 are only for the purpose of updating Crowdin's database.