Open erral opened 10 months ago
@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