diff --git a/src/features/components/atoms/link/internal.tsx b/src/features/components/atoms/link/internal.tsx index 4e2eed6e224..2d8f10a9898 100644 --- a/src/features/components/atoms/link/internal.tsx +++ b/src/features/components/atoms/link/internal.tsx @@ -72,7 +72,10 @@ const Internal = ({ if (isBrowser()) { rawLocale = localStorage.getItem('i18n') ?? 'en' } - const locale = rawLocale?.replaceAll('-', '_') + let locale = 'en' + if (typeof rawLocale === 'string') { + locale = rawLocale?.replace(/-/g, '_') + } const { is_default, path } = language_config[locale] const is_non_localized = url.to.includes('careers')