Message¶
Messages are given as key-value maps.
-
type
string
Required. The type string can be one of three keywords.
-
say
A generic message, useful for miscellaneous notes.
-
warn
A warning message, describing a non-critical issue with the user’s mods (eg. dirty mods).
-
error
An error message, decribing a critical installation issue (eg. missing masters, corrupt plugins).
-
-
content
string
orlocalised content list
Required. Either simply a GitHub Flavored Markdown string, or a list of localised content data structures. If the latter, one of the structures must be for English.
-
condition
string
A condition string that is evaluated to determine whether the message should be displayed: if it evaluates to true, the message is displayed, otherwise it is not. See Condition Strings for details.
-
subs
string list
A list of GitHub Flavored Markdown strings to be substituted into the message content string. The content string must use numbered specifiers (
%1%
,%2%
, etc.), where the numbers correspond to the position of the substitution string in this list to use, to denote where these strings are to be substituted.
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.
Equality¶
Two message data structures are equal if their type, content and condition fields are equal, after any subs values have been substituted into content strings. If the content field is a string, it is treated as a localised content list containing a single English-language string. String equality is case sensitive.
Examples¶
Translations by Google
type: say
condition: 'file("foo.esp")'
content:
- lang: en
text: 'An example link: <http://www.example.com>'
- lang: ru
text: 'Это пример ссылки: <http://www.example.com>'
would be displayed as
отмечать: Это пример ссылки: http://www.example.com
if the current language was Russian and foo.esp
was installed, while
type: say
content: 'An alternative [example link](http://www.example.com), with no translations.'
would be displayed as
отмечать: An alternative example link, with no translations.
In English,
type: say
content: 'A newer version of %1% [is available](%2%).'
subs:
- 'this plugin'
- 'http://www.example.com'
would be displayed as
Note: A newer version of this plugin is available.