Translating for PoWH3D

We have now fully configured both the homepage and the exchange with support for internationalization. Anyone can add support for a language. Instructions are below:

  1. Create a Github Account
  2. Get a Copy of the Translations Repo
  3. Translating the Exchange
  4. Translating the Frontend
  5. Contribute Back for Deployment

Create a Github Account

In order to contribute translations, you'll need to have a Github account. If you don't have a github account, sign up for one through that link.

Get a Copy of the Translations Repo

We need to get our own copy of the repository to start translating:

  1. The first step is to visit the translations page on Github.

  1. Click the "Fork" button on the repository to create your own copy.

  2. You now have your own personal copy of the repo which can be used for translations.

You are now ready to start translating.

Translating the Exchange

Let's start by translating the exchange:

  1. First, visit this common.json file from the main repo.

  2. Copy all of the text in this file to your clipboard to paste into a new file.

  3. Go to your copy that you created and click "Create new file"

  1. Find your country code below (for example, es for Spanish or ko for Korean)

  2. Enter the folliowing as the file name: exchange/[country-code]/common.js. For example, exchange/es/common.js.

  1. Paste the full text of this common.json file from the main repo into this new file.

  2. Click "Commit new file" at the bottom of this page

  1. Click into the file "common.js" that you just created.

  2. Click the pencil icon to edit this file

  1. Fill out translations for your language, replacing all English phrases with the appropriate equivalent. For example, here's the English strings:
{
    "masthead": {
        "holdings": "Holdings",
        "balance": " ETH in contract"
    },
    // ...
}

and then replace that with:

  1. Once finished with translations or wanting to save changes, then scroll down and click "Commit changes":

  1. Once you've translated all strings, then the exchange translations are complete!

Translating the Frontend

Next, we need to translate the front-end following the same pattern:

  1. First, visit this frontend common.json file from the main repo.

  2. Copy all of the text in this file to your clipboard to paste into a new file.

  3. Go to your copy that you created and click "Create new file"

  1. Find your country code below (for example, es for Spanish or ko for Korean)

  2. Enter the folliowing as the file name: frontend/[country-code]/common.js. For example, frontend/es/common.js.

  3. Paste the full text of this common.json file from the main repo into this new file.

  4. Click "Commit new file" at the bottom of this page

  5. Click into the file "common.js" that you just created.

  6. Click the pencil icon to edit this file

  7. Fill out translations for your language, replacing all English phrases with the appropriate equivalent.

  8. Once finished with translations or wanting to save changes, then scroll down and click "Commit changes":

  9. Once you've translated all strings, then the frontend translations are complete!

You can check out my example repo here!

Contribute Back for Deployment

Now we are ready to submit this back for review so the translation can be deployed!

  1. Click on "Pull Request" tab on your copy of the code

  1. Click "New Pull Request"

  1. Enter a title and description mentioning your language translations are complete

  1. Click "Create pull request" to send us a notification that you are ready for review.

  2. Once we review and merge, these translations will be soon be pulled into the official site!

You can see an example of a pull request submitted for French translations here.

Happy translating!

Bugging Mantso

The final step is, if you do not yet see your translations merged to the site, be sure to bug @Mantso and ask him to deploy the latest translations.

Country Codes

ar: Arabic
az: Azerbaijani
be: Belorussian
bg: Bulgarian
bs: Bosnian
ca: Catalan
cs: Czech
da: Danish
de: German
en: English
es: Spanish
et: Estonian
fa: Persian
fi: Finnish
fr: French
el: Greek
he: Hebrew
hr: Croatian
hu: Hungarian
hy: Armenian
it: Italian
id: Indonesian
ja: Japanese
ka: Georgian
kk: Kazakh
ko: Korean
ky: Kyrgyz
lt: Lithuanian
lv: Latvian
mk: Macedonian
mn: Mongolian
nb: Norwegian Bokmål
nl: Dutch
nn: Norwegian Nynorsk
pl: Polish
pt: Portuguese
ro: Romanian
ru: Russian
sk: Slovak
sl: Slovene
sr: Serbian
sv: Swedish
tr: Turkish
uk: Ukrainian
uz: Uzbek
zh: Chinese