- ✅ Added internationalization settings
- ✅ Configured
locale_dirs,gettext_compact,gettext_uuid, andgettext_auto_build - ✅ Defined supported languages: English (en) and Russian (ru)
- ✅ Added
html_contextwith language names for the selector - ✅ Updated
html_sidebarsto include language selector at the top
- ✅ Added
sphinx-intl>=2.0.0dependency
- ✅ Created language selector dropdown with all available languages
- ✅ Added JavaScript for language switching functionality
- ✅ Handles URL path transformation for different languages
- ✅ Added comprehensive styling for language selector
- ✅ Styled dropdown, label, and hover/focus states
- ✅ Responsive design that fits the RTD theme sidebar
- ✅ Added
gettexttarget - extracts translatable messages - ✅ Added
update-potarget - updates PO files for all languages - ✅ Added
build-alltarget - builds all language versions
- ✅ Created comprehensive build script with progress indicators
- ✅ Extracts messages → Updates PO files → Builds all languages
- ✅ Error handling and status messages
- ✅ Made executable with proper permissions
- ✅
source/locale/en/LC_MESSAGES/*.po- 34 PO files created - ✅ Includes all documentation sections:
- Main pages (index, faq)
- User guides (all 20 guide files)
- API documentation (4 API files)
- Technical docs
- ✅ Complete internationalization guide
- ✅ Step-by-step workflow for translators
- ✅ Instructions for adding new languages
- ✅ Troubleshooting section
- ✅ Best practices and resources
⚠️ File already exists - recommend adding.mofiles to it
mapflow-docs-en/
├── source/
│ ├── locale/
│ │ ├── en/ # NEW: English source PO files
│ │ │ └── LC_MESSAGES/
│ │ │ ├── index.po
│ │ │ ├── faq.po
│ │ │ ├── userguides/
│ │ │ │ └── *.po (20 files)
│ │ │ └── api/
│ │ │ └── *.po (4 files)
│ │ ├── ru/ # EXISTING: Russian translations
│ │ └── *.pot # GENERATED: Template files
│ ├── _templates/
│ │ └── language_selector.html # NEW: Language switcher
│ ├── _static/
│ │ └── globals.css # UPDATED: Added language selector styles
│ └── conf.py # UPDATED: i18n configuration
├── build/
│ └── docs/
│ ├── en/ # NEW: English HTML output
│ └── ru/ # NEW: Russian HTML output
├── build_all_languages.sh # NEW: Comprehensive build script
├── Makefile # UPDATED: Added i18n targets
├── requirements.txt # UPDATED: Added sphinx-intl
├── I18N_GUIDE.md # NEW: Documentation
└── .gitignore # EXISTING (recommend update)
When you update RST files:
# Extract new translatable strings and update PO files
make update-po
# Build all language versions
make build-all- Open PO files in
source/locale/[LANG]/LC_MESSAGES/ - Translate the
msgstrvalues - Build and preview:
./build_all_languages.sh
-
Edit
source/conf.py:- Add
'es'tolanguageslist - Add
('Español', 'es')tohtml_context['languages']
- Add
-
Create PO files:
sphinx-intl update -p source/locale -l es
-
Update build scripts (Makefile and build_all_languages.sh)
-
Translate and build:
./build_all_languages.sh
- ✅ English: Complete source PO files (34 files)
- ✅ Russian: Existing translations ready to be updated
- ✅ Language Selector: Fully functional in sidebar
- ✅ Build System: Automated with make commands and shell script
- ✅ Documentation: Complete guide available
- Review English PO files - Ensure all source text is correct
- Update Russian translations - Run
make update-poto sync with new structure - Test build - Run
./build_all_languages.shto verify everything works - Update .gitignore - Add
*.mofiles to exclude compiled translations - Add more languages - Follow the guide in
I18N_GUIDE.md
- Configuration:
source/conf.py - Language Selector:
source/_templates/language_selector.html - Styles:
source/_static/globals.css - Build Script:
./build_all_languages.sh - Makefile:
./Makefile - Documentation:
./I18N_GUIDE.md - Source Translations:
source/locale/en/LC_MESSAGES/*.po
# Extract messages from RST files
make gettext
# Update all PO files
make update-po
# Build all languages
make build-all
# Or use the comprehensive script
./build_all_languages.sh
# Build specific language
sphinx-build -b html source build/docs/en
sphinx-build -b html -D language=ru source build/docs/ru✅ Professional internationalization setup using industry-standard gettext ✅ Separation of source and translated content ✅ Easy to add new languages ✅ Automated build process ✅ Version control friendly ✅ Language selector in sidebar for easy switching ✅ Comprehensive documentation for maintainers and translators