From 174f57b4646b3d320850c6286189a146cf0e23b0 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 9 Mar 2018 11:18:43 -0800 Subject: Document process of adding a new translation --- docs/translating-guide.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/translating-guide.md (limited to 'docs/translating-guide.md') diff --git a/docs/translating-guide.md b/docs/translating-guide.md new file mode 100644 index 000000000..62d444b5a --- /dev/null +++ b/docs/translating-guide.md @@ -0,0 +1,18 @@ +# MetaMask Translation Guide + +The MetaMask browser extension supports new translations added in the form of new locales files added in `app/_locales`. + +- [The MDN Guide to Internationalizing Extensions](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization) + +## 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](https://r12a.github.io/app-subtags/)). + +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 verify that your translation works, you will need to [build a local copy](https://github.com/MetaMask/metamask-extension#building-locally) of MetaMask. + -- cgit From 938228fba58f5ced6504d6f6d14e0b96df84c32a Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 20 Mar 2018 12:03:44 -0700 Subject: Document translation script --- docs/translating-guide.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'docs/translating-guide.md') diff --git a/docs/translating-guide.md b/docs/translating-guide.md index 62d444b5a..ae2dfecd3 100644 --- a/docs/translating-guide.md +++ b/docs/translating-guide.md @@ -14,5 +14,13 @@ That's it! When MetaMask is loaded on a computer with that language set as the s ## Testing -To verify that your translation works, you will need to [build a local copy](https://github.com/MetaMask/metamask-extension#building-locally) of MetaMask. +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](https://r12a.github.io/app-subtags/), 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](https://github.com/MetaMask/metamask-extension#building-locally) of MetaMask. You will need to change your browser language, your operating system language, and restart your browser (sorry it's so much work!). -- cgit