Skip to content

Contributing#

This project is hosted on GitHub.

Visit GitHub

Translation#

🗺 Transifex

The UI is available on Transifex, no development knowledge is required. You need to create an account, request the language if your language is not available by default (we will happily accept) and start to translate strings.

To translate the metadata glossary, the SQL file needs to be edited.

If you change an SQL file, you need to add a migration file, located in pg_metadata/install/sql/upgrade/. These files are run according to the current version of the database to be sure that an existing database can also be upgraded to a newer version of the plugin.

SQL files located in pg_metadata/install/sql/pgmetadata are run only on a new database.

Example of a migration file to update the glossary with German language :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
CREATE TABLE pgmetadata.t_glossary (field text, code text, label_de text, description_de text);

INSERT INTO pgmetadata.t_glossary (field, code, label_de, description_de)
VALUES
('dataset.publication_frequency', 'WEE', 'wöchentlich', 'Daten werden wöchentlich aktualisiert')
ON CONFLICT DO NOTHING;

UPDATE pgmetadata.glossary AS g
SET (label_de, description_de)
= (t.label_de, t.description_de)
FROM pgmetadata.t_glossary AS t
WHERE g.field = t.field AND g.code = t.code;

DROP TABLE pgmetadata.t_glossary;

You can submit a PR on GitHub or feel free to contact us for any assistance. There are some languages available already.

Code#

🧪 Tests

SQL and Python are covered by unittests with Docker.

1
2
3
4
5
6
7
pip install -r requirements/dev.txt
# Check errors
flake8
# Sort imports
isort .
make tests
make test_migration

On a new database, if you want to install the database by using migrations :

1
2
3
import os
os.environ['TEST_DATABASE_INSTALL_PGMETADATA'] = '0.0.1'  # Enable
del os.environ['TEST_DATABASE_INSTALL_PGMETADATA']  # Disable

Documentation#

📖 Documentation

The documentation is using MkDocs with Material.

1
2
pip install -r requirements/doc.txt
mkdocs serve