Add complete Chinese (zh_CN) localization for all admonition types #153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds complete Chinese (Simplified Chinese, zh_CN) localization support for all admonition types in sphinx-proof. Previously, admonition titles were hardcoded in English, and some admonition types were missing Chinese translations.
Problem
When using
language = "zh_CN"
in Sphinx configuration, admonition titles were displaying in English instead of Chinese:Solution
This PR completes the Chinese localization by:
Adding missing Chinese translations for admonition types that had incomplete support:
Updating the Proof directive to use the translation system by wrapping the title with the
_()
functionRegenerating locale files (.po and .mo) for zh_CN with all translations
Updating documentation to reflect complete Chinese support
Result
All admonition titles now display correctly in Chinese when
language = "zh_CN"
is configured:Complete Chinese Translation Support
Usage
To enable Chinese localization in your Sphinx project, simply add this to your
conf.py
:Testing
Changes
sphinx_proof/directive.py
- Added translation support to ProofDirectivesphinx_proof/translations/jsons/Corollary.json
- Added Chinese translationsphinx_proof/translations/jsons/Example.json
- Added Chinese translationsphinx_proof/translations/jsons/Proof.json
- Created new translation filesphinx_proof/translations/locales/zh_CN/LC_MESSAGES/proof.mo
- Regenerated binary locale filedocs/source/internationalization.md
- Updated documentationFixes #145
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com
/usr/lib/apt/methods/https
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.