Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/source/internationalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ This package supports the following languages specified in `conf.py` using the
- ru
- zh_CN

```{note} Work in progress
Not all languages listed above are support across all admonition types
```
All admonition types (Theorem, Definition, Lemma, Proof, Assumption, Corollary, Example, etc.) are fully translated into Chinese (zh_CN).
5 changes: 4 additions & 1 deletion sphinx_proof/directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
from sphinx.util import logging
from docutils.parsers.rst import directives
from sphinx.util.docutils import SphinxDirective
from sphinx.locale import get_translation
from .nodes import unenumerable_node, NODE_TYPES
from .nodes import proof_node

logger = logging.getLogger(__name__)
MESSAGE_CATALOG_NAME = "proof"
_ = get_translation(MESSAGE_CATALOG_NAME)


class ElementDirective(SphinxDirective):
Expand Down Expand Up @@ -124,7 +127,7 @@ def run(self) -> List[Node]:

section = nodes.admonition(classes=classes, ids=[typ])

self.content[0] = "{}. ".format(typ.title()) + self.content[0]
self.content[0] = "{}. ".format(_(typ.title())) + self.content[0]
self.state.nested_parse(self.content, 0, section)

node = proof_node()
Expand Down
1 change: 1 addition & 0 deletions sphinx_proof/translations/jsons/Corollary.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
{"language":"English","symbol":"en","text":"Corollary"},
{"language":"Chinese","symbol":"zh_CN","text":"推论"},
{"language":"German","symbol":"de","text":"Korollar"}
]
1 change: 1 addition & 0 deletions sphinx_proof/translations/jsons/Example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[
{"language":"English","symbol":"en","text":"Example"},
{"language":"Chinese","symbol":"zh_CN","text":"例"},
{"language":"Czech","symbol":"cs","text":"Příklad"},
{"language":"Dutch","symbol":"nl","text":"Voorbeeld"},
{"language":"French","symbol":"fr","text":"Exemple"},
Expand Down
4 changes: 4 additions & 0 deletions sphinx_proof/translations/jsons/Proof.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{"language":"English","symbol":"en","text":"Proof"},
{"language":"Chinese","symbol":"zh_CN","text":"证明"}
]
Binary file modified sphinx_proof/translations/locales/zh_CN/LC_MESSAGES/proof.mo
Binary file not shown.