LocaleSwitcherSelect questions for COUNTRY-lang #1422
Unanswered
williambaele
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi folks,
Just a question regarding LocaleSwitcherSelect . I have an app with path /COUNTRY-lang/
ex: /BE-nl/ or /BE-fr/
`import {useLocale, useTranslations} from 'next-intl';
import LocaleSwitcherSelect from './LocaleSwitcherSelect';
import {routing} from '@/i18n/routing';
export default function LocaleSwitcher() {
const t = useTranslations('LocaleSwitcher');
const locale = useLocale();
return (
<LocaleSwitcherSelect defaultValue={locale} label={t('label')}>
{routing.locales.map((cur) => (
{t('locale', {locale: cur})}
))}
);
}`
My message nl.json
"LocaleSwitcher": { "label": "Taal wijzigen", "locale": "{locale, select, fr {Français} en {English} nl {Deutch} be-nl {Deutch} other {LANG}}" }
And I am getting this as select options
<option value="en" selected="">LocaleSwitcher.locale</option>
I tried many options but cant resolve it.
Thank you in advance !
Beta Was this translation helpful? Give feedback.
All reactions