plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
457 stars 616 forks source link

Multilingual support does not work with country-specific language codes (pt_BR) #2413

Closed ericof closed 3 years ago

ericof commented 3 years ago

Describe the bug Plone, historically, used the country-specific language codes in the format pt-br (plone.app.multilingual, GenericSetup), but the translations in plone.app.locales and in Volto use the format pt_BR.

In Volto, adding the following configuration to config.js will break API calls to Plone (even if plone.app.multilingual is correctly configured to both languages)

    isMultilingual: true,
    supportedLanguages: ['pt_BR', 'en'],
    defaultLanguage: 'pt_BR',

Trying to rename the Volto locale to pt-br will break the LanguageSelector component and intl-locales-supported,

To Reproduce Steps to reproduce the behavior:

  1. On the Plone server configure p.a.multilingual to use pt-br and en as languages (pt-br as default)
  2. Create a new Volto package
  3. Configure
  4. Modify config.js and include the settings isMultilingual: true, supportedLanguages: ['pt_BR', 'en'],, defaultLanguage: 'pt_BR',
  5. Start Volto
  6. Access the Volto site

Expected behavior Calls to the Plone server would be successful

Software (please complete the following information):

ericof commented 3 years ago

Implemented in #2415