User talk:DomoViridi/TempTest/Dict
From Gramps
Contents
PAGELANGUAGE does not work
It appears that the {{PAGELANGUAGE}} will always only give en as the language.
- Even on pages with "/nl" calling it
- Using
<span lang="nl">{{Dict|...}}</span>has no apparent effect.
--DomoViridi (talk) 10:48, 8 March 2026 (UTC)
Version that allows both 'default' and 'nl' for the Dutch description
Accept 'default' as an alternative to the 'nl' parameter
What should the template do
For any country code (CC):
- If 'lang=CC' and 'CC' is given, show CC text.
- If 'lang=nl' and 'nl' is not given, but 'default' is given, show 'default' text.
- If 'lang=nl' and 'nl' is not given, and 'default' is not given, show XX
- If 'lang!=nl' and 'CC' is not given, but 'default' is given, show XX
- If 'lang!=nl' and 'CC' is not given, and 'default' not given, show XX
No description for language, then no output
Solution 1: Show nothing if there is no descriptive text in the lang language That is: XX is nothing
{{#ifeq: {{{lang|}}} | nl
| {{#if: {{{nl|}}}
| ;{{{word|{{{1}}} }}}:{{{nl|}}}
| {{#if: {{{default|}}}
|;{{{word|{{{1}}} }}}:{{{default|}}}
| {{#if: {{{ {{{lang}}}| }}}
|;{{{word|{{{1}}} }}}:{{{ {{{lang}}}| }}}
}}
No description for language, then only lemma
Solution 2: Show only the lemma if there is no descriptive text in the lang language
That is XX: is ;{{{word}}}:
;{{{word|{{{1}}} }}}:{{#ifeq: {{{lang|}}} | nl
| {{#if: {{{nl|}}}
| {{{nl|}}}
| {{{default|}}}
}}
| {{{ {{{lang}}}| }}}
}}
--DomoViridi (talk) 18:13, 9 March 2026 (UTC)
To add full= parameter
Input:
{{Dict|lang=en|A.D.|full=Anno Domini|en=the year of our Lord}}
Text between parentheses
- A.D. (Anno Domini)
- the year of our Lord
Wiki code:
;A.D. (Anno Domini):the year of our Lord
To achieve this:
- Replace all
;{{{word|{{{1}}} }}}:with
;{{{word|{{{1}}} }}}{{#if:{{{full|}}}| ({{{full}}})}}:
Text after a dash
- A.D. - Anno Domini
- the year of our Lord
Wiki code:
;A.D. - Anno Domini:the year of our Lord
to achieve this:
- Replace all
;{{{word|{{{1}}} }}}:with
;{{{word|{{{1}}} }}}{{#if:{{{full|}}}| - {{{full}}} }}: