Skip to content
Snippets Groups Projects
Unverified Commit 6d37916d authored by Sameer Al-Sakran's avatar Sameer Al-Sakran Committed by GitHub
Browse files

Update developers guide

parent ae15cbc7
No related branches found
No related tags found
No related merge requests found
......@@ -263,6 +263,31 @@ Start up an instant cheatsheet for the project + dependencies by running
lein instant-cheatsheet
## Internationalization
We are an application with lots of users all over the world. To help them use Metabase in their own language, we mark all of our strings as i18n. The general workflow is:
1. Tag strings in the frontend using `t` and `jt` ES6 template literals (see more details in https://c-3po.js.org/):
```javascript
const someString = t`Hello ${name}!`;
const someJSX = <div>{ jt`Hello ${name}` }</div>
```
and in the backend using `trs` and related macros (see more details in https://github.com/puppetlabs/clj-i18n):
```clojure
(trs "Hello {0}!" name)
```
2. When you have added/edited tagged strings in the code, run `./bin/i18n/update-translations` to update the base `locales/metabase.pot` template and each existing `locales/LOCALE.po`
3. To add a new translaction run `./bin/i18n/update-translation LOCALE`
4. Edit translation in `locales/LOCALE.po`
5. Run `./bin/i18n/build-translation-resources` to compile translations for frontend and backend
6. Restart or rebuild Metabase
To try it out, change your browser's language (e.x. chrome://settings/?search=language) to one of the locales to see it working. Run metabase with the `JAVA_TOOL_OPTIONS=-Duser.language=LOCALE` environment variable set to set the locale on the backend, e.x. for pulses and emails (eventually we'll also add a setting in the app)
## License
Copyright © 2017 Metabase, Inc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment