This document explains how to configure and override the available languages in the Docs application.
By default, the application supports the following languages (in priority order):
- English (en-us)
- French (fr-fr)
- German (de-de)
- Dutch (nl-nl)
- Spanish (es-es)
The default configuration is defined in src/backend/impress/settings.py:
LANGUAGES = values.SingleNestedTupleValue(
(
("en-us", "English"),
("fr-fr", "Français"),
("de-de", "Deutsch"),
("nl-nl", "Nederlands"),
("es-es", "Español"),
)
)You can override the available languages by setting the DJANGO_LANGUAGES environment variable. This is the recommended approach for customizing language support without modifying the source code.
The DJANGO_LANGUAGES variable expects a semicolon-separated list of language configurations, where each language is defined as code,Display Name:
DJANGO_LANGUAGES=code1,Name1;code2,Name2;code3,Name3
Example 1: English and French only
DJANGO_LANGUAGES=en-us,English;fr-fr,FrançaisExample 2: Add Italian and Chinese
DJANGO_LANGUAGES=en-us,English;fr-fr,Français;de-de,Deutsch;it-it,Italiano;zh-cn,中文Example 3: Custom subset of languages
DJANGO_LANGUAGES=fr-fr,Français;de-de,Deutsch;es-es,EspañolFor local development, you can set the DJANGO_LANGUAGES variable in your environment configuration file:
File: env.d/development/common.local
DJANGO_LANGUAGES=en-us,English;fr-fr,Français;de-de,Deutsch;it-it,Italiano;zh-cn,中文;For production deployments, add the variable to your production environment configuration:
File: env.d/production.dist/common
DJANGO_LANGUAGES=en-us,English;fr-fr,FrançaisWhen using Docker Compose, you can set the environment variable in your compose.yml or compose.override.yml file:
services:
app:
environment:
- DJANGO_LANGUAGES=en-us,English;fr-fr,Français;de-de,Deutsch- Use standard language codes (ISO 639-1 with optional region codes)
- Format:
language-region(e.g.,en-us,fr-fr,de-de) - Use lowercase for language codes and region identifiers
Languages are listed in priority order. The first language in the list is used as the fallback language throughout the application when a specific translation is not available.
Before adding a new language, ensure that:
- Translation files exist for that language in the
src/backend/locale/directory - The frontend application has corresponding translation files
- All required messages have been translated
The following languages have translation files available in src/backend/locale/:
br_FR- Breton (France)de_DE- German (Germany) - Usede-deen_US- English (United States) - Useen-useo_PL- Esperanto - Useeo-ples_ES- Spanish (Spain) - Usees-esfr_FR- French (France) - Usefr-frit_IT- Italian (Italy) - Useit-itnl_NL- Dutch (Netherlands) - Usenl-nlpt_PT- Portuguese (Portugal) - Usept-ptru_RU- Russian (Russia) - Useru-rusl_SI- Slovenian (Slovenia) - Usesl-sisv_SE- Swedish (Sweden) - Usesv-setr_TR- Turkish (Turkey) - Usetr-truk_UA- Ukrainian (Ukraine) - Useuk-uazh_CN- Chinese (China) - Usezh-cnzh_TW- Traditional Chinese (Taiwan) - Usezh-tw
Note: When configuring DJANGO_LANGUAGES, use lowercase with hyphens (e.g., pt-pt, ru-ru) rather than the directory name format.
We use Crowdin to manage translations for the Docs application. Crowdin allows our community to contribute translations and helps maintain consistency across all supported languages.
Want to add a new language or improve existing translations?
If you would like us to support a new language or want to contribute to translations, please get in touch with the project maintainers. We can add new languages to our Crowdin project and coordinate translation efforts with the community.
The application stores the user's language preference in a cookie named docs_language. The cookie path is set to / by default.
After changing the language configuration:
- Restart the application services
- Verify the language selector displays the correct languages
- Test switching between different languages
- Confirm that content is displayed in the selected language
- Verify the environment variable is correctly formatted (semicolon-separated, comma between code and name)
- Check that there are no trailing spaces in language codes or names
- Ensure the application was restarted after changing the configuration
If you add a new language but see untranslated text:
- Check if translation files exist in
src/backend/locale/<language_code>/LC_MESSAGES/ - Run Django's
makemessagesandcompilemessagescommands to generate/update translations - Verify frontend translation files are available
LANGUAGE_CODE: Default language code (default:en-us)LANGUAGE_COOKIE_NAME: Cookie name for storing user language preference (default:docs_language)LANGUAGE_COOKIE_PATH: Cookie path (default:/)