Skip to content

Conversation

@mmcky
Copy link
Member

@mmcky mmcky commented Oct 21, 2025

Summary

This PR adds comprehensive internationalization (i18n) support to sphinx-exercise, enabling the extension to display exercise and solution labels in 27 different languages.

New Features

Internationalization Support

  • 27 languages now supported with automatic language detection
  • Includes high-priority languages: Chinese, Japanese, Korean, Arabic, Hindi, Turkish
  • Automatic detection from Sphinx language configuration
  • JSON-based translation files for easy community contributions

Supported Languages

Arabic, Bengali, Chinese, Czech, Dutch, French, German, Greek, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Tamil, Turkish, Ukrainian, Vietnamese

Infrastructure Improvements

  • Added Copilot instructions (.github/copilot-instructions.md) for maintainers
  • Created releases documentation structure (docs/releases/)
  • Comprehensive translation documentation with contribution guide
  • Automated locale file generation from JSON sources

Documentation Updates

  • ✅ Updated README.md with i18n features
  • ✅ Added internationalization section to syntax guide
  • ✅ Created detailed release notes in docs/releases/unreleased.md
  • ✅ Enhanced translation README with contribution workflow
  • ✅ Updated CHANGELOG.md

Usage Example

# conf.py
language = 'zh_CN'  # Chinese
language = 'ja'     # Japanese
language = 'es'     # Spanish

With language configured, "Exercise" automatically translates to "练习" (Chinese), "練習" (Japanese), "Ejercicio" (Spanish), etc.

Testing

All locale files have been generated and compiled successfully:

  • 27 .po source files
  • 27 .mo compiled catalog files

Related

This builds on the recently merged internationalization feature and expands it with additional high-priority languages and comprehensive documentation.

cc @executablebooks/maintainers

mmcky added 3 commits October 21, 2025 11:59
- Add i18n support with 27 languages including Chinese, Japanese, Korean, Arabic, Hindi, and Turkish
- Add comprehensive Copilot instructions for project maintenance
- Create releases documentation structure in docs/releases/
- Update README and documentation with i18n features
- Reorganize translation files with alphabetical sorting
- Generate all .po and .mo locale files

Features:
- Automatic language detection from Sphinx config
- JSON-based translation source files for easy contribution
- Complete documentation with examples and contribution guide

Languages supported:
Arabic, Bengali, Chinese, Czech, Dutch, French, German, Greek, Hindi,
Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian,
Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Tamil,
Turkish, Ukrainian, Vietnamese
- Update CHANGELOG with v1.1.0 release notes
- Create comprehensive release notes in docs/source/releases/v1.1.0.md
- Add RELEASE.md with step-by-step release checklist
- Simplify releases documentation structure
- Remove duplicate unreleased.md file

Ready for release after version bump in __init__.py
- Move sphinx.locale imports to top of file
- Fixes E402 pre-commit errors
@mmcky
Copy link
Member Author

mmcky commented Oct 21, 2025

Resolved merge conflicts in:
- sphinx_exercise/directive.py: Accepted alphabetically sorted imports from main
- sphinx_exercise/nodes.py: Removed extra blank line

This merge brings in all the test suite modernization from main including:
- Python 3.11-3.13 and Sphinx 6-8 compatibility
- Complete pathlib migration (os.path -> pathlib.Path)
- Image hash normalization for cross-platform tests
- All test fixtures for Sphinx 6, 7, and 8
@mmcky mmcky merged commit 68b4b72 into main Oct 22, 2025
12 checks passed
@mmcky mmcky deleted the update-languages branch October 22, 2025 02:23
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.

2 participants