Skip to content

Commit

Permalink
Consolidate all translation config (apache#3750)
Browse files Browse the repository at this point in the history
Move all translation config to superset/translations
  • Loading branch information
alanmcruickshank authored and mistercrunch committed Nov 2, 2017
1 parent abfa034 commit 87b6d76
Show file tree
Hide file tree
Showing 3 changed files with 1,053 additions and 732 deletions.
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,15 @@ navigation bar.
}

As per the [Flask AppBuilder documentation] about translation, to create a
new language dictionary, run the following command:
new language dictionary, run the following command (where `es` is replaced with
the language code for your target language):

pybabel init -i ./babel/messages.pot -d superset/translations -l es
pybabel init -i superset/translations/messages.pot -d superset/translations -l es

Then it's a matter of running the statement below to gather all strings that
need translation

fabmanager babel-extract --target superset/translations/ -k _ -k __ -k t -k tn -k tct
fabmanager babel-extract --target superset/translations/ --output superset/translations/messages.pot --config superset/translations/babel.cfg -k _ -k __ -k t -k tn -k tct

You can then translate the strings gathered in files located under
`superset/translation`, where there's one per language. For the translations
Expand All @@ -375,6 +376,11 @@ Execute this command to convert the en PO file into a json file:

po2json -d superset -f jed1.x superset/translations/en/LC_MESSAGES/messages.po superset/translations/en/LC_MESSAGES/messages.json

If you get errors running `po2json`, you might be running the ubuntu package with the same
name rather than the nodejs package (they have a different format for the arguments). You
need to be running the nodejs version, and so if there is a conflict you may need to point
directly at `/usr/local/bin/po2json` rather than just `po2json`.

## Adding new datasources

1. Create Models and Views for the datasource, add them under superset folder, like a new my_models.py
Expand Down
File renamed without changes.
Loading

0 comments on commit 87b6d76

Please sign in to comment.