diff options
Diffstat (limited to 'docs/content/en/functions/i18n.md')
-rw-r--r-- | docs/content/en/functions/i18n.md | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/docs/content/en/functions/i18n.md b/docs/content/en/functions/i18n.md index 8f8c9642c..13f3a6f8f 100644 --- a/docs/content/en/functions/i18n.md +++ b/docs/content/en/functions/i18n.md @@ -1,33 +1,25 @@ --- title: i18n -linktitle: i18n description: Translates a piece of content based on your i18n configuration files. -date: 2017-02-01 -publishdate: 2017-02-01 -lastmod: 2017-02-01 categories: [functions] menu: docs: - parent: "functions" + parent: functions keywords: [internationalization,i18n,multilingual] signature: - "i18n KEY" - "T KEY" - "lang.Translate KEY" -workson: [] -hugoversion: relatedfuncs: [] -deprecated: false -aliases: [] --- This translates a piece of content based on your `i18n/en-US.toml` files. You can use the [go-i18n](https://github.com/nicksnyder/go-i18n) tools to manage your translations. The translations can exist in both the theme and at the root of your repository. -``` +```go-html-template {{ i18n "translation_id" }} ``` -{{% note "Alias `T`" %}} +{{% note %}} `T` is an alias to `i18n`. E.g. `{{ T "translation_id" }}`. {{% /note %}} @@ -35,7 +27,7 @@ This translates a piece of content based on your `i18n/en-US.toml` files. You ca Often you will want to use the page variables in the translation strings. To do so, pass the `.` context when calling `i18n`: -``` +```go-html-template {{ i18n "wordCount" . }} ``` |