Get a copy of extensions' translations:
git clone git@github.com:open-contracting/ocds-extensions-translations.git
Generate the data file, substituting the path to the above repository's locale
directory for path/to/locale
:
ocdsextensionregistry generate-data-file --locale-dir path/to/locale > extension_explorer/data/extensions.json
If you prefer to store the data file in another location, set the EXTENSION_EXPLORER_DATA_FILENAME
environment variable.
Don't edit extension_explorer/static/css
. Instead, edit extension_explorer/static/lib
and run:
pysassc extension_explorer/static/lib/scss/theme.scss > extension_explorer/static/css/theme.css
If translatable strings are changed, change into the app's directory:
cd extension_explorer
Extract messages:
pybabel extract -F ../pyproject.toml -o messages.pot .
Push to Transifex:
tx push -s
Translate, then pull From Transifex:
tx pull -a
Finally, compile messages:
pybabel compile -f -d locale
If adding a new language, update LANGS
in views.py
.
Note: For translating the extensions themselves, see these instructions.
env FLASK_DEBUG=1 FLASK_APP=extension_explorer/views.py flask run
Create a static site in extension_explorer/build
:
python freeze.py
Preview the static site:
python -m http.server --directory extension_explorer/build
The automated tests provide full code coverage, but you might still want to check pages visually. Here are a few features to check:
list-table
Sphinx directive is rendered https://extensions.open-contracting.org/en/extensions/budget_project/master/#guidanceextensiontable
Sphinx directive is linked https://extensions.open-contracting.org/en/extensions/lots/v1.1.3/#schemaNote: No extension deprecates codes, so code deprecation isn't implemented yet.
To update the requirements, delete and re-create the virtual environment, then run:
pip install -r requirements.in
pip freeze > requirements.txt