Weblate Language Data
raw JSON → 2026.7 verified Mon Apr 27 auth: no python
Provides language definitions (names, plurals, country info) used by Weblate. Version 2026.7 requires Python >=3.11. Released on a monthly cadence alongside Weblate releases.
pip install weblate-language-data Common errors
error ModuleNotFoundError: No module named 'weblate' ↓
cause Trying to import from `weblate.language_data` assuming it's part of the main Weblate package.
fix
Install and import from the separate package:
pip install weblate-language-data then from weblate_language_data import COUNTRIES. error AttributeError: module 'weblate_language_data' has no attribute 'LANGUAGE' (or similar) ↓
cause Typo: the correct constant is `LANGUAGES` (plural).
fix
Use
from weblate_language_data import LANGUAGES error ImportError: cannot import name 'COUNTRIES' from 'weblate_language_data' ↓
cause The constant may have been renamed in a newer version. Check the source for available symbols.
fix
Run
python -c "import weblate_language_data; print(dir(weblate_language_data))" to list available exports. Warnings
breaking Python 3.11 minimum required starting from version 2026.7. Older Python versions will get ImportError or install failure. ↓
fix Upgrade Python to 3.11+ or pin to an older version (e.g., weblate-language-data==2025.12).
gotcha The package name uses hyphens on PyPI (weblate-language-data), but the import uses underscores (weblate_language_data). Common mistake: try to import weblate.language_data. ↓
fix Use `from weblate_language_data import ...`
gotcha LANGUAGES dict keys are language codes (e.g., 'cs_CZ') not just 'cs'. Use PLURAL_REPRESENTATIVES for plural forms with language-only codes. ↓
fix Check the exact key format in the source data.
Imports
- COUNTRIES wrong
from weblate.language_data import COUNTRIEScorrectfrom weblate_language_data import COUNTRIES - PLURAL_REPRESENTATIVES
from weblate_language_data import PLURAL_REPRESENTATIVES - LANGUAGES
from weblate_language_data import LANGUAGES
Quickstart
from weblate_language_data import COUNTRIES, LANGUAGES, PLURAL_REPRESENTATIVES
# List all languages
for code, name in LANGUAGES.items():
print(f"{code}: {name}")
# Get country name for a country code
print(COUNTRIES.get('cz', 'Czechia'))
# Get plural forms for a language
print(PLURAL_REPRESENTATIVES.get('cs', 'nplurals=3; plural=(n==1 ? 0 : n>=2 && n<=4 ? 1 : 2);'))