-
Notifications
You must be signed in to change notification settings - Fork 12
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
base: main
Are you sure you want to change the base?
feat: move translations to singlefile #272
Conversation
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
website/src/translations.tsx
Outdated
There was a problem hiding this comment.
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.
…/typst-jp.github.io into translation-in-single-file
Thank you for your work. I’ll review it later. |
Related to #233
Sorry if there are mistakes :/