Skip to content

[3800 i18n redesign] Supporting private tags

Created by: chenejac

VIVO GitHub issue: 3800

Companion PR

What does this pull request do?

Adding support for local customization of UI labels by using language tags. It means an institution can add in the directory /rdf/i18n/ its own local customization of translations. Those local, institution-specific translations should be in the directory which name is aligned with language tag specification for private tags (for instance fr_CA_x_uqam or de_DE_x_tib). The idea is similar as for property files and usage of webapps/i18n/local directory. The institution can easily update VIVO version, and continue to use previously customized labels and vocabularies.

What's new?

  • Replacing locale.toString() with locale.toLanguageTag(): locale.toLanguageTag() produces fr-CA-x-uqam while the code locale.toString() produces fr_CA_#x-uqam We have code which do replacement of _ and - in string representation of locale, therefore, the first one string is needed
  • The installer/home/pom.xml is adopted to keep local specific files in VIVO_HOME/rdf/i18n/x/**

How should this be tested?

  1. Install VIVO
  2. Unzip this file into /rdf/i18n/
  3. Add into runtime properties languages.selectableLocales = en_US, fr_CA, fr_CA_x_uqam
  4. Run tomcat and open VIVO in a web browser
  5. Change language between the second and third language in the list
  6. At the home page you should found the label "Recherche" and "Recherche uqam" depends on selection of the French variant.
  7. If you login, you will also notice that logout option in the menu has been changed to "Déconnexion wilma uqam" when the last language has been selected
  8. Also, on some pages labels with uqam suffix will appear.

Example:

  • Does this change require documentation to be updated? Yes, it should be documented how this feature should be used.
  • Does this change add any new dependencies? No
  • Does this change require any other modifications to be made to the repository? No
  • Could this change impact execution of existing code? I don't think so
  • Large pull requests should be avoided. If this PR is large (more than 1,000 lines of codes), please provide short explanation why your contribution can't be decoupled in smaller PRs. It is a small PR.

Interested parties

Tag (@ mention) interested parties or, if unsure, @VIVO-project/vivo-committers

Merge request reports