chatwoot / chatwoot

Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬
https://www.chatwoot.com/help-center
Other
20.52k stars 3.37k forks source link

Help Center: I18n::InvalidLocale ("nb" is not a valid locale) #9271

Open KonstantinReido opened 5 months ago

KonstantinReido commented 5 months ago

Describe the bug

I18n::InvalidLocale ("nb" is not a valid locale):
app/controllers/public/api/v1/portals/base_controller.rb:53:in `switch_locale_with_article'
app/controllers/public/api/v1/portals/base_controller.rb:24:in `set_locale'

On the UI (Help Center > Settings > Locales > Add locale), you provide the option to select several dialects of the Norwegian language, but your code doesn't recognize them.

Screenshot 2024-04-22 at 13 08 03

You set available locales here. And as result I18n.available_locales returns the next list: [:en, :ar, :nl, :fr, :de, :it, :ja, :ko, :pt, :ru, :es, :ml, :ca, :el, :pt_BR, :ro, :ta, :fa, :zh_TW, :vi, :da, :tr, :cs, :fi, :id, :sv, :hu, :no, :zh_CN, :pl, :sk, :uk, :th, :lv, :is, :he, :lt, :sr], so Rails do not accept codes from the screenshot.

To Reproduce

1) Set the locale for a portal to nb 2) Create an article 3) Try to preview it

Expected behavior

No response

Environment

Heroku

Cloud Provider

None

Platform

Browser

Operating system

No response

Browser and version

No response

Docker (if applicable)

No response

Additional context

No response

linear[bot] commented 5 months ago

PR-1046 Help Center: I18n::InvalidLocale ("nb" is not a valid locale)