-
Notifications
You must be signed in to change notification settings - Fork 13
refactor: 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
refactor: move translations to singlefile #272
Conversation
Co-authored-by: Copilot <[email protected]>
…/typst-jp.github.io into translation-in-single-file
|
Thank you for your work. I’ll review it later. |
d151ba8 to
63274a1
Compare
|
Hi, @YDX-2147483647 |
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.
Good work! I only found minor issues.
In addition to the comments below, there's a Japanese word in CSS .info-box, which is used by some markdown files.
Lines 62 to 63 in 8b03a1c
| .info-box::before { | |
| content: "情報"; |
Perhaps it could be changed to emoji? Say, 💡.
(Note that some texts are generated by typst-docs and the SSG can do nothing. If translation is really to be supported, we need to submit a similar PR to the upstream typst/typst.)
Co-authored-by: Y.D.X. <[email protected]>
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.
Approved! 🚀
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 consolidates all translation strings into a single file (translation.tsx) to centralize translation management for the Japanese documentation website. The refactoring moves hardcoded Japanese text from various components into a structured translation system.
- Centralized translation management by creating a single translation file
- Replaced hardcoded Japanese strings throughout components with Translation components
- Standardized icon accessibility by removing title elements and adding role attributes
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
website/src/translation.tsx |
Added comprehensive translation dictionary and Translation component with all Japanese strings |
website/src/globals.css |
Updated info box content from "情報" to "💡" emoji |
website/src/components/ui/common/TranslationStatusAlert.tsx |
Refactored to use Translation components instead of hardcoded strings |
website/src/components/ui/common/TableOfContents.tsx |
Replaced hardcoded "目次" with Translation component |
website/src/components/ui/common/SiteTitle.tsx |
Updated to use Translation components for document and language version labels |
website/src/components/ui/common/SiteNoticeBanner.tsx |
Replaced lengthy hardcoded banner text with Translation component |
website/src/components/ui/common/SearchWindow.tsx |
Updated search title and aria-label to use Translation |
website/src/components/ui/common/Header.tsx |
Replaced hardcoded text with Translation components throughout header |
website/src/components/ui/Tooltip.tsx |
Converted tooltip content and labels to use Translation system |
website/src/components/ui/FunctionParameters.tsx |
Updated parameter labels to use Translation components |
website/src/components/ui/FunctionDisplay.tsx |
Replaced "例を表示" with Translation component |
website/src/components/templates/*.tsx |
Updated all template files to use Translation components |
website/src/components/templates/BaseTemplate.tsx |
Comprehensive conversion to Translation system including page titles and navigation |
website/src/components/icons/*.tsx |
Removed Japanese title elements and added role="graphics-symbol" for accessibility |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Related to https://github.com/typst-jp/typst-jp.github.io/issues/233
Sorry if there are mistakes :/