Skip to content

Commit

Permalink
Add i18n instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
roop committed Aug 7, 2023
1 parent c079aa7 commit c63c1aa
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions I18N.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Internationalization / Localization

We use transifex for localization.

The process for localization is:

1. Export localization source strings from Xcode

- Open `EduVPN.xcworkspace` in Xcode
- In Xcode, open the Projects and Targets pane
- In the Project Navigator (keyboard shortcut: Cmd+1), select "EduVPN" at the top left
- Click on _Product > Export Localizations_
- Select a location to save (say "eduVPN/i18n"; Xcode will create a directory with a bunch of files inside)
- In _Localizations_, ensure only _English - Default Localization_ is selected
- Click on the _Export_ button

The directory will now have an `en.xcloc` directory. Inside that, under `Localized Contents`, there will be an `en.xliff` file. This is our localization source.


2. Import localization source strings into Transifex

When starting with a fresh app (like a new app or new redesign of an app):

- Log in to Transifex
- Under the _eduVPN apple (macOS/iOS)_ project, select _Resources_
- Click on _Add Resources_ to import the `en.xliff` file (use drag and drop -- the file picker doesn't work because it doesn't go inside the xcloc package)

When the app gets updated and the source strings change, we might want to update the strings in Transifex:

- Log in to Transifex
- Under the _eduVPN apple (macOS/iOS)_ project, select _Resources_
- Click on the `en.xliff` resource
- Click on _Update source file_ to import the `en.xliff` file (use drag and drop -- the file picker doesn't work because it doesn't go inside the xcloc package)

3. Translate strings in Transifex

4. Export localized strings from Transifex

- Log in to Transifex
- Under the _eduVPN apple (macOS/iOS)_ project, select _Resources_
- Click on the relevant `en.xliff` file
- Click on the language whose translations need to be imported
- Click on _Download for use_
- Save the `.xlf` file somewhere

5. Import localized strings into Xcode

- Open `EduVPN.xcworkspace` in Xcode
- In Xcode, open the Projects and Targets pane
- In the Project Navigator (keyboard shortcut: Cmd+1), select "EduVPN" at the top left
- Click on _Product > Import Localizations_
- Select the `.xlf` file downloaded from Transifex
- Click on the _Import_ button
- If prompted on where we should import into, select `EduVPN.xcworkspace` (I don't think it matters what we choose here), click on _Choose_
- Xcode will show the currently used strings on the right and the being-imported strings on the left
- Click on _Import_
- Commit the changes

0 comments on commit c63c1aa

Please sign in to comment.