Skip to content

Fix: HomePageLanguageCard Route redirection bug#198

Merged
chaokunyang merged 1 commit into
apache:mainfrom
LofiSu:main
Oct 31, 2024
Merged

Fix: HomePageLanguageCard Route redirection bug#198
chaokunyang merged 1 commit into
apache:mainfrom
LofiSu:main

Conversation

@LofiSu
Copy link
Copy Markdown
Contributor

@LofiSu LofiSu commented Oct 31, 2024

  const locale = navigator.language || "en-US";

  const getLanguageUrl = (language: string) => {
    const baseUrl = locale.startsWith("zh-CN")
      ? "https://fury.apache.org/zh-CN/docs/start/usage/#"
      : "https://fury.apache.org/docs/start/usage/#";
    return `${baseUrl}${language}`;
  };

The previous function is a bit problematic, setting Chinese to default, should be set according to the user's navigator.language

@chaokunyang chaokunyang merged commit 7d97126 into apache:main Oct 31, 2024
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