π Internationalization (i18n) Guide#
Status: Recommended Architecture
This document describes a recommended internationalization workflow for scikit-plots using Sphinx, PyData Sphinx Theme, and sphinx-intl.
Goals#
Single source of truth
Easy for contributors
Git-friendly
CI/CD friendly
Idempotent
Scalable
Future-proof
High-Level Architecture#
Git Repository
docs/
βββ index.rst
βββ api/
βββ tutorials/
βββ examples/
βββ glossary/
βββ conf.py
βββ Makefile
βββ locale/
βββ tr/
βββ fr/
βββ ja/
βββ zh_CN/
Documentation Lifecycle#
English Docs
β
βΌ
make gettext
β
βΌ
POT Templates
β
βΌ
sphinx-intl update
β
βΌ
PO Files
β
βΌ
Translators
β
βΌ
Compile Catalogs
β
βΌ
Localized HTML
Translation Workflow#
English Sources
β
βΌ
gettext
β
βΌ
*.pot
β
βΌ
sphinx-intl update
β
βΌ
locale/<lang>/LC_MESSAGES/*.po
β
βΌ
Translation
β
βΌ
HTML
Recommended Repository Layout#
docs/
βββ api/
βββ examples/
βββ glossary/
βββ tutorials/
βββ user_guide/
βββ conf.py
βββ Makefile
βββ locale/
βββ tr/
βββ fr/
βββ ja/
βββ zh_CN/
CI/CD#
PR
β
βΌ
Lint
β
βΌ
gettext
β
βΌ
Update catalogs
β
βΌ
Compile catalogs
β
βΌ
Build all languages
β
βΌ
Deploy
GitHub Pages#
/
βββ en/
βββ tr/
βββ fr/
βββ ja/
βββ zh_CN/
Suggested Make Targets#
make gettext
make update-po
make compile-po
make html
make html-en
make html-tr
make html-fr
make html-ja
make html-zh
make html-all
Best Practices#
Do#
Keep English as the canonical source.
Automate translation updates.
Validate every language in CI.
Keep one shared documentation tree.
Donβt#
Duplicate documentation.
Edit POT files manually.
Maintain language branches.
Translate API identifiers.
Recommended Language Roadmap#
Recommended Language Set#
Phase Language Locale Primary Coverage
1 English `en` Global (canonical source)
1 Simplified Chinese `zh_CN` China, Singapore
1 Spanish `es` Spain & Latin America
1 French `fr` Europe, Africa, Canada
2 Portuguese (Brazil) `pt_BR` Brazil
2 Japanese `ja` Japan
2 Turkish `tr` TΓΌrkiye
3 Arabic `ar` Middle East & North Africa
3 Indonesian `id` Indonesia
3 Russian `ru` Eastern Europe & Central Asia
3 Hindi `hi` India
Locale Directory#
docs/
βββ locale/
βββ en/
βββ zh_CN/
βββ es/
βββ fr/
βββ pt_BR/
βββ ja/
βββ tr/
βββ ar/
βββ id/
βββ ru/
βββ hi/
Rollout Strategy#
Phase 1:
en,zh_CN,es,frPhase 2:
pt_BR,ja,trPhase 3:
ar,id,ru,hi
Why this order?
Maximizes global documentation coverage.
Prioritizes large Python, AI, and scientific computing communities.
Keeps maintenance manageable.
Encourages community-driven translations.
Future Enhancements#
Weblate integration
Translation dashboards
Machine translation suggestions
Versioned multilingual docs
Theme language switcher
Continuous localization
Summary#
English
β
βΌ
gettext
β
βΌ
POT
β
βΌ
PO
β
βΌ
Translations
β
βΌ
Localized HTML
β
βΌ
GitHub Pages / Read the Docs
π Internationalization (i18n) Guide#
This guide follows the official Sphinx internationalization workflow.
References Used Throughout#
Sphinx Internationalization: https://www.sphinx-doc.org/en/master/usage/advanced/intl.html
sphinx-intl Quickstart: https://sphinx-intl.readthedocs.io/en/master/quickstart.html
PyData Sphinx Theme: https://pydata-sphinx-theme.readthedocs.io/
GNU gettext: https://www.gnu.org/software/gettext/manual/
Step 1 β Configure Sphinx#
Configure locale_dirs, gettext_compact, and language settings in
conf.py.
Verification
Official Sphinx i18n documentation: https://www.sphinx-doc.org/en/master/usage/advanced/intl.html
Step 2 β Extract Messages#
Run make gettext to generate POT templates.
Verification
https://www.sphinx-doc.org/en/master/usage/advanced/intl.html#gettext
Step 3 β Create Translation Catalogs#
Use sphinx-intl update.
Verification
https://sphinx-intl.readthedocs.io/en/master/quickstart.html
Step 4 β Translate#
Edit .po files using PO editors or translation platforms.
Verification
https://www.gnu.org/software/gettext/manual/
Step 5 β Build Localized Documentation#
Build each language independently.
Verification
https://www.sphinx-doc.org/en/master/usage/advanced/intl.html
Step 6 β CI/CD#
Automate gettext extraction, catalog validation, compilation, and language builds.
Verification
https://www.sphinx-doc.org/en/master/usage/builders/index.html
Step 7 β Deploy#
Publish /en, /tr, /fr, etc. on GitHub Pages or Read the Docs.
Verification
https://docs.readthedocs.io/
Further Reading#
Official Documentation#
Sphinx User Guide https://www.sphinx-doc.org/
Sphinx Internationalization https://www.sphinx-doc.org/en/master/usage/advanced/intl.html
sphinx-intl https://sphinx-intl.readthedocs.io/
PyData Sphinx Theme https://pydata-sphinx-theme.readthedocs.io/
GNU gettext https://www.gnu.org/software/gettext/manual/
Review Recommendations#
Executive Summary#
Adopt English as the canonical documentation source and use Sphinx gettext, sphinx-intl, and translation catalogs for all localized builds.
Suggested New Sections#
Architecture Decision Record (ADR)
Translation Governance
Contributor Guide
Translation Style Guide
Terminology Glossary
CI/CD Workflow
GitHub Pages Deployment
Read the Docs Deployment
Weblate Integration
Security Considerations
Performance & Scalability
Versioning Strategy
Troubleshooting
FAQ
Best Practices
Common Pitfalls
Migration Guide
Future Roadmap
Command Cheat Sheet
Complete Reference Index
Documentation Quality Checklist#
[ ] English is the single source of truth.
[ ] No duplicated documentation trees.
[ ] Every section cites official documentation.
[ ] CI validates every language.
[ ] API documentation remains untranslated.
[ ] Links are checked.
[ ] Search indexes are generated.
[ ] Translation coverage is monitored.
Recommended Official References#
Core#
https://www.sphinx-doc.org/
https://www.sphinx-doc.org/en/master/usage/advanced/intl.html
https://sphinx-intl.readthedocs.io/
https://pydata-sphinx-theme.readthedocs.io/
https://www.gnu.org/software/gettext/manual/
Deployment#
https://docs.readthedocs.io/
https://pages.github.com/
Localization Platforms#
https://weblate.org/
https://www.transifex.com/
https://crowdin.com/
Sphinx Extensions#
MyST Parser
sphinx-design
sphinx-copybutton
sphinx-gallery
sphinxcontrib-mermaid
autodoc
autosummary
intersphinx
napoleon
Community#
Write the Docs
DiΓ‘taxis documentation framework