fix(portal): emit valid BCP 47 html lang attribute (#14680)

Locales are stored with underscores (e.g. pt_BR), but the HTML lang
attribute requires hyphens (pt-BR). Convert via a helper in the public
portal layouts.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
Pranav
2026-06-15 14:34:52 -07:00
committed by GitHub
parent 1713cabdf2
commit dda25c0b51
4 changed files with 28 additions and 2 deletions

View File

@@ -41,6 +41,10 @@ module PortalHelper
language_map[locale] || locale
end
def html_lang_attribute(locale)
locale.to_s.tr('_', '-')
end
def theme_query_string(theme)
theme.present? && theme != 'system' ? "?theme=#{theme}" : ''
end