Providing Translations
Translations for IntelliJ Platform products and plugins can be provided in two ways:
Language Packs
Localizing IDEs is achieved by providing language packs (see available language packs). Language packs are IntelliJ Platform plugins containing translations of UI texts. Official language packs contain translations of all the UI texts used in the IDE and in plugins developed by JetBrains.
Please note that language packs aim for full IDE localization. If it is required to translate a plugin, see the Bundled Translations section.
Language packs must define their language. The language definition is provided in the plugin.xml
file with com.intellij.languageBundle
extension point (EP), e.g.:
The locale
attribute defines the translation language on two possible levels:
region level, e.g.:
zh-CN
- Chinese (Simplified),zh-TW
- Chinese (Taiwan)language level, e.g.,
ja
- Japanese
Language Selection
It is important to note that there is no language chooser available in the IDE and language packs serve as the IDE "language switcher". Installing a language pack changes the IDE language to the one defined by the languageBundle
EP. Only a single language pack can be installed at the same time, and restart is required for the translations to take effect.
Language Pack Translations Structure
See the translated elements list for the elements possible to translate. All the elements should be located in exactly the same paths as in original locations in their JAR files.
For example, if the original location of a message bundle is $PLUGIN_JAR$/messages/AbcBundle.properties, it must be located in $LANGUAGE_PACK_JAR$/messages/AbcBundle.properties.
It is allowed to organize them within localization directories or with file name language suffixes, but it is unnecessary as language pack can define only a single language.
In case of doubts, it is recommended to inspect the contents of existing language packs.
Bundled Translations
Since 2024.1, IntelliJ Platform partially supports providing translations directly bundled in the IDE or plugins. See the translated elements list for the elements possible to translate.
An IDE module or a plugin can provide multiple language translations in a single distribution, e.g., zh-CN
and ja
. Proper localization files will be used at runtime depending on the IDE language.
Bundled Translations Structure
Translations for a specific language can be organized in two ways:
Language directory: /localization/$LANGUAGE_CODE$/$REGION_CODE$ (
$REGION_CODE$
level is optional). Example:Original template description:
/fileTemplates/code/JavaDoc Class.java.html
Translated template description:
/localization/zh/CN/fileTemplates/code/JavaDoc Class.java.html
Localization suffix in file name: /intentionDescriptions/QuickEditAction/description_$LANGUAGE_CODE$_$REGION_CODE$.html. Example:
Original template description:
/intentionDescriptions/QuickEditAction/description.html
Translated template description:
/intentionDescriptions/QuickEditAction/description_zh_CN.html
The proper directory layout/file name suffixes is the only thing needed for the translations to work. No additional actions like registering EPs are needed.
Translated Elements
The following table contains the possible translated elements and information about their support in language packs and IDE/plugins.
Element | Language Pack | Bundled Translations |
---|---|---|
(*.properties files) | Yes | Since 2024.1 Use |
(*.html files in /inspectionDescriptions directory) | Yes | Since 2024.1 |
(*.html files in /intentionDescriptions directory) | Yes | Since 2024.1 |
(*.html files in the /fileTemplates directory) | Yes | 2024.2 (planned) |
(*.xml file in /postfixTemplates directory) | Yes | 2024.2 (planned) |
(*.xml file in /search) | Yes | 2024.2 (planned) |
Tips of the day (*.html files in tips directory) | Yes | 2024.2 (planned) |
See the IntelliJ Platform UI Guidelines | Text sections for good practices about writing UI texts.
Translation Priority
Translations can be provided on three different levels:
region-specific translation
language-specific translation
default translation (English)
In addition, translations can be organized in directories or with file suffixes, and the same translation can be provided by a language pack or IDE/plugin.
All these conditions determine how a single translation is resolved at runtime. The priority is as follows:
Region level (e.g.,
zh_CN
,zh_TW
) localization file:located within the localization directory of the language pack
located within the localization directory of the IDE or plugin
via suffix within the language pack
via suffix within the IDE or plugin
Language level (e.g.,
zh
) localization file:located within the localization directory of the language pack
located within the localization directory of the IDE or plugin
via suffix within the language pack
via suffix within the IDE or plugin
Default file (no suffix) within:
the language pack
the IDE or plugin