mirror of https://github.com/apache/superset.git
Consolidate all translation config (#3750)
Move all translation config to superset/translations
This commit is contained in:
parent
abfa03474c
commit
87b6d76c32
|
@ -351,14 +351,15 @@ navigation bar.
|
||||||
}
|
}
|
||||||
|
|
||||||
As per the [Flask AppBuilder documentation] about translation, to create a
|
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
|
Then it's a matter of running the statement below to gather all strings that
|
||||||
need translation
|
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
|
You can then translate the strings gathered in files located under
|
||||||
`superset/translation`, where there's one per language. For the translations
|
`superset/translation`, where there's one per language. For the translations
|
||||||
|
@ -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
|
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
|
## Adding new datasources
|
||||||
|
|
||||||
1. Create Models and Views for the datasource, add them under superset folder, like a new my_models.py
|
1. Create Models and Views for the datasource, add them under superset folder, like a new my_models.py
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue