Mikel Larreategi: Multilingual Plone & Volto
Talk by Mikel Larreategi at the Plone conference 2024 in Brasilia.
Link to talk information on Plone conference website.
In our region we have Basque, Spanish and French as languages, with different official rights. So a multilingual approach is important.
Basic options that you have in Plone are to set a default language and other available languages. then you get a language switcher at the top of the page to choose the language of the UI. This is useful when you have basic needs.
You can also activate the multilingual add-on. This gives more options for multilingual content. For each language, a folder is created automatically and the user interface is shown in the language of that folder. This is useful when you have most content in the main language and then have secondary languages.
You can force using an admin language for the UI using the https://github.com/miohtama/silvuple add-on.
You can also choose real multilingual content: link all translations, for example go to a Spanish news item, select Basque as language, and you are redirected to the Basque version of this same news item.
Of course an editor needs to create the translations of those pages. In the toolbar (Classic UI) are extra options for adding a translation or linking existing content as a translation. When editing, you can use the "babel view" to see the original language on the left and the editable language on the right.
The translated pages are not special items: a translated news item is still a news item, not something special. You can move it, rename it, workflow it, etc.
You can link to the same content in all languages: there is a multilingual link that is shown in the toolbar. In the html head of the page, there are links to the other languages. This is useful for search engines.
If as a visitor you go to a Plone multilingual site for the first time, Plone accesses the language-switcher view. This looks at the Accept-Language header, at an I18N_LANGUAGE cookie, or falls back to the default language.
There are some glitches and problems for SEO. Language change urls are not direct. Sometimes Plone keeps showing a `?set_language=XX` parameter in the url, leading to duplicately indexed content.
How about Volto? You need to configure the backend as you would do in Classic UI. In the Volto config you need to add some settings, like `isMultilingual = true`.
Can we use automatic translation? Yes, there is an integration with Google Translate. You need to get an API key for that from Google, then it is available in the babel translate view. And in Volto? You can use ecityclic.google_translate.
This can work for Spanish, but in Basque the automatic translations are not so good. There are some external services you could use. We made a pull request to improve this.
There is an add-on with which you can force an admin language in case you deal with some languages that you really can't read: https://github.com/miohtama/silvuple or its update for more recent Plone versions: https://github.com/codesyntax/cs.adminlanguage