Replies: 1 comment
-
|
same problem here |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I Gays! I have a problem!
export const routing = defineRouting({
locales: locales,
defaultLocale: 'en',
localePrefix: {
mode: 'as-needed'
},
localeCookie: false,
});
and language switcher has view
import {useLocale, useTranslations} from 'next-intl';
import {useParams} from 'next/navigation';
import Modal from './Modal';
import {Link, usePathname, useRouter} from '@/i18n/navigation';
import {Locale, localeNames} from '@/i18n/config';
import CloseIcon from '@/assets/svg/clear.svg';
import CheckIcon from '@/assets/svg/check-fill.svg';
type Props = {
isOpenModal: boolean;
setIsOpenModal: (val: boolean) => void;
};
const LanguageModal = ({isOpenModal, setIsOpenModal}: Props) => {
const t = useTranslations('header.language');
const pathname = usePathname();
const params = useParams();
const locale = useLocale();
const router = useRouter();
const switchLocale = (newLocale: Locale) => {
router.replace(
{pathname, params},
{locale: newLocale}
);
};
return (
<Modal isContent isOpen={isOpenModal} onClose={() => setIsOpenModal(false)}>
);
};
export default LanguageModal;
the link switcher rendered width locale href="/en/wallpapers" and href="/ru/%D0%BE%D0%B1%D0%BE%D0%B8"
English
Русский
Beta Was this translation helpful? Give feedback.
All reactions