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

intl: support language prefixes for all URLs #141

Merged
merged 2 commits into from
Nov 9, 2023
Merged

intl: support language prefixes for all URLs #141

merged 2 commits into from
Nov 9, 2023

Conversation

zbycz
Copy link
Owner

@zbycz zbycz commented Mar 19, 2023

When no prefix is detected, the app is used as before (cookie or accept). It leverages the nextjs's default locale called default.

When prefix is detected, it forces the selected language and sets cookie.


This could

  • help Google to discover other language versions
  • and also users could use it link specific version like osmapp.org/cs/node/123 (not that useful)

Alternative urls:

  • osmapp.org/cs/node/123
  • osmapp.org/node/123/en
  • osmapp.org/node/123?lang=cs
  • cs.osmapp.org/node/123 <- not sure how to do on vercel

Questions:

  • no prefix = english OR autodetect?
  • use prefix/query only as setter&remove OR leave it in app consistently

@vercel
Copy link

vercel bot commented Mar 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
osmapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2023 7:40pm

@Flohhhhh
Copy link
Contributor

Flohhhhh commented Jun 8, 2023

https://nextjs.org/docs/pages/building-your-application/routing/internationalization

@zbycz zbycz marked this pull request as ready for review November 9, 2023 19:43
@zbycz zbycz changed the title Real links in LangSwitcher.tsx intl: support language prefixes for all URLs Nov 9, 2023
@zbycz zbycz merged commit db0d83d into master Nov 9, 2023
2 checks passed
@zbycz zbycz deleted the lang-links branch November 9, 2023 19:46
@zbycz zbycz mentioned this pull request Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants