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

[i18n] Non-English pages' links redirect to English content #3148

Closed
caipeter888 opened this issue Feb 1, 2025 · 6 comments · Fixed by #3153
Closed

[i18n] Non-English pages' links redirect to English content #3148

caipeter888 opened this issue Feb 1, 2025 · 6 comments · Fixed by #3153
Labels
good first issue Is it good for beginners to take up?

Comments

@caipeter888
Copy link

Description:
On non-English pages (for example, the Chinese version), many hyperlinks are not preserving the locale in their URLs, which results in users being redirected to the English version of the site. This behavior can be confusing for users who expect a fully localized experience.

Steps to Reproduce:

  1. Navigate to a non-English page, for example:
    https://tauri.app/zh-cn/start/prerequisites/#rust
  2. Click on the "创建新项目" (Create New Project) button.
  3. Notice that the button links to https://tauri.app/start/create-project/ instead of the localized URL https://tauri.app/zh-cn/start/create-project/.

Expected Behavior:
The "Create New Project" button (and other similar links) on non-English pages should link to the corresponding localized pages. For instance, on the Chinese page, the URL should be https://tauri.app/zh-cn/start/create-project/.

Actual Behavior:
The links currently redirect to the English version of the pages, causing inconsistency in user experience.

@vasfvitor vasfvitor added the good first issue Is it good for beginners to take up? label Feb 1, 2025
@Fanceir
Copy link

Fanceir commented Feb 3, 2025

@vasfvitor Hi, I’m currently investigating this issue and have identified the root cause (MDX links are not dynamically prefixed with the locale). I plan to implement a Markdown plugin to resolve this, which will also make it easier to support other languages in the future.

@vasfvitor
Copy link
Contributor

vasfvitor commented Feb 3, 2025

@Fanceir I'm unsure this is needed, at first I thought it was due simply because the links are prefixed, isn't it? Like we can statically prefix with the correct locale at the page where the link is located.

Keep in mind that some links does not have i18n planned, for example the blog and api/references pages.

What was you planning for this plugin to do?

Edit: found out that it's best to prefix /blog and /api pages to keep the locale on the url

@Fanceir
Copy link

Fanceir commented Feb 3, 2025

Hi @vasfvitor , thanks for your reply.

You make a good point that we could handle the localized link at the page where the link is located., rather than implementing a more complex Markdown plugin solution. That could be a simpler and more direct approach in many cases.

The reason I was considering a Markdown plugin is that it would provide a way to handle localization of links.
You're right that this may not be necessary for all links, especially ones that don't have planned i18n support, like the blog and API/reference pages.

@vasfvitor
Copy link
Contributor

@Fanceir if you don't mind I think I'm fix it by myself, or do you want to do it?

@Fanceir
Copy link

Fanceir commented Feb 3, 2025

@vasfvitor I don't mind at all, feel free to go ahead and fix it. 😊

@vasfvitor
Copy link
Contributor

@caipeter888 it should now be fixed, thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Is it good for beginners to take up?
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants