Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataHarmonizer Internationalization 1.9.0 #458

Merged
merged 639 commits into from
Jan 31, 2025
Merged

DataHarmonizer Internationalization 1.9.0 #458

merged 639 commits into from
Jan 31, 2025

Conversation

ddooley
Copy link
Collaborator

@ddooley ddooley commented Jan 31, 2025

This pull has numerous changes to code though few visible interface changes. This is version 1.9.0, and will be released as 2.0.0 once we "unhide" the internationalization capability.

  • Internationalization: For version 1.9.0 we have disabled the internationalization code simply by hiding a UI "language" menu that provides a menu of available languages. In this way maintainers and implementers of DataHarmonizer don't have to prepare for training users about this capability, and no bugs will show up related to using the UI interface in another language. We can therefore test the default "english" only version for some other bug fixes. That said, the upcomming internationalization feature has two parts:

    • User interface: A language menu will control the language that the DataHarmonizer interface is presented in. The translation file for all of this language is present in the DataHarmonizer github repo, in the web/translations/translations.json file. Canadian government approved translators have provided our first translation into French. Other translated languages are welcome!

    • Schema content: Every language field aspect of each LinkML data schema (and its templates) can be translated into a given language as well, appearing in the templates column header help, and in menu selections, and even in data saved in a given language. i.e. if one selects picklist items while using the interface in french, they are saved in french. Ones' selections are converted back into english if one flips the user interface back into english.

    • Note that if a schema has no translation, its content will remain in the default language regardless of what language a user is interacting with DataHarmonizer in.

  • A second change (useful perhaps to programmers) is that there is a better structure to the menu.js which holds basic information used to construct a stand-alone DataHarmonizer's menu of templates.

  • JSON Data load/save: Finally, we've upgraded our data structure for saving JSON data to accommodate a few needs:

    • A new LinkML "Container" format that enables several tables of data to be saved and loaded in one file. This is a prerequisite for the 1-many editing functionality coming down the pipe.
    • A sparse JSON save that only saves key value pairs where values are not empty.
    • The schema URI and version are included in the file data for easier recognition.

As a sneak preview of how the multilingual schema content works, our test case is with the CanCoGeN specification, whose language variants can be found in the locales/ subfolder, in this case "locales/fr/schema.yaml" for the french translation, which gets converted into a schema.json file in the standalone distribution of DataHarmonizer. The schema.yaml file has only the language sensitive fields in it (title, description, comment, examples etc.) and is "overlayed" onto the main, default - language provided in the template / schema home folder.

@ddooley ddooley merged commit 1dd4766 into master Jan 31, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants