The new search experience should work everywhere both for users and developers. If users can't use our components, they won't be used. If developers can't reuse our components, they won't be used. To this end, the internationalization strategy for components should work robustly and with as few dependencies on the MediaWiki ecosystem as possible (in production and during development). This task is to identify the options available and their tradeoffs.
This task is focused on identifying an appropriate internationalization project infrastructure. For example, mw.msg(). T249300 focuses on components themselves and is distinct.
Acceptance criteria
- Different Vue.js internationalization options are identified including Santhosh's vue-banana-i18n, Roan's fork, and the standard recommend by Vue School, vue-i18n.
- The tradeoffs for each solution are enumerated herein.
- vue-i18n@8.17.6: 25.2 kB minified / 7.5 kB minified + gzipped
- vue-i18n uses a different localization message syntax. Custom formatting is supported but may not be practical given wiki markup.
- vue-banana-i18n@1.2.1: 39 kB minified / 15.1 kB minified + gzipped
- vue-banana-i18n fully supports MW localization syntax and has no MediaWiki dependencies.
- Supports localizing strings and Vue directives like v-i18n:search_results="[10]". See readme for details.
- Roan's fork
- Implicit dependency on mw.msg().
- Otherwise the same as vue-banana-i18n.
- Component properties
- Pushes internationalization out into the consuming application for the scope of search.
- vue-i18n@8.17.6: 25.2 kB minified / 7.5 kB minified + gzipped
- A decision for the approach to take is made and a task is created.
Open questions
- mw.msg()-based solutions have a dependency on jQuery? Should this be considered an isolated exception to avoiding jQuery usage in shared components? Does this mean i18n support won't be very good outside of MW?
- How is WMDE approaching i18n and is it working well?