Adding multilingualism to the Kotahi admin panel
[Template for Request for Comments (RFC) on Function Suggestions]
RFC: Feature Proposal: Adding multilingualism to the Kotahi admin panel
Context.
This feature solves the problem of using the product globally. For example, right now we cannot fully use the platform in CIS countries because of the language barrier. If this feature will be launched, every developer will be able to add his own language file and make the platform more accessible in his country in a few moments.
Suggestion.
Add i18next library, add language files with translation and use t variables in all components, for example: {t('hello')}
Thanks to i18next the whole application can be translated with 1 function: i18n.changeLanguage("en")
more: https://docs.google.com/document/d/1rbnAf500KpUVTv3DKm1fpsQv4j-grkrQ3t_ugOfGnB8/edit
Design
In file: https://docs.google.com/document/d/1rbnAf500KpUVTv3DKm1fpsQv4j-grkrQ3t_ugOfGnB8/edit
Implementation (if applicable)
- Add a language selection component to the left side menu (Russian and English for now)
- To translate, use i18next plug the library into the app/app.js file add the file with i18next settings to the root of the app/ folder
- add the folder with the translation to the root of the app Contents of the index.js file in the i18 folder Contents of the translation.js file in the i18/en folder
4)The const { t, i18n } = useTranslation() will be connected to react components; The following variables {t('hello')} will be used in static text in react components
Alternative approaches (if applicable)
Open questions (if applicable)
It might be a good idea to configure languages via the config folder, but I am not sure how to do it properly. I would be glad to hear any tips.