From: Bjørn Erik Pedersen Date: Wed, 12 Oct 2016 15:04:50 +0000 (+0200) Subject: docs: Add singular/plural i18n example X-Git-Tag: v0.18~179 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=faa64abd;p=brevno-suite%2Fhugo docs: Add singular/plural i18n example --- diff --git a/docs/content/content/multilingual.md b/docs/content/content/multilingual.md index d3f69f2e..0f3f4429 100644 --- a/docs/content/content/multilingual.md +++ b/docs/content/content/multilingual.md @@ -139,7 +139,19 @@ This uses a definition like this one in `i18n/en-US.yaml`: - id: wordCount translation: "This article has {{ .WordCount }} words." ``` +An example of singular and plural form: +``` +- id: readingTime + translation: + one: "One minute read" + other: "{{.Count}} minutes read" +``` +And then in the template: + +``` +{{ i18n "readingTime" .ReadingTime }} +``` To track down missing translation strings, run Hugo with the `--i18n-warnings` flag: ```bash