From c63c1aa39cee62453aaa63dc6932f92079e7a68e Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 7 Aug 2023 13:35:48 +0530 Subject: [PATCH] Add i18n instructions --- I18N.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 I18N.md diff --git a/I18N.md b/I18N.md new file mode 100644 index 00000000..6e535621 --- /dev/null +++ b/I18N.md @@ -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 +