Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path would be valid only if you installed with npm install -g. The package in debian / ubuntu looks the correct one to latest release 0.4.5 as we have in package.json. What was the error?

Copy link
Contributor Author

@alanmcruickshank alanmcruickshank Nov 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did install using npm install -g, as that's what it currently recommends in CONTRIBUTING.md. Should we update that to not recommend a global install?

I wonder if actually, I should update the docs here to add clarity around what needs to be done to makes sure po2json is installed in the right place more broadly. I found the process quite fiddly for someone who doesn't use node very often - global vs local installs and what folder things are available in was at the root of that I think. I'd love to make the process as easy as:

  1. Run command X in folder Y to install Z.
  2. Run command A in folder B to convert messages.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It docs use global install then it's fine.


## 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