PyCharm 2024.1 Help

Internationalization and Localization Support

Enable the Django plugin

This functionality relies on the Django plugin, which is bundled and enabled in PyCharm by default. If the relevant features aren't available, make sure that you didn't disable the plugin.

  1. Press Ctrl+Alt+S to open the IDE settings and then select Plugins.

  2. Open the Installed tab, find the Django plugin, and select the checkbox next to the plugin name.

Overview

Django provides support for Internationalization and Localization:

  • Internationalization (i18n) involves extracting strings out of your source code and presenting them as properties that are further referenced in the source code.

  • Localization enables translating these properties into the target languages.

Supported features

PyCharm provides helpful features that simplify working on software internationalization and localization issues. These features are:

  • Possibility to run i18n-related tasks of the manage.py utility.

  • Syntax highlighting in *.po files.

  • Intention action to surround blocks of text in Django templates.

  • Navigation between blocks of text and locales.

Prerequisites

Internationalization and Localization support is available for the Django applications.

  1. Download the gettext archive from http://ftp.gnu.org/pub/gnu/gettext/ utilities are downloaded and installed on your machine.

  2. Unpack the downloaded archive.

  3. Add the paths to the bin directories of gettext-runtime and gettext-tools to the $PATH variable.

  4. Create the locale directory in the project root.

  5. Set Django as the project template language.

Last modified: 05 April 2024