The acceptable keys for variables are:
one
"=x"
where x is a number"<x"
other
format
Example:
# Using variables in raw string
YouLate: "You are %[1]d ${Minutes} late."
# [x] is the argument position,
# variables always have priority other fmt-style arguments,
# that's why we see [1] for houses and [2] for the string argument.
You can select what message will be shown based on a given plural count.
Except variables, each message can also have its plural form too!
zero
one
two
"=x"
"<x"
">x"
other
Let’s create a simple plural-featured message, it can use the Minutes variable we created above too.
FreeDay:
"=3": "You have three days and %[2]d ${Minutes} off." # "FreeDay" 3, 15
one: "You have a day off." # "FreeDay", 1
Let’s continue with a bit more advanced example, using template text + functions + plural + variables.
Vars:
- Houses:
one: "house"
other: "houses"
- Gender:
"=1": "She"
"=2": "He"
VarTemplatePlural:
one: "${Gender} is awesome!"
"=5": "{{call .InlineJoin .Names}} are awesome."