-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
New beta localised pathnames feedback/possible bug report #481
Comments
Thank you for trying out the new pathnames localization and reporting your initial findings! The pathnames are designed to support internal pathnames that are different from the default locale, so this should work in theory. Can you share your exact configuration and the requests which don't seem to work for you? There's quite an extensive test suite for the feature, if you feel like it, you can also directly submit a failing test case:
There are test cases for these (also in
That should be fine! |
I will make sure to try and take a look at the codebase/tests and reproduce there, I might be also using it wrong and have already worked my way around some things. Btw it's working wonderfully for translating MDX based content too just having several files/folders for each locale. with contentlayer (using taxonomy/shadcn as base for it) So I can translate pages, docs, guides, and it's pathnames too ;) For example to whitelist all i18n pathnames with next-auth I do it like this:
so it also gets the translations of whitelisted key public pages. Then for the latest point and being able to link to the translated path I require it when building the links and call it with current locale for the path I need like this:
Which returns the fully localised path like /es/terminos or /en/terms or whatever. So far have been a really smooth experience to set up so thank you for this! |
Super cool, that's a nice use case!
That should be automatically handled by the new localized navigation APIs with something like this: import { Link } from "@/navigation"
...
<Link href="/terms">
That's so nice to hear! 🙌 I'll add the reproduction missing label for now. I've just added a new "App Router (RSC beta)" issue reproduction template, please feel free to submit a reproduction in case you're experiencing something that doesn't behave as intended! |
Thank you for your report. Unfortunately, the reproduction is missing or incomplete, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically. Templates: Creating a good bug report takes time. To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you. Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:
Thank you for your understanding! FAQ"I've included a reproduction, what is missing?" This comment might have been added because your reproduction doesn't point to either a CodeSandbox or a public GitHub repository where the issue can be reproduced. Please make sure:
|
This issue has been automatically closed because it is missing a reproduction and there hasn't been any activity for 7 days. If the problem persists, please create a new bug report. |
Is your feature request related to a problem? Please describe.
Hi aman! Impressive work, I would like to report I've been having some trouble where I think the new implementation is assuming defaultLocale is english. I want to use my defaultLocale as another language (spanish) but the routes are not working if they're on the /root so I can make /login -> /cuenta/registro but !!-> /registro with defaultLocale es
I also think the current implementation assumes the name of the default filename/path is in the defaultLocale, but I would like to name my page login.tsx, and have it defaultLocale to /entrar in spanish.
I also think it's a bit wonky anything that's not 'always' in locale-prefix, both never and as-needed don't seem to work on similar cases.
Anyways all workable with work arounds but wanted to report my (findings?) happy to help debug or put up a reproduction repo if that's more useful.
Describe the solution you'd like
Be able to use different defaultLocale than english, and decouple file naming from defaultLocale
Describe alternatives you've considered
Working around using always prefix (I'd rather not use it if Im localising all paths.
Another one is with always I cannot tell in navigation that the base path should not get it, so the hompeage remains .com/ sans locale regardless of the language. Worried about not having anything on the homepage and always redirecting to a locale path being bad for SEO on the long term?
The text was updated successfully, but these errors were encountered: