Skip to content

feat: move translations to singlefile #272

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 11 commits into
base: main
Choose a base branch
from

Conversation

Its-Just-Nans
Copy link
Contributor

@Its-Just-Nans Its-Just-Nans commented Aug 15, 2025

Related to #233

Sorry if there are mistakes :/

@3w36zj6 3w36zj6 requested review from 3w36zj6 and Copilot August 16, 2025 03:29
Copy link
Contributor

@Copilot 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 centralizes Japanese translation strings by creating a single translations file and replacing hardcoded Japanese text throughout the codebase. This improves maintainability and consistency of the localization system.

  • Creates a centralized menuTranslations object containing all Japanese translation strings
  • Replaces hardcoded Japanese strings across components and templates with references to the translation object
  • Updates icon components to use translated accessibility labels

Reviewed Changes

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

Show a summary per file
File Description
website/src/translations.tsx Creates centralized translation object with all Japanese strings
website/src/components/ui/common/TranslationStatusAlert.tsx Replaces hardcoded status messages with translation references
website/src/components/ui/common/TableOfContents.tsx Updates table of contents title to use translations
website/src/components/ui/common/SiteTitle.tsx Updates site title components and fixes href to root
website/src/components/ui/common/SiteNoticeBanner.tsx Replaces banner text with translation references
website/src/components/ui/common/SearchWindow.tsx Updates search window labels with translations
website/src/components/ui/common/Header.tsx Replaces header text and aria labels with translations
website/src/components/ui/Tooltip.tsx Updates tooltip content with translation references
website/src/components/ui/FunctionParameters.tsx Replaces parameter-related text with translations
website/src/components/ui/FunctionDisplay.tsx Updates function display text with translations
website/src/components/templates/*.tsx Updates template text with translation references
website/src/components/icons/*.tsx Updates icon accessibility titles with translations

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

Copy link
Member

Choose a reason for hiding this comment

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

I think managing translations in TSX is a good approach.

Please take a look at the proposal in #233 (comment). With simple templates, it is difficult to handle different word orders properly. So how about setting a pure function that returns TSX as the value? With this method, translators can freely markup the content in any word order they need.

And, it is preferable that each individual phrase is managed as a single key-value pair, rather than splitting into smaller strings.

@Its-Just-Nans Its-Just-Nans requested a review from 3w36zj6 August 17, 2025 00:48
@3w36zj6
Copy link
Member

3w36zj6 commented Aug 17, 2025

Thank you for your work. I’ll review it later.

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