3liz / qgis-pgmetadata-plugin

QGIS Plugin to manage some metadata from PostgreSQL layer
GNU General Public License v2.0
12 stars 10 forks source link

Enhancement: offer translations of HTML templates #134

Open effjot opened 1 year ago

effjot commented 1 year ago

A little enhancement proposal for i18n: Could we add an option to the processing tool reset_html_templates for selection languages? We could store translated HTML files in pg_metadata/resources/html with language suffixes (e.g. main_de.html) for the user to choose from. Perhaps it is also possible to put the html files on Transifex in order to keep all translation work in a single place.

mdouchin commented 1 year ago

Hi ! Good catch. I had the idea to use the same process as for values (see: https://docs.3liz.org/qgis-pgmetadata-plugin/database/routines/generate_html_from_json.html) and also search & replace the field names with the translated ones.

This would ease the translation process: the HTML template would remain the same (or transformed a bitt to recognize the field names to translate), and we won't need to update N templates every time we change the template or add a field.

The translations would then be stored in a table (as for the field glossary). Side effect: transifex won't be used with this technique...