Skip to content

Conversation

@mlouielu
Copy link

@mlouielu mlouielu commented Aug 26, 2025

Summary by CodeRabbit

  • New Features
    • Added Traditional Chinese (zh-TW) localization for the search experience, covering search bar labels, “see all” links, no-results messages, context toggles, results titles, and document count plurals.
    • Improves usability for zh-TW readers across search bar and results pages; no changes to behavior or APIs for other locales.
    • Available wherever the search component appears.

@netlify
Copy link

netlify bot commented Aug 26, 2025

Deploy Preview for easyops-cn-docusaurus-search-local ready!

Name Link
🔨 Latest commit 4c6d997
🔍 Latest deploy log https://app.netlify.com/projects/easyops-cn-docusaurus-search-local/deploys/68ad1d9d52e3270008ce8f5d
😎 Deploy Preview https://deploy-preview-537--easyops-cn-docusaurus-search-local.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Aug 26, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary of Changes
Localization additions
docusaurus-search-local/locales/zh-TW.json
Added zh-TW locale with translations for theme.SearchBar and theme.SearchPage keys, including labels, result messages, plural forms, and context strings.

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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.

📥 Commits

Reviewing files that changed from the base of the PR and between c326329 and 4c6d997.

📒 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 baseline

All locale keys in docusaurus-search-local/locales/zh-TW.json are 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.

Comment on lines +5 to +6
"theme.SearchBar.searchInContext": "“查看{context}”內的全部結果",
"theme.SearchBar.seeAllOutsideContext": "查看“{context}”以外的全部結果",
Copy link

@coderabbitai coderabbitai bot Aug 26, 2025

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.

Suggested change
"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.

Copy link
Author

Choose a reason for hiding this comment

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

Apply it.

Copy link
Author

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.

Copy link

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!

Copy link

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.

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.

1 participant