1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/docs/translating-guide.md
2018-03-20 12:03:44 -07:00

1.5 KiB

MetaMask Translation Guide

The MetaMask browser extension supports new translations added in the form of new locales files added in app/_locales.

Adding a new Language

Each supported language is represented by a folder in app/_locales whose name is that language's subtag (look up a language subtag using this tool).

Inside that folder there should be a messages.json file that follows the specified format. An easy way to start your translation is to first duplicate app/_locales/en/messages.json (the english translation), and then update the message key for each in-app message.

That's it! When MetaMask is loaded on a computer with that language set as the system language, they will see your translation instead of the default one.

Testing

To automatically see if you are missing any phrases to translate, we have a script you can run (if you know how to use the command line). The script is:

node development/verify-locale-strings.js $YOUR_LOCALE

Where $YOUR_LOCALE is your locale string, i.e. the name of your language folder.

To verify that your translation works in the app, you will need to build a local copy of MetaMask. You will need to change your browser language, your operating system language, and restart your browser (sorry it's so much work!).