Currently language strings are installed by the gawati-lang-packs application, the startup scripts copy all the lang strings into public/locales and the application picks it up from there.
The problem with this approach is, if we need to customize a string in a particular installation there is no way to do it other than change the string for the key in public/locales for one or more languages. While this may work - it is not very practical because the strings will get overwritten the next time we build or start the application, and secondly it will get overwritten if gawati-lang-packs gets updated.
A more practical approach is to have a way to override some strings using a 2nd translations file. i18next allows having multiple namespaces for language strings. So the idea is to have this custom namespace in the themes folder with the same folder structure locales/<lang(s)> and merge this into public/locales during startup .. so effectively public/locales will have translations.json and custom.json ... with the custom.json having higher priority ... so effectively any strings in custom.json override the ones in translation.json.
Currently language strings are installed by the
gawati-lang-packs
application, the startup scripts copy all the lang strings intopublic/locales
and the application picks it up from there.The problem with this approach is, if we need to customize a string in a particular installation there is no way to do it other than change the string for the key in
public/locales
for one or more languages. While this may work - it is not very practical because the strings will get overwritten the next time webuild
orstart
the application, and secondly it will get overwritten ifgawati-lang-packs
gets updated.A more practical approach is to have a way to override some strings using a 2nd translations file. i18next allows having multiple namespaces for language strings. So the idea is to have this
custom
namespace in the themes folder with the same folder structurelocales/<lang(s)>
and merge this intopublic/locales
during startup .. so effectivelypublic/locales
will havetranslations.json
andcustom.json
... with thecustom.json
having higher priority ... so effectively any strings in custom.json override the ones in translation.json.