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

@@ -1,14 +1,12 @@
---
title: Language
description: Returns the language object for the given site.
description: Returns the language object for the given site.
categories: []
keywords: []
action:
related:
- methods/page/language
returnType: langs.Language
signatures: [SITE.Language]
toc: true
params:
functions_and_methods:
returnType: langs.Language
signatures: [SITE.Language]
---
The `Language` method on a `Site` object returns the language object for the given site. The language object points to the language definition in the site configuration.
@@ -27,7 +25,7 @@ languageName = 'Deutsch'
weight = 1
{{< /code-toggle >}}
###### Lang
### Lang
(`string`) The language tag as defined by [RFC 5646].
@@ -35,7 +33,7 @@ weight = 1
{{ .Site.Language.Lang }} → de
```
###### LanguageCode
### LanguageCode
(`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
@@ -43,7 +41,7 @@ weight = 1
{{ .Site.Language.LanguageCode }} → de-DE
```
###### LanguageDirection
### LanguageDirection
(`string`) The language direction from the site configuration, either `ltr` or `rtl`.
@@ -51,7 +49,7 @@ weight = 1
{{ .Site.Language.LanguageDirection }} → ltr
```
###### LanguageName
### LanguageName
(`string`) The language name from the site configuration.
@@ -59,7 +57,7 @@ weight = 1
{{ .Site.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.