Skip to content

Allow LanguageDirection and LanguageName in root of configuration #11027

@jmooring

Description

@jmooring

This would:

  1. Mirror the API for .Site.LanguageCode

  2. Allow you to do this on monolingual and multilingual sites

    <html lang="{{ site.LanguageCode }}" dir="{{ site.LanguageDirection }}">

To me, this is the basic configuration for a language:

[languages.en]
languageCode = 'en-US'  
languageDirection = 'ltr' 
languageName = 'English'
weight = 1

But the way you access the values is (conceptually) inconsistent:

Key Code Notes
languageCode {{ .Site.LanguageCode }} {{ .Site.Language.LanguageCode }} does not work
languageDirection {{ .Site.Language.LanguageDirection }}
languageName {{ .Site.Language.LanguageName }}
weight {{ .Site.Language.Weight }} Not sure why this is exposed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions