-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Describe the bug
Portuguese translations settings breaks the customer portal
To Reproduce
Steps to reproduce the behavior:
- Go to a Customer's Detail page > Settings tab
- Edit the "Document language" to "Portuguese (Brazil)" and save
- Click on "Customer Portal" on top of the page. You're redirected to a new page
- 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