Calipseo is FAO web- based platform for national Fisheries Authorities to streamline management of fisheries data and the production, analysis and reporting of fishery statistics.
1
stars
0
forks
source link
[CALR-32] i18n multi-lingual support - base skeleton for i18 app labels #32
Issue migrated from JIRA: https://sdlc.review.fao.org/jira/browse/CALR-32
Creator/Reporter: Emmanuel Blondel @eblondel
Assignee: Emmanuel Blondel @eblondel
Priority: Medium
Status: Done
Date of creation: 2021-11-29T09:30:39.000+0000
This ticket does target only LOCAL i18n terms (managed at Shiny App level) and does'nt target:
the retrieval of i18n terms from the Openfismis table i18n fields (tackled later)
the retrieval of i18n terms from the Calipseo plateform (tackled later when Calipseo Open API will be available)
the dynamic set-up of the app language from URL param (tackled later)
The base skeleton to enable local i18n labels to the app follows the modular approach done for R codes. Each module should comes with JSON files with the following naming convention:
_i18n_.json
eg. home_i18n_en.json, home_i18n_fr.json
These files have to be put in the _modules_ directory.
The running language for the shiny app is specified in the shiny config with the _language_ property. If not available the shiny app will set it to 'en' (English).
Each i18n text term should be defined in the JSON files (same order for each language file), with a meaningful key that should be unique whatever the module considered. As good practice, each key will be set as UPPERCASE, and prefixed with the module name.
eg. HOME_CALIPSEO_TITLE, HOME_CALIPSEO_SUBTITLE, VESSEL_INFO_TITLE, etc
To set-up a text label in the app, it should call the function `i18n` taking as argument the key name.
eg.
{code:java}
i18n("HOME_CALIPSEO_TITLE")
{code}
A missing key will be easily identified in the UI as red highlighting the key eg. {color:#ff0000}{color}.
This ticket does target only LOCAL i18n terms (managed at Shiny App level) and does'nt target:
The base skeleton to enable local i18n labels to the app follows the modular approach done for R codes. Each module should comes with JSON files with the following naming convention: