Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix supported languages and i18N cookie #6761

Closed
wants to merge 7 commits into from

Conversation

dobri1408
Copy link
Contributor

I've identified a logical bug in Volto related to language settings.

Currently, we define supported languages using config.settings.supportedLanguages. For example, in the case of EEA, this is set as:

config.settings.supportedLanguages = ['en'];

This configuration implies that all website resources such as taxonomies should be available only in English.

However, if a editor sets a page’s content to Italian (e.g., for just one page), Volto updates the i18N cookie accordingly. As a result, it attempts to fetch Italian taxonomies, which do not exist since our configuration explicitly supports only English. This behavior is incorrect because Volto should respect the predefined language settings and not attempt to request unsupported taxonomies.

To fix this, I propose modifying how supported languages are set in server.jsx. Instead of using hardcoded values from Volto core (Languages.cjs), we should dynamically check and apply only the explicitly supported languages defined in the configuration.

Let me know your thoughts on this approach!
screen-capture (28).webm

Copy link

netlify bot commented Feb 18, 2025

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 3c1f953
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/67b5a9a932718e000883f2c4

@dobri1408 dobri1408 changed the title Fix supported languages Fix supported languages and i18N cookie Feb 18, 2025
@dobri1408 dobri1408 closed this Feb 19, 2025
@dobri1408 dobri1408 deleted the fix-supported-languages branch February 20, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant