-
Notifications
You must be signed in to change notification settings - Fork 0
Translation Option 2
This takes longer to set up the first time, but once it's configured it's the easier option to keep translating from: a visual interface shows missing keys, offers one-click machine translation as a starting point, and lets other people leave notes on entries.
-
Install Visual Studio Code, a free text editor from Microsoft, available for Windows, Linux and macOS.
-
Install Git, the version control tool GitHub is built on. During installation, the default options are fine: just click through.
-
Install the i18n Ally extension. In VS Code, open the Extensions panel (the four-squares icon on the left), search for
i18n Ally, and install it. -
Create a GitHub account if you don't have one.
-
Configure Git with your GitHub identity, in a terminal (Command Prompt on Windows, any shell on Linux):
git config --global user.email <email> git config --global user.name <username>
-
Fork the RiftLauncher repository. A fork is your own copy of the repository on your account; click the Fork button on the repo page. Name it
riftlauncher-xx-XXfor the language you're translating, for exampleriftlauncher-es-ESfor Spanish orriftlauncher-en-USfor English. -
Clone your fork and link it to the original repository. On your fork's page, click the green Code button and copy the URL, then run:
git clone <your-fork-url> cd riftlauncher-xx-XX git remote add upstream https://github.com/StratumServer/RiftLauncher
-
Open the cloned folder in VS Code. If it asks whether you trust the folder's authors, choose yes.
-
Set the source language. i18n Ally needs to know which language file is the reference. Click the 🌐 icon in VS Code's bottom right and choose
en-US.
Open the Localization panel from VS Code's left sidebar (it may take a few seconds to detect the language files the first time). It lists every key, flags what's missing, and lets you edit translations inline without opening the raw JSON.
Once you've translated what you wanted to:
-
Commit your changes. Open the Source Control panel (the Git icon on the left), stage your changes with the
+button, write a short message like "Translated" or "Updated translations", and commit. - Push your changes. Push to your fork; the first time, VS Code will ask you to sign in to GitHub in your browser and authorize the connection.
- Open a pull request. On your fork's GitHub page, click Contribute, then Open pull request. Give it a title and a short description, then create it.
- Sync your fork when the official repository moves ahead. On your fork's GitHub page, click Sync fork.
- Pull those changes down to your computer using the sync button in VS Code's bottom-left corner.
Repeat the translate, commit, push and pull request steps whenever a new release adds keys that need translating.
-
Create the language file. In
src/renderer/src/locales, add a newxx-XX.jsonfor the language and region you're adding. -
Register it. In
src/renderer/src/i18n.ts, add the import for your new file alongside the existing ones, and add an entry for it in the languages array. - Translate it the same way as an existing language: open the Localization panel and fill in the keys, then commit, push and open a pull request.