Skip to content

[BUG] Unable to open the customer portal when pt_BR locale is selected for a user #2420

@ansmonjol

Description

@ansmonjol

Describe the bug
Portuguese translations settings breaks the customer portal

To Reproduce
Steps to reproduce the behavior:

  1. Go to a Customer's Detail page > Settings tab
  2. Edit the "Document language" to "Portuguese (Brazil)" and save
  3. Click on "Customer Portal" on top of the page. You're redirected to a new page
  4. See error (Invalid language tag: pt_BR in console)

Expected behavior
I should be able to access the customer portal and see the correct translations.

Additional context
Seems that the issue is due to Frontend formatters relying on libraries not handling the pt_BR locale notation and would expect pt-BR instead.

Ideally, I would love to rename this locale using the dash notation, instead of re-formatting every time we pass the locale to a lib.
Not sure which but IIRC there were a limitation using the dash notation on Backend side.
We could also use the LocaleEnum to "translate" the value, so the key saved on Backend uses the underscore but each time we rely on the value, Frontend uses LocaleEnum.pr_BR which will result using the dash notation as value.
Something like that.

Linear ticket: https://linear.app/getlago/issue/ISSUE-1048/unable-to-open-the-customer-portal-when-pt-br-locale-is-selected-for-a

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions