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
Add support for partially translated routes #990
Comments
After finally digging into alternate links, it does indeed do what I thought it would: every path gets an alternate link for each locale. This is problematic in our case, because like I mentioned, some pages (like However, instead of going for my previous solution, which was to disable I also came up with a It's still in development though, so it hasn't been thoroughly tested yet, but if it ends up working well, I'll probably share how I've done it, in case other people are in a similar situation. |
This issue has been automatically closed because there was no recent activity and it was marked as unconfirmed. Note that issues are regularly checked and if they remain in unconfirmed state, they might miss information required to be actionable or are potentially out-of-scope. If you'd like to discuss this topic further, feel free to open a discussion instead. |
The same issue has been discussed in #1009 and #955. A potential solution is discussed in #1009 (reply in thread). In case someone is interested in implementing this, I'd be happy to review a PR! |
Is your feature request related to a problem? Please describe.
We support 6 languages on our website:
en
,fr
,es
,pt
,ja
andru
. All pages are initially written in english, but not always in all of the other languages. This puts us in the following use-cases:All of these are not blockers though, since there are workarounds to all of them. It's just repetitive to have to apply those workarounds every time we encounter one of those situations.
Describe the solution you'd like
It would be nice for
next-intl
to provide ways of working with partially translated pages:Link
created withcreateLocalizedPathnamesNavigation
orcreateSharedPathnamesNavigation
, this could potentially be achieved with a prop likeavailableLocales
. Alternatively, forcreateSharedPathnamesNavigation
, it could use thepathnames
to know if the page is translated (only when the languages are specified)pathnames
passed tocreateLocalizedPathnamesNavigation
, this could be achieved by allowing only some languages to be specified.pathnames
of the middleware configuration could hint to which links are available in which locale."/blog": "/blog"
would mean it is available in all languages, while the following would mean it is available only inen
,fr
andes
:Describe alternatives you've considered
Link
There are 2 alternatives. Either use conditional rendering:
or make a wrapper component that encapsulate the above logic:
Pathnames
The solution is just to provide an arbitrary path (usually the
en
one)Alternate links
Again, we haven't looked into this yet, but prior to integrating
next-intl
, we were handling i18n manually (using the documented way by NextJS, which doesn't require any 3rd party lib). So the alternative would be to just turn off alternates fromnext-intl
and create them by ourselves: (this isn't exactly how it's implemented, we have a couple helpers we built to help us, but that's the general idea of what's being done):I've also seen the docs has a FAQ answer on customizing your own alternate links, but it's unclear at this time if this would suit us (since we haven't looked into it too far yet! 😛)
The text was updated successfully, but these errors were encountered: