From 06ce61de889d9262557a154ded22ec6ed2faaec1 Mon Sep 17 00:00:00 2001 From: sibir-ine Date: Wed, 7 Apr 2021 17:38:29 -0700 Subject: [PATCH 1/2] Update explanation in Language Support * Explain new implementation of close matches. * Wrapped lines at 80 characters. --- docs/metadata/data_structures/message.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/metadata/data_structures/message.rst b/docs/metadata/data_structures/message.rst index 3103e189..3d4e86c6 100644 --- a/docs/metadata/data_structures/message.rst +++ b/docs/metadata/data_structures/message.rst @@ -44,7 +44,21 @@ Messages are given as key-value maps. Language Support ---------------- -If a message's ``content`` value is a string, the message will use the string as its content if displayed. Otherwise, the first localised content structure with a language that matches LOOT's current language will be used as the message's content if displayed. If there are no matches, then the first structure in English will be used. +If a message's ``content`` value is a string, the message will use the string as +its content if displayed. Otherwise, the first localised content structure with +a language or locale code that matches LOOT's current language will be used as +the message's content if displayed. If there are no exact matches, LOOT will try +to find a close match. If LOOT's current language uses a locale code, it will +display the first structure with the same language code, but not another locale +code with the same language code. For example, if LOOT's current language has +locale code ``pt_BR``, it will display the first structure with language code +``pt`` (but not locale code ``pt_PT``) if none exist with locale code ``pt_BR``. +If LOOT's current language has a language code, it will display the first +structure with a locale code that contains that language code. For example, if +LOOT's current language has language code ``pt``, it will display the first +structure with locale code ``pt_PT`` or ``pt_BR`` if none exist with language +code ``pt``. If there are no exact or close matches, then the first structure in +English will be used. Equality -------- From 3b7694fc07a501901a0bf5fe55ef1eed82d39e53 Mon Sep 17 00:00:00 2001 From: sibir-ine Date: Wed, 7 Apr 2021 17:49:48 -0700 Subject: [PATCH 2/2] Update example in Examples * LOOT currently displays type of notification by background color, not explicitly. * Provided a manual translation of the example text, courtesy of a friend. --- docs/metadata/data_structures/message.rst | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/metadata/data_structures/message.rst b/docs/metadata/data_structures/message.rst index 3d4e86c6..6eea9d03 100644 --- a/docs/metadata/data_structures/message.rst +++ b/docs/metadata/data_structures/message.rst @@ -72,23 +72,21 @@ case sensitive. Examples -------- -*Translations by Google* - .. code-block:: yaml type: say - condition: 'file("foo.esp")' content: - lang: en text: 'An example link: ' - - lang: ru - text: 'Это пример ссылки: ' + - lang: zh_CN + text: '一个例子链接: ' + condition: 'file("foo.esp")' would be displayed as - отмечать: Это пример ссылки: http://www.example.com + * 一个例子链接: http://www.example.com -if the current language was Russian and ``foo.esp`` was installed, while +if the current language was Simplified Chinese and ``foo.esp`` was installed, while .. code-block:: yaml @@ -97,7 +95,7 @@ if the current language was Russian and ``foo.esp`` was installed, while would be displayed as - отмечать: An alternative `example link `_, with no translations. + * An alternative `example link `_, with no translations. In English, @@ -111,4 +109,4 @@ In English, would be displayed as - Note: A newer version of this plugin `is available `_. + * A newer version of this plugin `is available `_.