Skip to content

Add i18n toggle button (en & zh-hans) #400

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xiaoyu2er
Copy link

In this PR, we add translate redirect ability.

  • add a translate button at the logo sections (app/routes/_libraries/route.tsx &app/components/DocsLayout.tsx)
  • add i18n meta links

The current translate button supports two languages: english (https://tanstack.com/) & zh-Hans (https://zh-hans.tanstack.dev/)

Here are some screenshots:

image Google Chrome 2025-05-07 16 33 33 image image

Copy link

netlify bot commented May 7, 2025

👷 Deploy request for tanstack pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c1f983e

@@ -32,6 +32,7 @@
"@sentry/react": "^8.35.0",
"@sentry/vite-plugin": "^2.22.6",
"@tailwindcss/typography": "^0.5.13",
"@tanstack-dev/components": "^1.4.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it would be a good idea to install a 3rd party dependency like this. This component should just live in this codebase.

@KevinVandy
Copy link
Member

How do the translations work? Where do they come from? Where do they live?

@KevinVandy
Copy link
Member

I see that this PR is actually suggesting to redirect to a translated mirror on tanstack.com. While the effort is appreciated, and we do want to offer the tanstack docs in other languages, I think we need to figure out a way to do an AI translate in our build pipelines in a way in which is not too expensive. Otherwise, our ever evolving docs will get out of date in the mirrors. I almost think that it's more important for docs to be up to date than translated, as there are already browser tools that can translate our real most up to date docs, at least.

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