mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -3,11 +3,10 @@ title: Language
|
||||
description: Returns the language object for the given page.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- methods/site/Language
|
||||
returnType: langs.Language
|
||||
signatures: [PAGE.Language]
|
||||
params:
|
||||
functions_and_methods:
|
||||
returnType: langs.Language
|
||||
signatures: [PAGE.Language]
|
||||
---
|
||||
|
||||
The `Language` method on a `Page` object returns the language object for the given page. The language object points to the language definition in the site configuration.
|
||||
@@ -26,7 +25,7 @@ languageName = 'Deutsch'
|
||||
weight = 2
|
||||
{{< /code-toggle >}}
|
||||
|
||||
###### Lang
|
||||
### Lang
|
||||
|
||||
(`string`) The language tag as defined by [RFC 5646].
|
||||
|
||||
@@ -34,7 +33,7 @@ weight = 2
|
||||
{{ .Language.Lang }} → de
|
||||
```
|
||||
|
||||
###### LanguageCode
|
||||
### LanguageCode
|
||||
|
||||
(`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
|
||||
|
||||
@@ -42,7 +41,7 @@ weight = 2
|
||||
{{ .Language.LanguageCode }} → de-DE
|
||||
```
|
||||
|
||||
###### LanguageDirection
|
||||
### LanguageDirection
|
||||
|
||||
(`string`) The language direction from the site configuration, either `ltr` or `rtl`.
|
||||
|
||||
@@ -50,7 +49,7 @@ weight = 2
|
||||
{{ .Language.LanguageDirection }} → ltr
|
||||
```
|
||||
|
||||
###### LanguageName
|
||||
### LanguageName
|
||||
|
||||
(`string`) The language name from the site configuration.
|
||||
|
||||
@@ -58,7 +57,7 @@ weight = 2
|
||||
{{ .Language.LanguageName }} → Deutsch
|
||||
```
|
||||
|
||||
###### Weight
|
||||
### Weight
|
||||
|
||||
(`int`) The language weight from the site configuration which determines its order in the slice of languages returned by the `Languages` method on a `Site` object.
|
||||
|
||||
|
Reference in New Issue
Block a user