From 1198ee0f6dfad556c615000ff2f2371fd484ff3e Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 21 Oct 2025 11:59:07 +1100 Subject: [PATCH 1/3] Add internationalization support for 27 languages - 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 --- .github/copilot-instructions.md | 73 ++++++++++++++++++ CHANGELOG.md | 20 +++++ README.md | 8 ++ docs/source/index.md | 5 ++ docs/source/releases/index.md | 15 ++++ docs/source/releases/unreleased.md | 66 ++++++++++++++++ docs/source/syntax.md | 59 ++++++++++++++ sphinx_exercise/translations/README.md | 49 +++++++++++- .../translations/jsons/Exercise.json | 34 ++++---- .../translations/jsons/Solution.json | 34 ++++---- .../locales/ar/LC_MESSAGES/exercise.mo | Bin 0 -> 326 bytes .../locales/ar/LC_MESSAGES/exercise.po | 15 ++++ .../locales/bn/LC_MESSAGES/exercise.mo | Bin 369 -> 345 bytes .../locales/cs/LC_MESSAGES/exercise.mo | Bin 347 -> 323 bytes .../locales/de/LC_MESSAGES/exercise.mo | Bin 343 -> 319 bytes .../locales/el/LC_MESSAGES/exercise.mo | Bin 354 -> 330 bytes .../locales/es/LC_MESSAGES/exercise.mo | Bin 347 -> 323 bytes .../locales/fr/LC_MESSAGES/exercise.mo | Bin 346 -> 322 bytes .../locales/hi/LC_MESSAGES/exercise.mo | Bin 0 -> 339 bytes .../locales/hi/LC_MESSAGES/exercise.po | 15 ++++ .../locales/hu/LC_MESSAGES/exercise.mo | Bin 347 -> 323 bytes .../locales/id/LC_MESSAGES/exercise.mo | Bin 346 -> 322 bytes .../locales/it/LC_MESSAGES/exercise.mo | Bin 347 -> 323 bytes .../locales/ja/LC_MESSAGES/exercise.mo | Bin 0 -> 315 bytes .../locales/ja/LC_MESSAGES/exercise.po | 15 ++++ .../locales/ko/LC_MESSAGES/exercise.mo | Bin 0 -> 315 bytes .../locales/ko/LC_MESSAGES/exercise.po | 15 ++++ .../locales/ms/LC_MESSAGES/exercise.mo | Bin 352 -> 328 bytes .../locales/nl/LC_MESSAGES/exercise.mo | Bin 346 -> 322 bytes .../locales/no/LC_MESSAGES/exercise.mo | Bin 346 -> 322 bytes .../locales/pl/LC_MESSAGES/exercise.mo | Bin 352 -> 328 bytes .../locales/pt/LC_MESSAGES/exercise.mo | Bin 351 -> 327 bytes .../locales/ro/LC_MESSAGES/exercise.mo | Bin 352 -> 328 bytes .../locales/ru/LC_MESSAGES/exercise.mo | Bin 364 -> 340 bytes .../locales/sv/LC_MESSAGES/exercise.mo | Bin 347 -> 323 bytes .../locales/ta/LC_MESSAGES/exercise.mo | Bin 366 -> 342 bytes .../locales/tr/LC_MESSAGES/exercise.mo | Bin 0 -> 323 bytes .../locales/tr/LC_MESSAGES/exercise.po | 15 ++++ .../locales/uk/LC_MESSAGES/exercise.mo | Bin 361 -> 337 bytes .../locales/vi/LC_MESSAGES/exercise.mo | Bin 353 -> 329 bytes .../locales/zh_CN/LC_MESSAGES/exercise.mo | Bin 0 -> 318 bytes .../locales/zh_CN/LC_MESSAGES/exercise.po | 15 ++++ 42 files changed, 423 insertions(+), 30 deletions(-) create mode 100644 .github/copilot-instructions.md create mode 100644 docs/source/releases/index.md create mode 100644 docs/source/releases/unreleased.md create mode 100644 sphinx_exercise/translations/locales/ar/LC_MESSAGES/exercise.mo create mode 100644 sphinx_exercise/translations/locales/ar/LC_MESSAGES/exercise.po create mode 100644 sphinx_exercise/translations/locales/hi/LC_MESSAGES/exercise.mo create mode 100644 sphinx_exercise/translations/locales/hi/LC_MESSAGES/exercise.po create mode 100644 sphinx_exercise/translations/locales/ja/LC_MESSAGES/exercise.mo create mode 100644 sphinx_exercise/translations/locales/ja/LC_MESSAGES/exercise.po create mode 100644 sphinx_exercise/translations/locales/ko/LC_MESSAGES/exercise.mo create mode 100644 sphinx_exercise/translations/locales/ko/LC_MESSAGES/exercise.po create mode 100644 sphinx_exercise/translations/locales/tr/LC_MESSAGES/exercise.mo create mode 100644 sphinx_exercise/translations/locales/tr/LC_MESSAGES/exercise.po create mode 100644 sphinx_exercise/translations/locales/zh_CN/LC_MESSAGES/exercise.mo create mode 100644 sphinx_exercise/translations/locales/zh_CN/LC_MESSAGES/exercise.po diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..c16335b --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,73 @@ +# Copilot Instructions for sphinx-exercise + +## General Guidelines + +### Code Philosophy +- **Simplicity First**: Pursue simple code with low complexity when making changes +- **Maintainability**: Keep code modular and easy to understand +- **Minimal Dependencies**: Avoid adding unnecessary dependencies + +### Documentation Standards +- **Do NOT create summary documents** when making changes +- Instead, **update existing documents** where needed (README.md, docs/, etc.) +- Keep documentation in sync with code changes + +### Release Management +- **Review Documentation**: Before making any releases, please review all documentation in `docs/` +- **Update CHANGELOG.md**: Keep the CHANGELOG.md up to date with all significant changes +- **Release Notes**: Maintain detailed release information in `docs/releases/` +- Follow semantic versioning principles + +### Release Information Structure +Release documentation should be maintained in `docs/releases/` with the following structure: +- One file per version (e.g., `v0.5.0.md`) +- Link to releases from main documentation +- Include migration guides for breaking changes + +## Project-Specific Guidelines + +### Internationalization (i18n) +- Translation files are located in `sphinx_exercise/translations/` +- JSON source files: `sphinx_exercise/translations/jsons/` +- Compiled locale files: `sphinx_exercise/translations/locales/` +- Use `_convert.py` to regenerate locale files from JSON sources +- When adding new languages: + 1. Add translations to both `Exercise.json` and `Solution.json` + 2. Run `python sphinx_exercise/translations/_convert.py` to generate `.po` and `.mo` files + 3. Update documentation to mention new language support + +### Testing +- All changes should include appropriate tests +- Test files are in `tests/` directory +- Run tests before committing changes +- Maintain test coverage + +### Code Structure +- Main extension code: `sphinx_exercise/` +- Directives: `directive.py` +- Transforms: `transforms.py` and `post_transforms.py` +- LaTeX support: `latex.py` +- Node definitions: `nodes.py` + +### Documentation +- Main docs: `docs/source/` +- Build docs locally before committing documentation changes +- Ensure all examples work correctly +- Update syntax documentation when adding new features + +## Workflow + +1. **Before Starting**: Review relevant existing code and documentation +2. **During Development**: + - Write simple, clear code + - Update tests as needed + - Update existing documentation inline +3. **Before Committing**: + - Run tests + - Review documentation changes + - Update CHANGELOG.md if applicable +4. **Before Releasing**: + - Review all documentation in `docs/` + - Create release notes in `docs/releases/` + - Update CHANGELOG.md + - Verify all tests pass diff --git a/CHANGELOG.md b/CHANGELOG.md index ebcbd16..71cb336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [Unreleased] + +### New ✨ + +- Added internationalization (i18n) support for 27 languages +- Added translations for Chinese, Japanese, Korean, Arabic, Hindi, Turkish, and expanded existing language support +- Extension now automatically detects Sphinx project language setting and displays appropriate translations + +### Improved 👌 + +- Reorganized and expanded translation files with alphabetical sorting +- Enhanced translation documentation with comprehensive guides +- Updated README and documentation to highlight internationalization features + +### Documentation 📚 + +- Added internationalization section to syntax documentation +- Updated README with i18n feature highlights +- Improved translation README with detailed contribution guidelines + ## [v0.4.1](https://github.com/executablebooks/sphinx-exercise/tree/v0.4.1) (2023-1-23) diff --git a/README.md b/README.md index 2f8230d..6945900 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,14 @@ This package contains a [Sphinx](http://www.sphinx-doc.org/en/master/) extension for producing exercise and solution directives. +## Features + +- **Automatic numbering** for exercises and solutions +- **Cross-referencing** support with `ref` and `numref` roles +- **Internationalization** support for 27 languages including Chinese, Japanese, Korean, Arabic, Hindi, and more +- **HTML and PDF** output support +- **Gated directive** syntax for including executable code and complex content +- **Customizable styling** with class options and hidden directive support ## Get started diff --git a/docs/source/index.md b/docs/source/index.md index 402dc82..c6ed9de 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -5,6 +5,7 @@ install syntax +releases/index developer developer-design ``` @@ -32,6 +33,10 @@ The **solution** directive 1. supports options such as `class`, `label`, and `hidden` 2. can be referenced through `ref` role +**Internationalization**: + +`sphinx-exercise` supports 27 languages including Chinese, Japanese, Korean, Arabic, Hindi, Spanish, French, German, and more. The extension automatically uses the appropriate language based on your Sphinx project's `language` configuration. + (getting-started)= ## Getting Started diff --git a/docs/source/releases/index.md b/docs/source/releases/index.md new file mode 100644 index 0000000..2bec1ff --- /dev/null +++ b/docs/source/releases/index.md @@ -0,0 +1,15 @@ +# Release Notes + +This section contains detailed release notes for sphinx-exercise versions. + +```{toctree} +:maxdepth: 1 + +unreleased +``` + +## Quick Links + +- [Latest Release](https://github.com/executablebooks/sphinx-exercise/releases/latest) +- [All Releases](https://github.com/executablebooks/sphinx-exercise/releases) +- [Changelog](https://github.com/executablebooks/sphinx-exercise/blob/main/CHANGELOG.md) diff --git a/docs/source/releases/unreleased.md b/docs/source/releases/unreleased.md new file mode 100644 index 0000000..d6a2a17 --- /dev/null +++ b/docs/source/releases/unreleased.md @@ -0,0 +1,66 @@ +# Unreleased Changes + +This document tracks changes that have been merged but not yet released. + +## Internationalization Support + +### New Features + +`sphinx-exercise` now includes comprehensive internationalization (i18n) support, allowing the extension to display exercise and solution labels in 27 different languages. + +#### Supported Languages + +The extension now supports the following languages: + +- **East Asian**: Chinese, Japanese, Korean +- **South Asian**: Bengali, Hindi, Tamil +- **Middle Eastern**: Arabic, Turkish +- **European**: Czech, Dutch, French, German, Greek, Hungarian, Italian, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Ukrainian +- **Southeast Asian**: Indonesian, Malay, Vietnamese + +#### Automatic Language Detection + +The extension automatically detects your Sphinx project's language configuration and applies the appropriate translations. Simply set the `language` option in your `conf.py`: + +```python +# For Spanish +language = 'es' + +# For Chinese +language = 'zh_CN' + +# For Japanese +language = 'ja' +``` + +For Jupyter Book projects, configure in `_config.yml`: + +```yaml +sphinx: + config: + language: zh_CN # For Chinese +``` + +#### Translation Examples + +With language configured, the directive labels automatically translate: + +- **Spanish**: "Exercise" → "Ejercicio", "Solution to" → "Solución a" +- **Chinese**: "Exercise" → "练习", "Solution to" → "解答" +- **Japanese**: "Exercise" → "練習", "Solution to" → "解答" +- **French**: "Exercise" → "Exercice", "Solution de" → "Solution de" +- **German**: "Exercise" → "Übung", "Solution to" → "Lösung zu" + +### Contributing Translations + +We welcome contributions for additional languages or improvements to existing translations. The translation files are maintained in `sphinx_exercise/translations/jsons/` as JSON files for easy editing. See the [translation guide](https://github.com/executablebooks/sphinx-exercise/tree/main/sphinx_exercise/translations) for details. + +### Documentation Updates + +- Added internationalization section to [syntax guide](../syntax.md#internationalization-i18n) +- Updated README with i18n feature highlights +- Enhanced translation documentation with contribution guidelines + +--- + +For the complete list of changes, see the [CHANGELOG](https://github.com/executablebooks/sphinx-exercise/blob/main/CHANGELOG.md). diff --git a/docs/source/syntax.md b/docs/source/syntax.md index 9ce7d93..f13f2ba 100644 --- a/docs/source/syntax.md +++ b/docs/source/syntax.md @@ -468,3 +468,62 @@ This is an example of how to introduce custom CSS. This is an example of how to introduce custom CSS. ``` + +## Internationalization (i18n) + +`sphinx-exercise` includes built-in support for internationalization across 27 languages. The extension automatically detects your Sphinx project's language setting and displays "Exercise" and "Solution to" labels in the appropriate language. + +### Supported Languages + +The following languages are currently supported: + +- Arabic (ar) +- Bengali (bn) +- Chinese (zh_CN) +- Czech (cs) +- Dutch (nl) +- French (fr) +- German (de) +- Greek (el) +- Hindi (hi) +- Hungarian (hu) +- Indonesian (id) +- Italian (it) +- Japanese (ja) +- Korean (ko) +- Malay (ms) +- Norwegian (no) +- Polish (pl) +- Portuguese (pt) +- Romanian (ro) +- Russian (ru) +- Spanish (es) +- Swedish (sv) +- Tamil (ta) +- Turkish (tr) +- Ukrainian (uk) +- Vietnamese (vi) + +### Configuring Language + +To configure the language for your Sphinx project, set the `language` option in your `conf.py`: + +```python +# conf.py +language = 'es' # For Spanish +``` + +For Jupyter Book projects, set the language in `_config.yml`: + +```yaml +# _config.yml +sphinx: + config: + language: es +``` + +The exercise and solution directives will automatically use the appropriate translations. For example, with Spanish configured, "Exercise" will display as "Ejercicio" and "Solution to" as "Solución a". + +### Contributing Translations + +If you'd like to contribute translations for additional languages or improve existing ones, please see the [translation guide](https://github.com/executablebooks/sphinx-exercise/tree/main/sphinx_exercise/translations) in the repository. diff --git a/sphinx_exercise/translations/README.md b/sphinx_exercise/translations/README.md index 8dff863..f65bf40 100644 --- a/sphinx_exercise/translations/README.md +++ b/sphinx_exercise/translations/README.md @@ -1,3 +1,48 @@ -JSONs created using GitHub Copilot Pro. +# Translations for sphinx-exercise -To convert to locale files run `_convert.py` in this folder. +This directory contains internationalization (i18n) files for `sphinx-exercise`. + +## Structure + +- `jsons/` - Source translation files in JSON format + - `Exercise.json` - Translations for "Exercise" label + - `Solution.json` - Translations for "Solution to" label +- `locales/` - Compiled locale files (`.po` and `.mo` files) +- `_convert.py` - Script to generate locale files from JSON sources + +## Supported Languages + +Currently supporting 27 languages: + +Arabic (ar), Bengali (bn), Chinese (zh_CN), Czech (cs), Dutch (nl), French (fr), German (de), Greek (el), Hindi (hi), Hungarian (hu), Indonesian (id), Italian (it), Japanese (ja), Korean (ko), Malay (ms), Norwegian (no), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Spanish (es), Swedish (sv), Tamil (ta), Turkish (tr), Ukrainian (uk), Vietnamese (vi) + +## Adding or Updating Translations + +To add a new language or update existing translations: + +1. Edit the JSON files in `jsons/` directory + - Add translations to both `Exercise.json` and `Solution.json` + - Ensure the language symbol follows ISO 639-1 standard (or locale codes like `zh_CN`) + - Keep entries alphabetically sorted by language name + +2. Run the conversion script to generate `.po` and `.mo` files: + ```bash + python _convert.py + ``` + +3. The script will: + - Remove existing `.po` files + - Generate new `.po` files from JSON sources + - Compile `.mo` files using `msgfmt` + +## Requirements + +The `msgfmt` utility (from gettext) must be installed on your system to compile `.mo` files. + +## Contributing + +Contributions for new languages or improvements to existing translations are welcome! Please ensure: +- Translations are accurate and culturally appropriate +- Both `Exercise.json` and `Solution.json` are updated +- The conversion script runs successfully +- Documentation is updated to list the new language diff --git a/sphinx_exercise/translations/jsons/Exercise.json b/sphinx_exercise/translations/jsons/Exercise.json index 27e8869..ba11f55 100644 --- a/sphinx_exercise/translations/jsons/Exercise.json +++ b/sphinx_exercise/translations/jsons/Exercise.json @@ -1,23 +1,29 @@ [ {"language":"English","symbol":"en","text":"Exercise"}, - {"language":"Spanish","symbol":"es","text":"Ejercicio"}, - {"language":"French","symbol":"fr","text":"Exercice"}, + {"language":"Arabic","symbol":"ar","text":"تمرين"}, {"language":"Bengali","symbol":"bn","text":"অনুশীলনী"}, - {"language":"Russian","symbol":"ru","text":"Упражнение"}, - {"language":"Portuguese","symbol":"pt","text":"Exercício"}, - {"language":"Indonesian","symbol":"id","text":"Latihan"}, - {"language":"German","symbol":"de","text":"Übung"}, - {"language":"Vietnamese","symbol":"vi","text":"Bài tập"}, - {"language":"Tamil","symbol":"ta","text":"பயிற்சி"}, - {"language":"Italian","symbol":"it","text":"Esercizio"}, + {"language":"Chinese","symbol":"zh_CN","text":"练习"}, + {"language":"Czech","symbol":"cs","text":"Cvičení"}, {"language":"Dutch","symbol":"nl","text":"Opgave"}, + {"language":"French","symbol":"fr","text":"Exercice"}, + {"language":"German","symbol":"de","text":"Übung"}, {"language":"Greek","symbol":"el","text":"Άσκηση"}, - {"language":"Polish","symbol":"pl","text":"Ćwiczenie"}, - {"language":"Ukrainian","symbol":"uk","text":"Вправа"}, + {"language":"Hindi","symbol":"hi","text":"अभ्यास"}, + {"language":"Hungarian","symbol":"hu","text":"Gyakorlat"}, + {"language":"Indonesian","symbol":"id","text":"Latihan"}, + {"language":"Italian","symbol":"it","text":"Esercizio"}, + {"language":"Japanese","symbol":"ja","text":"練習"}, + {"language":"Korean","symbol":"ko","text":"연습"}, {"language":"Malay","symbol":"ms","text":"Latihan"}, + {"language":"Norwegian","symbol":"no","text":"Øvelse"}, + {"language":"Polish","symbol":"pl","text":"Ćwiczenie"}, + {"language":"Portuguese","symbol":"pt","text":"Exercício"}, {"language":"Romanian","symbol":"ro","text":"Exercițiu"}, - {"language":"Czech","symbol":"cs","text":"Cvičení"}, - {"language":"Hungarian","symbol":"hu","text":"Gyakorlat"}, + {"language":"Russian","symbol":"ru","text":"Упражнение"}, + {"language":"Spanish","symbol":"es","text":"Ejercicio"}, {"language":"Swedish","symbol":"sv","text":"Övning"}, - {"language":"Norwegian","symbol":"no","text":"Øvelse"} + {"language":"Tamil","symbol":"ta","text":"பயிற்சி"}, + {"language":"Turkish","symbol":"tr","text":"Alıştırma"}, + {"language":"Ukrainian","symbol":"uk","text":"Вправа"}, + {"language":"Vietnamese","symbol":"vi","text":"Bài tập"} ] diff --git a/sphinx_exercise/translations/jsons/Solution.json b/sphinx_exercise/translations/jsons/Solution.json index d55eee4..05f7eaf 100644 --- a/sphinx_exercise/translations/jsons/Solution.json +++ b/sphinx_exercise/translations/jsons/Solution.json @@ -1,23 +1,29 @@ [ {"language":"English","symbol":"en","text":"Solution to"}, - {"language":"Spanish","symbol":"es","text":"Solución a"}, - {"language":"French","symbol":"fr","text":"Solution de"}, + {"language":"Arabic","symbol":"ar","text":"الحل لـ"}, {"language":"Bengali","symbol":"bn","text":"সমাধান"}, - {"language":"Russian","symbol":"ru","text":"Решение к"}, - {"language":"Portuguese","symbol":"pt","text":"Solução para"}, - {"language":"Indonesian","symbol":"id","text":"Solusi untuk"}, - {"language":"German","symbol":"de","text":"Lösung zu"}, - {"language":"Vietnamese","symbol":"vi","text":"Lời giải cho"}, - {"language":"Tamil","symbol":"ta","text":"தீர்வு"}, - {"language":"Italian","symbol":"it","text":"Soluzione a"}, + {"language":"Chinese","symbol":"zh_CN","text":"解答"}, + {"language":"Czech","symbol":"cs","text":"Řešení k"}, {"language":"Dutch","symbol":"nl","text":"Oplossing van"}, + {"language":"French","symbol":"fr","text":"Solution de"}, + {"language":"German","symbol":"de","text":"Lösung zu"}, {"language":"Greek","symbol":"el","text":"Λύση στο"}, - {"language":"Polish","symbol":"pl","text":"Rozwiązanie do"}, - {"language":"Ukrainian","symbol":"uk","text":"Розв'язок до"}, + {"language":"Hindi","symbol":"hi","text":"समाधान"}, + {"language":"Hungarian","symbol":"hu","text":"Megoldás a"}, + {"language":"Indonesian","symbol":"id","text":"Solusi untuk"}, + {"language":"Italian","symbol":"it","text":"Soluzione a"}, + {"language":"Japanese","symbol":"ja","text":"解答"}, + {"language":"Korean","symbol":"ko","text":"해답"}, {"language":"Malay","symbol":"ms","text":"Penyelesaian untuk"}, + {"language":"Norwegian","symbol":"no","text":"Løsning til"}, + {"language":"Polish","symbol":"pl","text":"Rozwiązanie do"}, + {"language":"Portuguese","symbol":"pt","text":"Solução para"}, {"language":"Romanian","symbol":"ro","text":"Soluția pentru"}, - {"language":"Czech","symbol":"cs","text":"Řešení k"}, - {"language":"Hungarian","symbol":"hu","text":"Megoldás a"}, + {"language":"Russian","symbol":"ru","text":"Решение к"}, + {"language":"Spanish","symbol":"es","text":"Solución a"}, {"language":"Swedish","symbol":"sv","text":"Lösning till"}, - {"language":"Norwegian","symbol":"no","text":"Løsning til"} + {"language":"Tamil","symbol":"ta","text":"தீர்வு"}, + {"language":"Turkish","symbol":"tr","text":"Çözüm"}, + {"language":"Ukrainian","symbol":"uk","text":"Розв'язок до"}, + {"language":"Vietnamese","symbol":"vi","text":"Lời giải cho"} ] diff --git a/sphinx_exercise/translations/locales/ar/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/ar/LC_MESSAGES/exercise.mo new file mode 100644 index 0000000000000000000000000000000000000000..e0f06e000d25d0ddc50c7d7d35bf2fe41c9f7819 GIT binary patch literal 326 zcmYMsze@u#6bJBV6(q&Q*&%K^#9DDU?zl;=P-vmh>fCsZ*Oc?+NOE#+4p#?v{{}&D zaPe=sEdDLNt4JUDui&p3xJtB(u4k3q_0Vb}^ z91ODCZfzx%G^w(ZOm$v5rGYt3CPuGh>iBTMZ>6#L8nS7zR8aB%emWkGlkIQ+{DNL< za1tD!Jry!!PFAj0_WzxKoaf1Z1ViaE35+ zl9xv0e4x#P4H*=htBo%s_IHd=ft|#xe-=^FeE4@ MF~LQkjD?Ym04Ev;!2kdN diff --git a/sphinx_exercise/translations/locales/cs/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/cs/LC_MESSAGES/exercise.mo index 8754386cd5db27dd4bbd1b354fe1b9e5b06e0c1d..b7a2467562ea8998f5e967fa1f5b8fa44b770f41 100644 GIT binary patch delta 79 zcmcc3beL&^h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS1Y%uAh`2eB1|kM#AO-=Z HiG{BKRhS2} delta 103 zcmX@ibem~{NGvx41A`9`gFpoka{zHA5QD^~{5W6x$#QlLZ5WxX6l*I%W KfifmWz5)Ob9|%bR diff --git a/sphinx_exercise/translations/locales/de/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/de/LC_MESSAGES/exercise.mo index 9088c9c4c796eaa169910abb99acf2e2cfa40cfe..68f29b894f31475523d920471790b7eb7a78622d 100644 GIT binary patch delta 79 zcmcc4w4Z5$h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZs+17cl91_mx5Z33i$h=Cc1 KL4avu;WGeIa0j3O delta 103 zcmdnbbe(B}NGvx41A`9`gFpoka{zHA5QD^~*5W6xmFmM5BA0Q1xaKH>@ MF~LQkjERxY01A%?HUIzs diff --git a/sphinx_exercise/translations/locales/el/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/el/LC_MESSAGES/exercise.mo index 741e1129313867872565dca720f3d71ba8d2c1b5..8f8ed0012bc9e3933a2b3292a011044dbe65985a 100644 GIT binary patch delta 79 zcmaFFbc$($h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS0b*T71_pj0Z3U!(h=Cc1 KL4avu;YR>k-v`nF delta 103 zcmX@b^oVJKNGvx41A`9`gFpoka{zHA5QD^~v5W6xmFz^HEARrAyaKH>@ MF~LQkjERvS0T!kRXaE2J diff --git a/sphinx_exercise/translations/locales/es/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/es/LC_MESSAGES/exercise.mo index 76c2d87afcb579185134b860525a4675dfd3b20f..cdb827155dea6992fa567c5f09a3c25e32caa67d 100644 GIT binary patch delta 79 zcmcc3beL&^h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS1Y%uAh`2eB1|kM#AO-=Z HiG{BKRhS2} delta 103 zcmX@ibem~{NGvx41A`9`gFpoka{zHA5QD^~{5W6x$#QlLZ5WxX6l*I%W KfifmWz5)Ob9|%bR diff --git a/sphinx_exercise/translations/locales/fr/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/fr/LC_MESSAGES/exercise.mo index b15e61b91ee4d2cb63b6f663d391150e4af62dd1..1d07b2692242735d5e0da59e885b057daf8aaa95 100644 GIT binary patch delta 79 zcmcb`bckt!h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZrxiR&^##La*-5HT)ZX2t)t? diff --git a/sphinx_exercise/translations/locales/hi/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/hi/LC_MESSAGES/exercise.mo new file mode 100644 index 0000000000000000000000000000000000000000..7d39a263da0aa7aefbcb07e9d5e025500acfe225 GIT binary patch literal 339 zcmYMs%}N6?5CGu#2eRIJ_7HD+h+6Sbc3BW)3xyU6t)7kBxSO(0mLx0d19CccR1`WhbtJ&I}fBnpUkFW!Cm_gC+h-u-yD!q&>WMf><@^C$TO DG|Xh) literal 0 HcmV?d00001 diff --git a/sphinx_exercise/translations/locales/hi/LC_MESSAGES/exercise.po b/sphinx_exercise/translations/locales/hi/LC_MESSAGES/exercise.po new file mode 100644 index 0000000..aec045a --- /dev/null +++ b/sphinx_exercise/translations/locales/hi/LC_MESSAGES/exercise.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-Exercise\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: hi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Exercise" +msgstr "अभ्यास" + +msgid "Solution to" +msgstr "समाधान" diff --git a/sphinx_exercise/translations/locales/hu/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/hu/LC_MESSAGES/exercise.mo index bdefdd27448d70124f28acc09bffd588802d1f88..c56e0b89cfb795facd0ee7a3a47fa8213bcc6c89 100644 GIT binary patch delta 79 zcmcc3beL&^h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS1Y%uAh`2eB1|kM#AO-=Z HiG{BKRhS2} delta 103 zcmX@ibem~{NGvx41A`9`gFpoka{zHA5QD^~{5W6x$#QlLZ5WxX6l*I%W KfifmWz5)Ob9|%bR diff --git a/sphinx_exercise/translations/locales/id/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/id/LC_MESSAGES/exercise.mo index 3bac77777e8ed14ac31ffb55bd5a96218089b905..fbd066abd629871d16c8ea97f5315a0e8b06e6c1 100644 GIT binary patch delta 79 zcmcb`bckt!h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZs+2Vz}D1_mA=Z3?7;h=Cc1 KL4avu;Y$Eis|T$B delta 103 zcmX@abc<<%NGvx41A`9`gFpoka{zHA5QD^@ MF~LQkjERvi0S&qcLjV8( diff --git a/sphinx_exercise/translations/locales/it/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/it/LC_MESSAGES/exercise.mo index cb63a7944ed7aa516eb381a8a234bb7e1c3f9525..0704ae1752fa0c2735d54989bdf39bc71aa244c6 100644 GIT binary patch delta 79 zcmcc3beL&^h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS1Y%uAh`2eB1|kM#AO-=Z HiG{BKRhS2} delta 103 zcmX@ibem~{NGvx41A`9`gFpoka{zHA5QD^~{5W6x$#QlLZ5WxX6l*I%W KfifmWz5)Ob9|%bR diff --git a/sphinx_exercise/translations/locales/ja/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/ja/LC_MESSAGES/exercise.mo new file mode 100644 index 0000000000000000000000000000000000000000..96195e2ce72c4f8017f707adb87dbe22dd3bc6b3 GIT binary patch literal 315 zcmYMsyH3L}6b4{(RTVa72D8Cnpr}KYC=*JhO086>g&C8Y)KNH&YzKwcK=1?%Ol%0o zz6oo14F0r2J@V(@m!tD@xckabJ8%R&*n<(YbqgJkZ~!@c!6WR0*ji@~iM5)8VB781 zR#GdQYNy!L6qVP8xHoKKO|DWehI4VFtix-_r{zLZE<1@o=1Me!FKE!IdGe$cx!i zsY32m?a#|XYKnNekk%<5U(W`jzv;7*+`Y0Qq14PZWg+k1X&;OvWtGe@BbULXsH`l+ nz}N>Daw=C>7hgtveT+|tAIH3V8U?KR{%n@d?Dzex`FLS}Pij+A literal 0 HcmV?d00001 diff --git a/sphinx_exercise/translations/locales/ja/LC_MESSAGES/exercise.po b/sphinx_exercise/translations/locales/ja/LC_MESSAGES/exercise.po new file mode 100644 index 0000000..dedc979 --- /dev/null +++ b/sphinx_exercise/translations/locales/ja/LC_MESSAGES/exercise.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-Exercise\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ja\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Exercise" +msgstr "練習" + +msgid "Solution to" +msgstr "解答" diff --git a/sphinx_exercise/translations/locales/ko/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/ko/LC_MESSAGES/exercise.mo new file mode 100644 index 0000000000000000000000000000000000000000..2f7877a44c708685e931a8bb00aaeae98ea02c39 GIT binary patch literal 315 zcmYMsyH3L}6b4{(6*3z$gV|s(P}HGHlnJF$rBJpA4+d<(KV6J!#2Fl~` z0+e^)Pb<_TfBtue*jR&x++yV;sb zYwa@QH5=KY3dWKMmJOYq=`6_JMBZxW@fwLyIW<(v|9(E`4bshT>->^mTMC+j9KV!0 z5<%DDqAZl5SY%V>ybj6DxGOuGKBve(XeU$3?8HzWiO#(Vyss#)RE`;smJf@{sX}(G md-9Q>a&`5|RV>!W@ MF~LQkjERx&0TZYQTL1t6 diff --git a/sphinx_exercise/translations/locales/nl/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/nl/LC_MESSAGES/exercise.mo index d70196d012f1c2d52d8fc58cc529ad9ce88c137b..62829c7d0602bab9a80ae04512b2707c2b281ee7 100644 GIT binary patch delta 79 zcmcb`bckt!h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZs+17cl91_oXrZ33i$h=Cc1 KL4avu;Y$Eij|Z#( delta 103 zcmX@abc<<%NGvx41A`9`gFpoka{zHA5QD^~*5W6xmFz^CtA0Q1xaKH>@ MF~LQkjERvi0S$%-LI3~& diff --git a/sphinx_exercise/translations/locales/no/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/no/LC_MESSAGES/exercise.mo index 79b34f0643dc04be22f8e2fa219f18e3adba883d..8c486ae0bf2ded2265cf30a2cb70e97533694f23 100644 GIT binary patch delta 79 zcmcb`bckt!h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZs+2Vz}D1_mA=Z3?7;h=Cc1 KL4avu;Y$Eis|T$B delta 103 zcmX@abc<<%NGvx41A`9`gFpoka{zHA5QD^@ MF~LQkjERvi0S&qcLjV8( diff --git a/sphinx_exercise/translations/locales/pl/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/pl/LC_MESSAGES/exercise.mo index 7bc44658fd4a3ad9abefbb329be17ded79d3c18f..2263e21dbad4aa1da607d483031a6e7442bfefec 100644 GIT binary patch delta 79 zcmaFBbb@Juh$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS0%Bc81_pj0Z2_c#h=Cc1 KL4avu;d=mCJqO4D delta 103 zcmX@X^nhuCNGvx41A`9`gFpoka{zHA5QD^~%5W6xmFz^HE03Z!SaKH>@ MF~LQkjERx&0Te_CUH||9 diff --git a/sphinx_exercise/translations/locales/pt/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/pt/LC_MESSAGES/exercise.mo index 13bce10e9c4a6c122484e9bcbef32a3cc2d26da6..f4c1e6eb06b869bda3f2a9dec4c7f3ae6fbff6f8 100644 GIT binary patch delta 79 zcmcc5bew5|h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS0%Bc81_nMLZ2_c#h=Cc1 KL4avu;X43WhzG;~ delta 103 zcmX@kbf0O0NGvx41A`9`gFpoka{zHA5QD^~%5W6xmFz^BC03Z!SaKH>@ MF~LQkjERx&024~%5W6xmFz^HE03Z!SaKH>@ MF~LQkjERx&0Te_CUH||9 diff --git a/sphinx_exercise/translations/locales/ru/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/ru/LC_MESSAGES/exercise.mo index 1dcb5f56f6f28deefcea3d4e764d2bc5970c8f81..7e98d304ec72f7df1238f8be80b5458a1e0829ee 100644 GIT binary patch delta 79 zcmaFEbcJbxh$|}t1A`9`gFpfha{zH75OV`@77%X(;xZr>0b*T71_nVO?F6KOh=Cc1 KL4avu;coz9(Fg(n delta 103 zcmcb@^oD7INGvx41A`9`gFpoka{zHA5QD^@ MF~LQkjERxI0U{^}m;e9( diff --git a/sphinx_exercise/translations/locales/sv/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/sv/LC_MESSAGES/exercise.mo index 2000d94d834cf069bf019140368faad489422ae9..f1b21db6703a3f8835659009cc4b7e57ab0d981e 100644 GIT binary patch delta 79 zcmcc3beL&^h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZs+2Vz}D1_oXrZ3?7;h=Cc1 KL4avu;VS@DU@ MF~LQkjERx201meZM*si- diff --git a/sphinx_exercise/translations/locales/ta/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/ta/LC_MESSAGES/exercise.mo index 3c40aebbf323139f1123747bec50c8f72569a67d..c6128577b4b8e349be5bba28e98dfc37bd4f5e48 100644 GIT binary patch delta 79 zcmaFIbd70(h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZr>1!7%B1_mJ@?F^)Wh=Cc1 KL4avu;a>n`R|pFL delta 103 zcmcb{^p0tQNGvx41A`9`gFpoka{zHA5QD^@ MF~LQkjERwd0VGxkp#T5? diff --git a/sphinx_exercise/translations/locales/tr/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/tr/LC_MESSAGES/exercise.mo new file mode 100644 index 0000000000000000000000000000000000000000..1cadb0980fde7e1ba772c4ae11f24c12a5fbf1c3 GIT binary patch literal 323 zcmYMsy-ve05CCBFCn3Yc%wRSc3=}a`jxr#WN|jovQVTOCHL0uQ9Gx8$cmbY(nP=$I zi7n+dcor_LP*47R_TA}zPxe0<#U42&x8#5fNE=V&kZ5v5=444;$uW^To4%q8NTf53-h}vJ(v#io9BS|{24w=Nn_9?}=sw%P2O6?UXYCH;qr5_$ t%bvr+D*@&D>*Je9Y@YEsh_hI9E+WqE^3~$!E36h+Xx4l*%lGEHV1N4yR&M|R literal 0 HcmV?d00001 diff --git a/sphinx_exercise/translations/locales/tr/LC_MESSAGES/exercise.po b/sphinx_exercise/translations/locales/tr/LC_MESSAGES/exercise.po new file mode 100644 index 0000000..9a3b698 --- /dev/null +++ b/sphinx_exercise/translations/locales/tr/LC_MESSAGES/exercise.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-Exercise\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Exercise" +msgstr "Alıştırma" + +msgid "Solution to" +msgstr "Çözüm" diff --git a/sphinx_exercise/translations/locales/uk/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/uk/LC_MESSAGES/exercise.mo index a766c2ec61eec5031d4154d964b74db49a3f7fa6..7f921d6c99cea5d583a293948bf30d06eb502c25 100644 GIT binary patch delta 79 zcmaFKbdhO-h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS0b*T71_m)8Z3U!(h=Cc1 KL4avu;ST^`(g*GU delta 103 zcmcb}^pa_UNGvx41A`9`gFpoka{zHA5QD^~v5W6xmFo*%^ARrAyaKH>@ MF~LQkjERvy03DGCga7~l diff --git a/sphinx_exercise/translations/locales/vi/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/vi/LC_MESSAGES/exercise.mo index e1270850818fc9e5280add00f9ab36b564920304..21dd0abfbf6e7060632328e241c2c4f576f251c9 100644 GIT binary patch delta 79 zcmaFJbdqU;h$|}t1A`9`gFpfha{zH75OV`@77%X(;xZuS0%Bc81_l8jZ2_c#h=Cc1 KL4avu;RgU&@(0WS delta 103 zcmX@f^pI(SNGvx41A`9`gFpoka{zHA5QD^~%5W6xmFbDwY03Z!SaKH>@ MF~LQkjERvS02M(9VgLXD diff --git a/sphinx_exercise/translations/locales/zh_CN/LC_MESSAGES/exercise.mo b/sphinx_exercise/translations/locales/zh_CN/LC_MESSAGES/exercise.mo new file mode 100644 index 0000000000000000000000000000000000000000..d28b54bf92b57d09d9b46620ca00c25bcabc2a89 GIT binary patch literal 318 zcmYMs%}N6?5C`!1iNu>{5AkLX(N+Y@E_*6lD6~>&^{R0@?xw7hCCSR_)mN~0!Gk9s zp!hDHg!&lHwn&Hk^3TUG-v`?>Mzuu_$vN2}eNxvg*&~YVlPQ^#N3u(r8>_saq_vzw z!8YryuDAl5Xa{U$^3rRA!W%ZUW(tXyy@|XA>*zHQqaxE-$^U*n=ndlaZ|kJVI|eO3`aaXq2eO95n2PG92i?5fT`5XKFcwc Date: Tue, 21 Oct 2025 12:07:26 +1100 Subject: [PATCH 2/3] Prepare release v1.1.0 - 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 --- CHANGELOG.md | 8 ++- RELEASE.md | 109 +++++++++++++++++++++++++++++ docs/source/releases/index.md | 8 +-- docs/source/releases/unreleased.md | 66 ----------------- docs/source/releases/v1.1.0.md | 99 ++++++++++++++++++++++++++ 5 files changed, 217 insertions(+), 73 deletions(-) create mode 100644 RELEASE.md delete mode 100644 docs/source/releases/unreleased.md create mode 100644 docs/source/releases/v1.1.0.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 71cb336..a3883db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [v1.1.0](https://github.com/executablebooks/sphinx-exercise/tree/v1.1.0) (TBD) ### New ✨ @@ -19,8 +19,14 @@ - Added internationalization section to syntax documentation - Updated README with i18n feature highlights - Improved translation README with detailed contribution guidelines +- Created releases documentation structure in `docs/releases/` +- Added Copilot instructions for project maintenance +## [v1.0.1](https://github.com/executablebooks/sphinx-exercise/tree/v1.0.1) (2024-XX-XX) + +_No changelog available for this version._ + ## [v0.4.1](https://github.com/executablebooks/sphinx-exercise/tree/v0.4.1) (2023-1-23) ### Improved 👌 diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..4c01d1d --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,109 @@ +# Release Checklist for v1.1.0 + +This document provides the step-by-step process to release version 1.1.0 of sphinx-exercise. + +## Pre-Release Checklist + +- [ ] All tests pass locally +- [ ] All tests pass on CI +- [ ] Documentation builds successfully +- [ ] CHANGELOG.md is up to date with release date +- [ ] Version number updated in `sphinx_exercise/__init__.py` +- [ ] Release notes finalized in `docs/source/releases/v1.1.0.md` +- [ ] All PRs for this release are merged + +## Version Update + +Update the version number in: + +1. **`sphinx_exercise/__init__.py`**: + ```python + __version__ = "1.1.0" + ``` + +2. **`CHANGELOG.md`**: + - Replace `(TBD)` with the actual release date + - Change link to point to the release tag + +## Release Steps + +### 1. Create Release Commit + +```bash +# Ensure you're on main branch and up to date +git checkout main +git pull origin main + +# Update version in __init__.py +# Update CHANGELOG.md with release date +# Commit changes +git add sphinx_exercise/__init__.py CHANGELOG.md docs/source/releases/v1.1.0.md +git commit -m "Release v1.1.0" +``` + +### 2. Create Git Tag + +```bash +git tag -a v1.1.0 -m "Release version 1.1.0 - Internationalization support" +``` + +### 3. Push to GitHub + +```bash +git push origin main +git push origin v1.1.0 +``` + +### 4. Create GitHub Release + +1. Go to https://github.com/executablebooks/sphinx-exercise/releases/new +2. Select tag: `v1.1.0` +3. Release title: `v1.1.0 - Internationalization Support` +4. Description: Copy content from `docs/source/releases/v1.1.0.md` +5. Click "Publish release" + +### 5. Publish to PyPI + +```bash +# Clean previous builds +rm -rf dist/ build/ *.egg-info + +# Build distribution +python -m build + +# Upload to PyPI (requires PyPI credentials) +python -m twine upload dist/* +``` + +### 6. Update Documentation + +The documentation should automatically build from the new tag on ReadTheDocs. Verify at: +https://ebp-sphinx-exercise.readthedocs.io/en/latest/ + +### 7. Post-Release + +1. Update `docs/source/releases/index.md` to include v1.1.0 +2. Create new "Unreleased" section in CHANGELOG.md for future changes +3. Announce release on relevant channels + +## Version Numbering + +This project follows [Semantic Versioning](https://semver.org/): + +- **MAJOR** version for incompatible API changes +- **MINOR** version for new functionality in a backward compatible manner (this release) +- **PATCH** version for backward compatible bug fixes + +## Release Highlights for Announcement + +**sphinx-exercise v1.1.0** is now available! 🎉 + +This release adds comprehensive internationalization support: +- ✨ Support for 27 languages including Chinese, Japanese, Korean, Arabic, and Hindi +- 🌍 Automatic language detection from Sphinx configuration +- 📚 Enhanced documentation with i18n examples and contribution guides +- 🛠️ JSON-based translation system for easy community contributions + +Install or upgrade: `pip install --upgrade sphinx-exercise` + +Full release notes: https://github.com/executablebooks/sphinx-exercise/releases/tag/v1.1.0 diff --git a/docs/source/releases/index.md b/docs/source/releases/index.md index 2bec1ff..c301282 100644 --- a/docs/source/releases/index.md +++ b/docs/source/releases/index.md @@ -5,11 +5,7 @@ This section contains detailed release notes for sphinx-exercise versions. ```{toctree} :maxdepth: 1 -unreleased +v1.1.0 ``` -## Quick Links - -- [Latest Release](https://github.com/executablebooks/sphinx-exercise/releases/latest) -- [All Releases](https://github.com/executablebooks/sphinx-exercise/releases) -- [Changelog](https://github.com/executablebooks/sphinx-exercise/blob/main/CHANGELOG.md) +For a complete list of all changes across versions, see the [CHANGELOG](https://github.com/executablebooks/sphinx-exercise/blob/main/CHANGELOG.md). diff --git a/docs/source/releases/unreleased.md b/docs/source/releases/unreleased.md deleted file mode 100644 index d6a2a17..0000000 --- a/docs/source/releases/unreleased.md +++ /dev/null @@ -1,66 +0,0 @@ -# Unreleased Changes - -This document tracks changes that have been merged but not yet released. - -## Internationalization Support - -### New Features - -`sphinx-exercise` now includes comprehensive internationalization (i18n) support, allowing the extension to display exercise and solution labels in 27 different languages. - -#### Supported Languages - -The extension now supports the following languages: - -- **East Asian**: Chinese, Japanese, Korean -- **South Asian**: Bengali, Hindi, Tamil -- **Middle Eastern**: Arabic, Turkish -- **European**: Czech, Dutch, French, German, Greek, Hungarian, Italian, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Ukrainian -- **Southeast Asian**: Indonesian, Malay, Vietnamese - -#### Automatic Language Detection - -The extension automatically detects your Sphinx project's language configuration and applies the appropriate translations. Simply set the `language` option in your `conf.py`: - -```python -# For Spanish -language = 'es' - -# For Chinese -language = 'zh_CN' - -# For Japanese -language = 'ja' -``` - -For Jupyter Book projects, configure in `_config.yml`: - -```yaml -sphinx: - config: - language: zh_CN # For Chinese -``` - -#### Translation Examples - -With language configured, the directive labels automatically translate: - -- **Spanish**: "Exercise" → "Ejercicio", "Solution to" → "Solución a" -- **Chinese**: "Exercise" → "练习", "Solution to" → "解答" -- **Japanese**: "Exercise" → "練習", "Solution to" → "解答" -- **French**: "Exercise" → "Exercice", "Solution de" → "Solution de" -- **German**: "Exercise" → "Übung", "Solution to" → "Lösung zu" - -### Contributing Translations - -We welcome contributions for additional languages or improvements to existing translations. The translation files are maintained in `sphinx_exercise/translations/jsons/` as JSON files for easy editing. See the [translation guide](https://github.com/executablebooks/sphinx-exercise/tree/main/sphinx_exercise/translations) for details. - -### Documentation Updates - -- Added internationalization section to [syntax guide](../syntax.md#internationalization-i18n) -- Updated README with i18n feature highlights -- Enhanced translation documentation with contribution guidelines - ---- - -For the complete list of changes, see the [CHANGELOG](https://github.com/executablebooks/sphinx-exercise/blob/main/CHANGELOG.md). diff --git a/docs/source/releases/v1.1.0.md b/docs/source/releases/v1.1.0.md new file mode 100644 index 0000000..3a3a19a --- /dev/null +++ b/docs/source/releases/v1.1.0.md @@ -0,0 +1,99 @@ +# Release v1.1.0 + +**Release Date**: TBD + +This release 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 + +The extension now supports **27 languages** with automatic language detection: + +**East Asian**: Chinese (zh_CN), Japanese (ja), Korean (ko) + +**South Asian**: Bengali (bn), Hindi (hi), Tamil (ta) + +**Middle Eastern**: Arabic (ar), Turkish (tr) + +**European**: Czech (cs), Dutch (nl), French (fr), German (de), Greek (el), Hungarian (hu), Italian (it), Norwegian (no), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Spanish (es), Swedish (sv), Ukrainian (uk) + +**Southeast Asian**: Indonesian (id), Malay (ms), Vietnamese (vi) + +### Automatic Language Detection + +The extension automatically detects your Sphinx project's language configuration and applies the appropriate translations: + +```python +# conf.py +language = 'zh_CN' # Chinese +``` + +```yaml +# _config.yml (Jupyter Book) +sphinx: + config: + language: ja # Japanese +``` + +### Translation Examples + +With language configured, directive labels automatically translate: + +- **Spanish**: "Exercise" → "Ejercicio", "Solution to" → "Solución a" +- **Chinese**: "Exercise" → "练习", "Solution to" → "解答" +- **Japanese**: "Exercise" → "練習", "Solution to" → "解答" +- **French**: "Exercise" → "Exercice", "Solution to" → "Solution de" +- **German**: "Exercise" → "Übung", "Solution to" → "Lösung zu" +- **Arabic**: "Exercise" → "تمرين", "Solution to" → "الحل لـ" +- **Hindi**: "Exercise" → "अभ्यास", "Solution to" → "समाधान" + +## 👌 Improvements + +- **JSON-based translations**: Source translations stored in easy-to-edit JSON format +- **Alphabetical organization**: All language entries sorted alphabetically for maintainability +- **Automated build process**: Script to generate `.po` and `.mo` files from JSON sources +- **Enhanced documentation**: Comprehensive guides for using and contributing translations + +## 📚 Documentation Updates + +- Added internationalization section to [syntax guide](../syntax.md#internationalization-i18n) +- Updated README with i18n feature highlights +- Created releases documentation structure +- Enhanced translation README with contribution workflow +- Added Copilot instructions for maintainers + +## 🛠️ Infrastructure + +- Added `.github/copilot-instructions.md` for project maintenance guidelines +- Created `docs/releases/` structure for release documentation +- Improved translation contribution workflow + +## 🙏 Contributing Translations + +We welcome contributions for additional languages or improvements to existing translations! + +Translation files are maintained in `sphinx_exercise/translations/jsons/` as JSON files for easy editing. See the [translation guide](https://github.com/executablebooks/sphinx-exercise/tree/main/sphinx_exercise/translations) for details on how to contribute. + +## 📦 Installation + +Install or upgrade via pip: + +```bash +pip install --upgrade sphinx-exercise +``` + +For development installation: + +```bash +git clone https://github.com/executablebooks/sphinx-exercise +cd sphinx-exercise +pip install -e . +``` + +## 🔗 Links + +- [Full Changelog](https://github.com/executablebooks/sphinx-exercise/blob/main/CHANGELOG.md) +- [Documentation](https://ebp-sphinx-exercise.readthedocs.io/en/latest/) +- [GitHub Repository](https://github.com/executablebooks/sphinx-exercise) +- [Issue Tracker](https://github.com/executablebooks/sphinx-exercise/issues) From 135dafeb7f90fd674952da67fe323f3b3fe6f367 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 21 Oct 2025 12:10:23 +1100 Subject: [PATCH 3/3] Fix import ordering in directive.py and nodes.py - Move sphinx.locale imports to top of file - Fixes E402 pre-commit errors --- MANIFEST.in | 2 +- sphinx_exercise/__init__.py | 1 + sphinx_exercise/directive.py | 10 +++++----- sphinx_exercise/nodes.py | 9 ++++++--- sphinx_exercise/translations/_convert.py | 9 ++++++++- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 7edfdf4..b950eb7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,4 +8,4 @@ recursive-include sphinx_exercise *.css recursive-include sphinx_exercise *.json recursive-include sphinx_exercise *.mo recursive-include sphinx_exercise *.po -recursive-include sphinx_exercise *.py \ No newline at end of file +recursive-include sphinx_exercise *.py diff --git a/sphinx_exercise/__init__.py b/sphinx_exercise/__init__.py index 60ed3b9..c7bf3dc 100644 --- a/sphinx_exercise/__init__.py +++ b/sphinx_exercise/__init__.py @@ -71,6 +71,7 @@ # Callback Functions + def purge_exercises(app: Sphinx, env: BuildEnvironment, docname: str) -> None: """Purge sphinx_exercise registry""" diff --git a/sphinx_exercise/directive.py b/sphinx_exercise/directive.py index 2db6d5b..376ba65 100644 --- a/sphinx_exercise/directive.py +++ b/sphinx_exercise/directive.py @@ -10,9 +10,12 @@ from typing import List from docutils.nodes import Node - -from sphinx.util.docutils import SphinxDirective +from docutils import nodes from docutils.parsers.rst import directives +from sphinx.util.docutils import SphinxDirective +from sphinx.util import logging +from sphinx.locale import get_translation + from .nodes import ( exercise_node, exercise_enumerable_node, @@ -24,12 +27,9 @@ exercise_subtitle, solution_title, ) -from docutils import nodes -from sphinx.util import logging logger = logging.getLogger(__name__) -from sphinx.locale import get_translation MESSAGE_CATALOG_NAME = "exercise" translate = get_translation(MESSAGE_CATALOG_NAME) diff --git a/sphinx_exercise/nodes.py b/sphinx_exercise/nodes.py index c34fd36..711500a 100644 --- a/sphinx_exercise/nodes.py +++ b/sphinx_exercise/nodes.py @@ -13,13 +13,13 @@ from docutils import nodes as docutil_nodes from sphinx import addnodes as sphinx_nodes from sphinx.writers.latex import LaTeXTranslator +from sphinx.locale import get_translation + from .latex import LaTeXMarkup logger = logging.getLogger(__name__) LaTeX = LaTeXMarkup() - -from sphinx.locale import get_translation MESSAGE_CATALOG_NAME = "exercise" translate = get_translation(MESSAGE_CATALOG_NAME) @@ -54,7 +54,10 @@ class solution_end_node(docutil_nodes.Admonition, docutil_nodes.Element): class exercise_title(docutil_nodes.title): def default_title(self): title_text = self.children[0].astext() - if title_text == f"{translate('Exercise')}" or title_text == f"{translate('Exercise')} %s": + if ( + title_text == f"{translate('Exercise')}" + or title_text == f"{translate('Exercise')} %s" + ): return True else: return False diff --git a/sphinx_exercise/translations/_convert.py b/sphinx_exercise/translations/_convert.py index 882f954..d9943b2 100644 --- a/sphinx_exercise/translations/_convert.py +++ b/sphinx_exercise/translations/_convert.py @@ -5,6 +5,7 @@ MESSAGE_CATALOG_NAME = "exercise" + def convert_json(folder=None): folder = folder or Path(__file__).parent @@ -19,7 +20,13 @@ def convert_json(folder=None): english = data[0]["text"] for item in data[1:]: language = item["symbol"] - out_path = folder / "locales" / language / "LC_MESSAGES" / f"{MESSAGE_CATALOG_NAME}.po" + out_path = ( + folder + / "locales" + / language + / "LC_MESSAGES" + / f"{MESSAGE_CATALOG_NAME}.po" + ) if not out_path.parent.exists(): out_path.parent.mkdir(parents=True) if not out_path.exists():