-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add i18n internationalization support #21
Comments
Regarding internalization for forms, we can do translations for different schemas like study_fi.json / study_sv.json with titles and descriptions for each field. Then on frontend |
For form errors we should use https://github.com/ajv-validator/ajv-i18n. It doesn't (currently) have finnish translations, so they should be probably created by csc |
we need to be able to remember the language selection in the route (url) |
About translating forms I see at least two options:
|
option 1 sounds ok, however is there an option that we can also have them in front-end as assets? e.g. in another project we store them as: https://github.com/CSCfi/swift-browser-ui/blob/master/swift_browser_ui_frontend/src/common/lang.js or this is equivalent with option 2? |
This is basically equivalent. We'd need to traverse original schema and return a schema with matching translations from assets. This action don't benefit from i18next library. One another option could be translating fields on the fly with i18next library but I think it is a bad idea since form might re-render on different occasions causing unnecessary load on client. Workload wise I think the option shouldn't matter much. Only concern is frontend performance |
ok, i will add something for that in backend |
Description
Add internationalization support using https://react.i18next.com/ (or similar) for Finnish and English.
DoD (Definition of Done)
UI is able to switch between language seamlessly.
There is a dropdown that allows language switching in the menu bar
Testing
Peer review (for now)
The text was updated successfully, but these errors were encountered: