Implement i18n in Ramp components
Description
As a part of adding i18n support in Ramp (#184), any text hard-coded within the components' code and the parser code need to be translated into other languages as desired. To implement this, react-i18next library can be used. It is developed by i18next an internationalization framework written for JavaScript.
Mirador uses the same library with the ability to add new languages using configs.
This implementation impacts all the components with text hard-coded in them and the error messages the parser sets. As a first step we could implement support for a couple of languages using react-i18next, and then look into adding support for adding new languages in the future.
To set the language in the components; implement a language prop in the IIIFPlayer component, which wraps all the other components. This can be used by applications to specify the language when using Ramp in their application.
In demo site; implement a menu to set the language in the UI, which can be used for the language prop in the IIIFPlayer component.
Language selection in other viewers: Both UV and Mirador has a language selection option where it gives a specific set of languages a user can select from. These language choices are fixed and not affected by the languages in a given Manifest. Example from UV: Private Zenhub Image
Done Looks Like
- [ ] Choose which languages to be supported
- [ ] All text hard-coded in the code are included in the translation config for the
react-i18nextlibrary - [ ]
languageprop is implemented atIIIFPlayercomponent - [ ] A language selection menu is available in the demo site
Probably should break this into 3 issues: one for replacing hard-coded text with translations pulled from config, one for creating the translation files with text, and one for adding a language prop and ability for user to select language.