Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page Reload when Switch Language #1716

Closed
3 tasks done
lqscrisp7 opened this issue Feb 14, 2025 · 1 comment
Closed
3 tasks done

Page Reload when Switch Language #1716

lqscrisp7 opened this issue Feb 14, 2025 · 1 comment
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@lqscrisp7
Copy link

Description

import { Link, usePathname, useRouter } from "../../../i18n/routing";

export const routing = defineRouting({
locales: regionLanguage == 'th' || regionLanguage == 'vn' ? ['en', 'th', 'vn', 'zh'] : [regionLanguage ?? 'en'],
defaultLocale: regionLanguage ?? 'en',
localeDetection: false
});

export const { Link, usePathname, useRouter } = createNavigation(routing);

router.replace(urlPath, { locale: locale, scroll: false })

why when i change language, my entire page will reload, my url will change from xxxx/th to xxxx/zh and perform full page reload? how can I avoid this?

Verifications

Mandatory reproduction URL

app router next14

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. Click on …
  3. See error: …

Expected behaviour

wont reload page when change language

@lqscrisp7 lqscrisp7 added bug Something isn't working unconfirmed Needs triage. labels Feb 14, 2025
@amannn
Copy link
Owner

amannn commented Feb 14, 2025

Duplicate of #723

@amannn amannn closed this as completed Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants