Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -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.