cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
91 stars 23 forks source link

Multilingual tabular to schema #429

Closed ddooley closed 2 months ago

ddooley commented 2 months ago

For a given Google Sheets driven schema in /web/templates/[schema folder]/[LinkML schema files], if schema has an "in_language" parameter with list of languages such as "en, fr", then running

cd web/templates/[template folder]/ python ../../../script/tabular_to_schema.py

will create /web/templates/[schema folder]/schema.yaml and schema.json as well as creating locales/[locale e.g. fr]/schema.yaml and schema.json.

to also add entries in /web/templates/menu.js, include the -m or --menu parameter:

python ../../../script/tabular_to_schema.py -m

This depends on Google Sheets setup of fields like so, see CanCoGeN-slots and CanCoGeN-enums tabs of this sheet.

image
kennethbruskiewicz commented 2 months ago

To clarify, those fields annotated to _fr do not become a <field>_fr: <french field> mapping in the schema? But instead only as <field>: <french field> for the schema in /web/templates/locales/fr/?