mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Files
6dbde8d731f221b027c0c60b772ba82dad759943
35 lines
1006 B
Markdown
35 lines
1006 B
Markdown
---
|
|||
title: i18n
|
|||
linktitle: i18n
|
|||
description: Translates a piece of content based on your i18n configuration files.
|
|||
godocref:
|
|||
date: 2017-02-01
|
|||
publishdate: 2017-02-01
|
|||
lastmod: 2017-02-01
|
|||
categories: [functions]
|
|||
menu:
|
|||
docs:
|
|||
parent: "functions"
|
|||
#tags: [internationalization,i18n,multilingual]
|
|||
signature: ["i18n KEY", "T KEY"]
|
|||
workson: []
|
|||
hugoversion:
|
|||
relatedfuncs: []
|
|||
deprecated: false
|
|||
aliases: []
|
|||
---
|
|||
|
|||
This translates a piece of content based on your `i18n/en-US.yaml` (and similar) 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.
|
|||
|
|||
```golang
|
|||
{{ i18n "translation_id" }}
|
|||
```
|
|||
|
|||
{{% note "Alias `T`" %}}
|
|||
`T` is an alias to `i18n`. E.g. `{{ T "translation_id" }}`.
|
|||
{{% /note %}}
|
|||
|
|||
For more information about string translations, see [Translation of Strings in Multilingual Mode][multistrings].
|
|||
|
|||
[multistrings]: /content-management/multilingual/#translation-of-strings
|