You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Volto we have 2 places where we need to set the language settings:
In the backend:
Install plone.app.multilingual
Set the default language
Set the available languages
In the front-end configuration:
Set config.settings.isMultilingual = true
Set config.settings.defaultLanguage = 'en'
Set config.settings.availableLanguages = ['en', 'es', 'de']
This is a bit cumbersome, because it should be as easy as just enabling the languages in the backend to be able to have them in the frontend.
Motivation
Reduce the number of possible failure points.
Simplify the configuration.
Imagine a user that wants to have multilingual features in Volto UI as they has in Classic UI. It is not possible without creating a frontend configuration and tweaking it in config.
Assumptions
Proposal & Implementation
Add Plone's language configuration in the @site endpoint
Add a new AsyncPropExtender that queries the list of addons and sets a isMultilingual key in redux to true if plone.app.multilingual is installed in the backend
Modify all uses of Volto language settings to get the value from redux
Deprecate Volto settings for language handling from config (isMultilingual, defaultLanguage, availableLanguages
We currently use Volto language settings in places where we do not have access to the redux store, such as routes or middleware . We may have some difficulties, or perhaps impossibilities to be able to achieve this as proposed; or we may need to change that configuration to something else.
This would be definitely a breaking change.
Participants
Mikel Larreategi
The text was updated successfully, but these errors were encountered:
@erral Would we have to make this language request on each SSR render, or would it be possible to make the call on the Volto server startup and store the AsyncConnect result somewhere?
If we add the languages information to the @site endpoint, we already have an asyncpropsextender that will do the query and store it in redux in SSR.
regarding the isMultilingual setting, I initially thought to add it in the @site endpoint too and have it for free... but then I did it through the @addons endpoint and add a key in the reducer, and also add an asyncpropsextenders to the @addons endpoint. I don't know which option is better or more canonical regarding the REST API definition so I'm open to discuss it.
PLIP (Plone Improvement Proposal)
Responsible Persons
Proposer: Mikel Larreategi
Seconder:
Abstract
When using Volto we have 2 places where we need to set the language settings:
config.settings.isMultilingual = true
config.settings.defaultLanguage = 'en'
config.settings.availableLanguages = ['en', 'es', 'de']
This is a bit cumbersome, because it should be as easy as just enabling the languages in the backend to be able to have them in the frontend.
Motivation
Assumptions
Proposal & Implementation
@site
endpointisMultilingual
key in redux totrue
ifplone.app.multilingual
is installed in the backendisMultilingual
,defaultLanguage
,availableLanguages
Deliverables
Risks
Participants
The text was updated successfully, but these errors were encountered: