Skip to content

Link directly to equivalent pages in translations #1105

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

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

skirtles-code
Copy link
Contributor

@Jinjiang @veaba @kazupon @naokie @narusas @ChangJoo-Park @Alex-Sokolov This will impact the translations, so could I get any feedback you might have?

Related issues: #1080, #932.

In the Vue 2 documentation, links to the translations have the same path as the current page. This PR attempts to recreate that for Vue 3.

The translations will never be in perfect sync with this repo, so when pages are added, moved or removed they will hit a 404. My proposed strategy for handling that is:

  • Remove the noreferrer attribute from these links so that the 404 page can tell where the user came from.
  • If the user came from an alternative translation, show a longer message on the 404 page that attempts to explain why that might have happened.

The 404 page previously showed one of 4 different messages. That doesn't work well with SSR, so I've removed that functionality. My proposed English version would now look like this:

404 page

The paragraph about translations is only shown if document.referrer matches a known translation.

I've changed the link for the Russian translation to include the /ru in the path. That is required to link to the correct pages.

@skirtles-code
Copy link
Contributor Author

The reactions I've had from the translators seem positive, so I'm going to move this PR out of draft, ready to merge. Thanks all.

@skirtles-code skirtles-code marked this pull request as ready for review July 2, 2021 02:52
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