Skip to content

Conversation

@3w36zj6
Copy link
Member

@3w36zj6 3w36zj6 commented Sep 3, 2025

cf. #233

@3w36zj6 3w36zj6 requested a review from Copilot September 3, 2025 00:46

This comment was marked as outdated.

@3w36zj6 3w36zj6 requested a review from Copilot September 3, 2025 00:48

This comment was marked as outdated.

@3w36zj6
Copy link
Member Author

3w36zj6 commented Sep 3, 2025

Could you please do a quick review? @YDX-2147483647 @Its-Just-Nans

Copy link
Contributor

@YDX-2147483647 YDX-2147483647 left a comment

Choose a reason for hiding this comment

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

  • English are generally longer than Japanese. Therefore, some expressions take too much space and need to be simplified.

  • The translation framework is kinda ad hoc. For example, en-US.tsx is never referenced, so the type checker might neglect it.

  • I've just noticed that the footer is missing in TranslationComponent.

    Translated by{" "}
    <a
    href={githubOrganizationUrl}
    class="text-gray-600 hover:text-gray-800 transition-colors"
    >
    Typst Japanese Community
    </a>

case "langVersion":
return <>English Version</>;
case "translationRate":
return <>Translation rate</>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, English are generally longer than Japanese. To avoid making the layout too tight, I suggest simplifying the expressions.

Perhaps English VersionEnglish and Translation rateTranslated?

Image Image

@3w36zj6 3w36zj6 requested a review from Copilot September 3, 2025 04:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a translation switcher system for the website by refactoring the translation architecture to support multiple languages centrally.

  • Extracts shared translation types and interfaces into a central index file
  • Adds English (en-US) translation alongside existing Japanese (ja-JP) translation
  • Updates all import paths to use the new centralized translation structure

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/src/translation/index.tsx Creates central translation types and exports current language selection
website/src/translation/ja-JP.tsx Refactors to use shared types and updates import paths
website/src/translation/en-US.tsx Adds complete English translation implementation
website/src/components/ui/common/*.tsx Updates import paths to use centralized translation module
website/src/components/ui/*.tsx Updates import paths to use centralized translation module
website/src/components/templates/*.tsx Updates import paths to use centralized translation module

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

case "translated":
return <>Translated</>;
case "translatedMessage":
return <>This page has been translated into English.</>;
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

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

The message 'This page has been translated into English' is misleading for an English translation file. Since this is the English version, it should indicate the page is in English or original content, not that it was translated into English.

Suggested change
return <>This page has been translated into English.</>;
return <>This page is in English.</>;

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

I also find this a bit odd, but in the first place, the original (English) version shouldn’t need to display translation status, nor should it. Since en-US.tsx is just a sample for i18n support, I think it’s fine to leave it as is.

Copy link
Contributor

@YDX-2147483647 YDX-2147483647 left a comment

Choose a reason for hiding this comment

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

Better, but Footer.tsx was not comitted? Was that intentional?

@3w36zj6 3w36zj6 force-pushed the feature/add-translation-switcher branch from 779e3a0 to f44f181 Compare September 3, 2025 06:34
@3w36zj6
Copy link
Member Author

3w36zj6 commented Sep 3, 2025

I accidentally forgot to commit Footer.tsx.

Copy link
Contributor

@YDX-2147483647 YDX-2147483647 left a comment

Choose a reason for hiding this comment

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

Great!

@3w36zj6 3w36zj6 merged commit 529c33d into main Sep 4, 2025
5 checks passed
@3w36zj6 3w36zj6 deleted the feature/add-translation-switcher branch September 4, 2025 05:19
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.

3 participants