Open FalkoFuroro opened 7 months ago
Hi Falko,
Please see the Fundamental branch for the related updated. These changes were made:
Libraries: i18next: https://www.i18next.com/ react-i18next: https://react.i18next.com/
npm install react-i18next i18next
LocaleContext.js
in client/src/services
i18n
initializationt
translation functionsrc/locales
, contains en.json
for now
en.json
file which is the default namespace for the translations as of now. The JSON object has a key called translation
which should include the key-value pairs. A translation can be used by calling the t
function with the argument as t('key')
, or t('key.nested')
for nested keysLocaleContext
is added in App.js as the highest componentLocaleContext
in VirtualLayer.js
and ExperimentUILayer.js
for passing down required functions to child componentssrc/services/constants
index.js
for common constants, components.js
for component IDs
We should find a solution to collect all texts in a file and make them accessible from this file.
This would make text editing much easier, even when translation is needed, for example.