From aaa8b2e6638b1338dd8b3df5228a9909e753b90f Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Wed, 4 Dec 2024 14:00:38 +0100 Subject: [PATCH] providing_translations.md: Add an example to Translation Lookup Order --- .../localization/providing_translations.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/topics/reference_guide/localization/providing_translations.md b/topics/reference_guide/localization/providing_translations.md index 4f2ffdae5..b95b8c1ba 100644 --- a/topics/reference_guide/localization/providing_translations.md +++ b/topics/reference_guide/localization/providing_translations.md @@ -132,7 +132,7 @@ Translations can be provided on three different levels: In addition, translations can be [organized in directories or with file suffixes](#bundled-translations-structure), and the same translation can be provided by a [language pack](#language-packs) or [IDE/plugin](#bundled-translations). All these conditions determine how a single translation is resolved at runtime. -The priority is as follows: +The lookup order is as follows: 1. Translation file from the language pack. 2. Region level (for example, `zh_CN`, `zh_TW`) localization file: @@ -149,4 +149,14 @@ The priority is as follows: {type="alpha-lower"} +### Example + +Consider that the current IDE language is set to Simplified Chinese (`zh_CN`). +To find an example messages/MyBundle.properties message bundle for this language, the locations will be searched in the following order: +1. localization/zh/CN/messages/MyBundle.properties (region level) +2. messages/MyBundle_zh_CN.properties (region level) +3. localization/zh/messages/MyBundle.properties (language level) +4. messages/MyBundle_zh.properties (language level) +5. messages/MyBundle.properties (default) +