Skip to content

Conversation

@douden
Copy link
Contributor

@douden douden commented Jul 28, 2025

This PR addresses the problem described in issue #144 by ensuring that translated content in the sphinx-proof directives is correctly rendered.

Added *.json, *.mo, and *.py files from the sphinx_proof directory to the package manifest for more comprehensive distribution. Removed global recursive inclusion of *.pot, *.po, and *.mo files.

ENH: adds NotationNode

Fixes #144

douden added 2 commits July 28, 2025 17:07
Added *.json, *.mo, and *.py files from the sphinx_proof directory to the package manifest for more comprehensive distribution. Removed global recursive inclusion of *.pot, *.po, and *.mo files.
Added and updated translations for mathematical proof terms in multiple languages across all JSON files. Also updated and added compiled .mo files for new and existing locales to support broader internationalization.
Introduces a new 'notation' directive and node to the Sphinx Proof extension, including registration in NODE_TYPES and PROOF_TYPES. Adds a Notation.json file with translations for 'Notation' in multiple languages and updates .mo files for localization support.
@mmcky mmcky requested a review from Copilot October 20, 2025 00:47
Copy link
Contributor

Copilot AI left a 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 expands multilingual support for the sphinx-proof extension by adding comprehensive translations and a new "notation" directive. The changes update translation files to include many additional languages and ensure that all necessary files are properly distributed via the package manifest.

Key Changes:

  • Added a new "notation" directive type with full translation support across 31 languages
  • Expanded existing translation files to include translations for 20+ additional languages beyond the original subset
  • Updated MANIFEST.in to include sphinx_proof-specific *.json, *.mo, and *.py files while removing global recursive inclusion

Reviewed Changes

Copilot reviewed 18 out of 47 changed files in this pull request and generated no comments.

File Description
sphinx_proof/translations/jsons/*.json Added comprehensive translations for mathematical terms across 31 languages
sphinx_proof/proof_type.py Added NotationDirective class and registered it in PROOF_TYPES
sphinx_proof/nodes.py Added notation_node class and registered it in NODE_TYPES
MANIFEST.in Updated to include sphinx_proof-specific files and removed global recursive inclusion

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mmcky
Copy link
Member

mmcky commented Oct 20, 2025

@douden -- thank you so much for this PR. It looks great, sorry for taking so long to get back to you.

I will do some extra testing today and get this merged.

This will update many of the languages that are currently open. Greatly appreciated.

@mmcky
Copy link
Member

mmcky commented Oct 20, 2025

@douden I've pushed additional commits to fix incorrect translations in Remark and Proposition (commit 8f22f26) to the executablebooks/sphinx-proof:TeachBooks/main branch.

Could you please sync these changes to the TeachBooks/sphinx-proof:main branch, or would you like me to create a new PR from executablebooks/sphinx-proof:TeachBooks/main? I would merge this first to log the contribution then update #154 with the minor fixes.

Changes include:

  • Fixed 5 Remark translations (Spanish, Portuguese, Italian, Greek, Romanian) that incorrectly used 'Observation'
  • Fixed Polish Proposition translation that incorrectly used 'Theorem'
  • Regenerated affected locale .mo files
  • minor fix for pre-commit

@mmcky mmcky changed the title Update MANIFEST.in to include more sphinx_proof files ENH: Adds additional language support and fixes sphinx issues + updated manifests Oct 20, 2025
@mmcky
Copy link
Member

mmcky commented Oct 20, 2025

@douden actually I'll merge this as is and fix the pre-commit and minor adjustments to translations in #154

Really appreciate your work and contribution.

@mmcky mmcky merged commit 9ad5f96 into executablebooks:main Oct 20, 2025
5 of 7 checks passed
mmcky added a commit that referenced this pull request Oct 20, 2025
… to PR #146) (#154)

* Update MANIFEST.in to include more sphinx_proof files

Added *.json, *.mo, and *.py files from the sphinx_proof directory to the package manifest for more comprehensive distribution. Removed global recursive inclusion of *.pot, *.po, and *.mo files.

* Expand translation coverage for proof terms

Added and updated translations for mathematical proof terms in multiple languages across all JSON files. Also updated and added compiled .mo files for new and existing locales to support broader internationalization.

* Add support for notation directive and translations

Introduces a new 'notation' directive and node to the Sphinx Proof extension, including registration in NODE_TYPES and PROOF_TYPES. Adds a Notation.json file with translations for 'Notation' in multiple languages and updates .mo files for localization support.

* Fix incorrect translations for Remark and Proposition

- Fixed Remark translations that incorrectly used 'Observation':
  - Spanish (es): Observación → Nota
  - Portuguese (pt): Observação → Nota
  - Italian (it): Osservazione → Nota
  - Greek (el): Παρατήρηση → Σημείωση
  - Romanian (ro): Observație → Remarcă

- Fixed Proposition translation in Polish:
  - Polish (pl): Twierdzenie → Propozycja
  (Twierdzenie means 'Theorem', not 'Proposition')

- Regenerated all affected locale .mo files

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix duplicate NotationDirective class definition

Removed duplicate NotationDirective class that was causing issues.
Only one NotationDirective definition is needed.

* Fix duplicate notation_node class definition

Removed duplicate notation_node class in nodes.py.
Only one notation_node definition is needed.

---------

Co-authored-by: Dennis den Ouden-van der Horst <d.denouden-vanderhorst@tudelft.nl>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

Italian localization not applied for proof labels with Jupyter Book

2 participants