We've used the OpenStack i18n team in the past, which relies on Zanata [1].  I don't think that's the best solution here since Zanata is being deprecated.  But it's worth reaching out to the i18n team to see if they're willing to provide some details about what they're looking for next.

That said, agreed a React plugin is probably the best way to go.  I haven't used it yet, but since Zuul just moved to Gatsby, another one we could look at is https://www.npmjs.com/package/gatsby-plugin-i18n

Curious to hear what your experience is as we run a number of Gatsby sites for the OSF.  If there is any assitance we can provide, please don't hesitate :)

Cheers,
Jimmy

[1] e.g. https://translate.openstack.org/iteration/view/2019-openstack-foundation-annual-report/master?dswid=7023

Matthieu Huin wrote on 6/22/20 10:40 AM:
Hello,

Here is a WIP patch that aims to add support for translating Zuul's web UI: https://review.opendev.org/737290 . After trying unsuccessfully to work with react-i18next [0] as it seems to be the most popular i18n library for react,
I've had more success with react-redux-i18n [1] (i18next didn't seem to play nice with some redux things).
This choice of library, however, is not perfect:
Pros:
- relatively painless integration with zuul-web's existing code
Cons:
- no new commit on the library in 2 years
- All the translations are loaded in the store as the web app is initially loaded in the browser. There aren't many text strings to localize, but as more languages get supported, this might mean a lot of potentially useless data will have to be downloaded in the browser. (OTOH react-i18next can load the right locale when needed)

If there any better choices of library and/or implementation, please let me know through reviews. Until then I won't work more on this, as listing the translatable strings is a bit of a chore and I'd rather make sure we're all on agreement about how to do Zuul i18n. Once this is cleared, will come the fun times of nitpicking exact translations of Zuul terms in the language of your choice. :)

Cheers,

[0]: https://react.i18next.com/
[1]: https://github.com/artisavotins/react-redux-i18n
--

Matthieu Huin

Senior Software Developer

Red Hat



_______________________________________________
Zuul-discuss mailing list
Zuul-discuss@lists.zuul-ci.org
http://lists.zuul-ci.org/cgi-bin/mailman/listinfo/zuul-discuss