You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are navigating https://example.com/en/foo/bar and have another language es configured, the language selector would link to https://example.com/es/foo/bar.
This is fine as long as /es/foo/bar exists. But this does not need to be always the case. Even with complete translations, there are some pages that are localized and only make sense in certain languages.
For those cases, the language selector should link to the first parent directory that exists (i.e.: /es/foo/ or /es/).
Reproduction
Create a project with internationalization and have one page available in one language (/en/), but not available in another language (/es/). Visit the English version and, from the drop-down language selector, the /es/ page would be linked for the Spanish version of the site, even if that page does not exist.
Expected behavior
The language selector should not link to pages that do not exist. For those cases, it could use the first existing parent or just link to the top-level language URL (i.e: /es/).
### Additional context
_No response_
### Validations
- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).
- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
- [X] Read the [docs](https://vitepress.dev).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
The text was updated successfully, but these errors were encountered:
Describe the bug
If you are navigating
https://example.com/en/foo/bar
and have another languagees
configured, the language selector would link tohttps://example.com/es/foo/bar
.This is fine as long as
/es/foo/bar
exists. But this does not need to be always the case. Even with complete translations, there are some pages that are localized and only make sense in certain languages.For those cases, the language selector should link to the first parent directory that exists (i.e.:
/es/foo/
or/es/
).Reproduction
Create a project with internationalization and have one page available in one language (
/en/
), but not available in another language (/es/
). Visit the English version and, from the drop-down language selector, the/es/
page would be linked for the Spanish version of the site, even if that page does not exist.Expected behavior
The language selector should not link to pages that do not exist. For those cases, it could use the first existing parent or just link to the top-level language URL (i.e:
/es/
).System Info
The text was updated successfully, but these errors were encountered: