Skip to content

Latest commit

 

History

History
91 lines (58 loc) · 2.75 KB

CONTRIBUTING.i18n.md

File metadata and controls

91 lines (58 loc) · 2.75 KB

Getting Started with Localization

Pre-requirements

  • Git. You must install git to getting stared
  • VSCode. The highly recommended editor for translator to translate. It have integrated UI tool to help you find the translation key.
  • Node.js >=18.17.0. If you want to test your translation locally, you need this. You can just install latest version.
  • pnpm. If you want to test your translation locally, you need this. You can follow its installation page to install.

Getting Started

Fork & Clone

You need to fork & clone the project using git.

Suppose you already fork the project in Github to your repo:

git clone --recurse-submodules https://github.com/your-id/x-minecraft-launcher

Install

Optional, install the project using pnpm:

Under the folder you cloned, e.g. x-minecraft-launcher, run command

pnpm install

Install i18n Extension

Optional if you are using VSCode.

Install the i18n-ally (lokalise.i18n-ally) extension. The VSCode might hint you to install recommended extensions, which should already include this extension.

Found the locale file

You need to find the corresponding locale yaml file under

  • xmcl-keystone-ui/locales
  • xmcl-electron-app/main/locales

The file name is the locale code. You can reference this document to choice the locale.

Test your translation result

Optional. You need to first install the project. See #Install section above.

In VSCode, click the button on the sidebar Run and Debug, select the Electron: Main (launch), and click play button.

Or, you can try to press F5 which might be the hotkey for this operation.

This should start the launcher. You can switch to your language in setting page to test.

Adding new language

Optional. If you are adding a new language, you need to also go to the assets\locales.json and add the new language key value there.

Suppose you want to add French (fr), you can open the file assets\locales.json

{
  "zh-CN": "简体中文",
  "zh-TW": "繁體中文",
  "en": "English",
  "ru": "Русский язык",
  "es-ES": "Español"
}

adding a new line at the end

{
  "zh-CN": "简体中文",
  "zh-TW": "繁體中文",
  "en": "English",
  "ru": "Русский язык",
  "es-ES": "Español",
  "fr": "French"
}

Send Pull Request

Please follow the github guide about how to send pull request.