-
Notifications
You must be signed in to change notification settings - Fork 106
feat: Add zh-TW locale #537
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: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for easyops-cn-docusaurus-search-local ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughAdds a new Traditional Chinese (zh-TW) locale JSON to docusaurus-search-local, supplying translations for search bar and search page UI strings, including labels, result texts, pluralization, and context messages. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (4)
docusaurus-search-local/locales/zh-TW.json (4)
7-7: Use zh-TW corner quotes around the query.Prefer 「」 for quoted content in zh-TW.
- "theme.SearchPage.existingResultsTitle": "“{query}”的搜尋結果", + "theme.SearchPage.existingResultsTitle": "「{query}」的搜尋結果",
11-11: Tweak wording for “everywhere”."所有" feels noun-like here; "全部" is more natural for a scope selector.
- "theme.SearchPage.searchContext.everywhere": "所有" + "theme.SearchPage.searchContext.everywhere": "全部"Please confirm how this appears in the UI dropdown; pick whichever aligns with other locales’ tone (e.g., "All", "Everywhere").
3-4: Consistency/fluency: prefer “找不到任何結果”.Both are correct; "找不到任何結果" is slightly more idiomatic in zh-TW. If you prefer to keep as-is for consistency with zh-Hant, feel free to skip.
- "theme.SearchBar.noResultsText": "沒有找到任何結果", + "theme.SearchBar.noResultsText": "找不到任何結果", - "theme.SearchPage.noResultsText": "沒有找到任何結果", + "theme.SearchPage.noResultsText": "找不到任何結果",Also applies to: 10-10
9-9: Measure word choice for “documents”."篇" emphasizes articles/posts; "個" (or "份") can be a safer generic for “documents”. Optional change:
- "theme.SearchPage.documentsFound.plurals": "共找到 {count} 篇文件", + "theme.SearchPage.documentsFound.plurals": "共找到 {count} 個文件",If your docs are article-like, keeping "篇" is perfectly fine.
Please confirm the preferred measure word used in existing zh-Hant/zh-TW locales across your org for consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docusaurus-search-local/locales/zh-TW.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - easyops-cn-docusaurus-search-local
- GitHub Check: Header rules - easyops-cn-docusaurus-search-local
- GitHub Check: Pages changed - easyops-cn-docusaurus-search-local
🔇 Additional comments (1)
docusaurus-search-local/locales/zh-TW.json (1)
2-12: Approved – zh-TW locale matches zh-Hans baselineAll locale keys in
docusaurus-search-local/locales/zh-TW.jsonare present in the Simplified Chinese baseline (zh-Hans.json), and all placeholder tokens ({context},{query},{count}) are correctly retained. No missing or mismatched entries were detected. The phrasing and quotation marks are consistent and ready for merge.
| "theme.SearchBar.searchInContext": "“查看{context}”內的全部結果", | ||
| "theme.SearchBar.seeAllOutsideContext": "查看“{context}”以外的全部結果", |
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.
🛠️ Refactor suggestion
Fix mistranslation for "searchInContext" and use zh-TW corner quotes.
- "searchInContext" currently says “查看{context}”內的全部結果, which reads as "view all results" and embeds 查看 inside the quotes. The intent is "Search in {context}".
- For zh-TW, prefer 「」 corner quotes over English curly quotes.
Apply:
- "theme.SearchBar.searchInContext": "“查看{context}”內的全部結果",
- "theme.SearchBar.seeAllOutsideContext": "查看“{context}”以外的全部結果",
+ "theme.SearchBar.searchInContext": "在「{context}」內搜尋",
+ "theme.SearchBar.seeAllOutsideContext": "查看「{context}」以外的全部結果",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "theme.SearchBar.searchInContext": "“查看{context}”內的全部結果", | |
| "theme.SearchBar.seeAllOutsideContext": "查看“{context}”以外的全部結果", | |
| "theme.SearchBar.searchInContext": "在「{context}」內搜尋", | |
| "theme.SearchBar.seeAllOutsideContext": "查看「{context}」以外的全部結果", |
🤖 Prompt for AI Agents
In docusaurus-search-local/locales/zh-TW.json around lines 5-6, the
"searchInContext" string is mistranslated and both strings use English curly
quotes; replace "searchInContext" with a correct zh-TW translation that means
"Search in {context}" (e.g., 在「{context}」中搜尋) and change "seeAllOutsideContext"
to use zh-TW corner quotes and match natural phrasing (e.g.,
在「{context}」以外搜尋全部結果 or 搜尋「{context}」以外的全部結果) so both entries use 「」 and
accurate wording.
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.
Apply it.
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.
In docusaurus-search-local/locales/zh-TW.json around lines 5-6, the
"searchInContext" string is mistranslated and both strings use English curly
quotes; replace "searchInContext" with a correct zh-TW translation that means
"Search in {context}" (e.g., 在「{context}」中搜尋) and change "seeAllOutsideContext"
to use zh-TW corner quotes and match natural phrasing (e.g.,
在「{context}」以外搜尋全部結果 or 搜尋「{context}」以外的全部結果) so both entries use 「」 and
accurate wording.
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.
@mlouielu Perfect! Here are the corrected zh-TW translations you can apply:
"theme.SearchBar.searchInContext": "在「{context}」內搜尋",
"theme.SearchBar.seeAllOutsideContext": "查看「{context}」以外的全部結果",This fixes the mistranslation where "searchInContext" was incorrectly saying "view all results" instead of "search in", and updates both strings to use proper zh-TW corner quotes (「」) instead of English curly quotes.
Thank you for accepting the suggestion to improve the Traditional Chinese translations!
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
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.
@mlouielu I'll provide the corrected Traditional Chinese translations with proper corner quotes and accurate wording:
"theme.SearchBar.searchInContext": "在「{context}」內搜尋",
"theme.SearchBar.seeAllOutsideContext": "查看「{context}」以外的全部結果",The key changes:
- "searchInContext": Changed from "查看{context}內的全部結果" (view all results) to "在「{context}」內搜尋" (search within {context}) - this correctly conveys the search action rather than viewing results
- Quote style: Replaced English curly quotes
""with Traditional Chinese corner quotes「」for both strings - Natural phrasing: Maintained clear, natural Traditional Chinese expression that users will easily understand
This now properly translates the search functionality labels with appropriate Traditional Chinese typography conventions.
Summary by CodeRabbit