-
I saw #658, #979, #662, #987 and I still can't win this issue. I don't have a dedicated repo/plunker/etc for reproducing, but I have short instructions on how to get one:
Any hints what do I miss? routing.ts
lw-en.test (and pretty much the same for 'de')
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It turns out explicit setting of |
Beta Was this translation helpful? Give feedback.
-
hey @amannn, I am sorry to bother you again, but I tried to use something else except https://next-intl.dev/docs/routing/navigation#userouter 'use client';
import {useLocale, useTranslations} from 'next-intl';
import {Link, useRouter, redirect} from '@/i18n/navigation';
export default function LocaleSwitcher() {
// const t = useTranslations('LocaleSwitcher');
const router = useRouter();
const locale = useLocale();
const otherLocale = locale === 'en' ? 'de' : 'en';
const go = (otherLocale: string) => {
console.log('go', otherLocale);
// router.replace('/', { locale: otherLocale });
// router.push('/', { locale: otherLocale });
redirect({href: '/', locale: otherLocale });
};
return (
// <Link href="/" locale={otherLocale}>
// {t('switchLocale', {locale: otherLocale})}
// </Link>
<button onClick={() => go(otherLocale)}>
{/* {t('switchLocale', {locale: otherLocale})} */}
switch Locale
</button>
);
} |
Beta Was this translation helpful? Give feedback.
It turns out explicit setting of
x-forwarded-proto
in nginx config helps. As for value I went with$server_port
. but it may not work for you (depends on your setup)