I’m trying to get the .Page
for a specific translation, but somehow this isn’t working as expected:
{{ warnf "all translations %s" .AllTranslations}}
{{ warnf "translation %s 1" (where $.AllTranslations "Language" "de") }}
{{ warnf "translation %s 2" (where .AllTranslations "Language" "de") }}
{{ warnf "translation %s 3" (where $.AllTranslations ".Language" "de") }}
{{ warnf "translation %s 4" (where .AllTranslations ".Language" "de") }}
{{ range .AllTranslations }}
{{ warnf "%s" .Language }}
{{ end }}}
Results in:
WARN 2021/04/19 12:13:59 all translations Pages(2)
WARN 2021/04/19 12:13:59 translation Pages(0) 1
WARN 2021/04/19 12:13:59 translation Pages(0) 2
WARN 2021/04/19 12:13:59 translation Pages(0) 3
WARN 2021/04/19 12:13:59 translation Pages(0) 4
WARN 2021/04/19 12:13:59 en
WARN 2021/04/19 12:13:59 de
BTW: Please add to the documentation that warnf
will discard duplicated messages by default - thats the reason why I added digits at each end…