Template:Dict
This template produces one lemma plus a description in a selected language.
It is intended for the Latin words and expressions article and its translated pages, where in every translation the lemmas are in Latin, but the description should only show the selected translation.
Code
(Prettified for clarity. The actual code avoids extra newlines and spaces.)
;{{{word|{{{1}}} }}}{{#if:{{{full|}}}| - {{{full}}} }}:
{{#ifeq: {{{lang|}}} | nl
| {{{nl|{{{default|}}} }}}
| {{{ {{{lang}}}| }}}
}}
Explanation:
- Start the display list entry
;lemma:...:- Use either word or the first parameter for the lemma.
- If full was given, attach it to the lemma.
- Separate the expansion of the abbreviation from the main lemma with a dash.
- Continue with the description text:
- If lang is nl then
- Use the nl parameter. It it's missing, use the default parameter
- For any other language:
- Expand the lang parameter, giving us a country code
- Use that country code as the name of a parameter, and fill in the value of that parameter.
- If lang is nl then
Usage
Recommended standard use:
{{Dict|lang=en|sillius soddus|
en=silly sod|
nl=sukkel|
... (descriptions in more languages)
}}
Note: unnamed parameters should not end in a newline
The lemma can also be passed in the word parameter:
{{Dict|lang=nl
|word=sillius soddus
|en=silly sod
|nl=sukkel
}}
Legacy usage with default parameter for Dutch description:
{{Dict|lang=en
|word=sillius soddus
|default=sukkel
|en=silly sod
}}
Usage for an abbreviation, with full parameter:
{{Dict|lang=en|A.D.|full=Anno Domini
|en=in the year of our Lord
|nl=in het jaar onzes Heren
}}
Example where the requested translated text is not yet available (yields only lemma):
{{Dict|lang=en|sillius soddus|default=sukkel}}
Parameters
- The lang parameter is mandatory, and must be the country code for the language to be shown. Its value will be used to select which country code parameter will be used for the description text. In normal use the editor does not need to fill in this parameter. It will be passed into the template where this template is used. Usual calls to this template will look like:
{{Dict|lang={{}}|word=...|en=...|...}}
- The first unnamed parameter will be printed as the lemma. It can also be passed as the word parameter.
- The full parameter is optional, and useful for abbreviations, to add the full (i.e. expanded) version of the lemma. It will be added (with some formatting) to the lemma text.
- The other parameters give the description text for various languages. The name of the parameter must be the country code for the language in which the description is written.
- For historic reasons, default is allowed as an alternative for nl. Do not use the default parameter for new entries, use nl instead. This parameter is obsolete, and its support will be withdrawn in the future.
It is advisable to have at least an en parameter, so descriptions will show up on the default English page.
The output
This template will construct a description list entry (a bold lemma, with on the next line an indented description). The description will be chosen from the list of descriptions in different languages the one given in the lang parameter.
On an English page (default)
- sillius soddus
- silly sod
On a Dutch page
- sillius soddus
- sukkel
With an expanded abbreviation
- A.D. - Anno Domini
- the year of our Lord
- S.S. - Sillius Soddus
- silly sod
If the requested language is not available
- sillius soddus
If the chosen language (corresponding to the language of the page) is not present in the list given in the template call, only the lemma will be printed.