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.
Edit only the files starting with an underscore in the extension_explorer/static/lib/scss/
directory. Then, 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:
- Documentation
- The
list-table
Sphinx directive is rendered https://extensions.open-contracting.org/en/extensions/budget_project/master/#guidance - The
extensiontable
Sphinx directive is linked https://extensions.open-contracting.org/en/extensions/lots/v1.1.3/#schema
- The
- Schema
- Paragraphs include links to existing definitions from:
- The following fields are shown in tables:
- The "Description" column:
- renders Markdown https://extensions.open-contracting.org/en/extensions/lots/master/schema/#Lot.status
- displays deprecation message
- indicates whether undeprecated https://extensions.open-contracting.org/en/extensions/milestone_documents/master/schema/#Milestone.documents
- indicates multilingual support https://extensions.open-contracting.org/en/extensions/budget_project/master/schema/#Project.title
- indicates whether it overrides:
- The "Types" column includes links to definitions within the extensions and to:
- Types of arrays indicate the types of items https://extensions.open-contracting.org/en/extensions/location/master/schema/#Location.geometry.coordinates
- Removed fields are listed, grouped by deprecation https://extensions.open-contracting.org/en/extensions/ppp/master/schema/#removed-fields
- Codelists
- Additional columns are shown https://extensions.open-contracting.org/en/extensions/ppp/master/codelists/#documentType.csv
- URLs are hyperlinked https://extensions.open-contracting.org/en/extensions/location/master/codelists/#geometryType.csv
- Subtracted codes are shown https://extensions.open-contracting.org/en/extensions/ppp/master/codelists/#-partyRole.csv
- Added, removed, and replaced codelists link to original codelists https://extensions.open-contracting.org/en/extensions/ppp/master/codelists/
Note: 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