This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

AlternateLanguage Pennington.Localization

One language version of a page, used for language switchers and hreflang link tags. Content-route-independent (pure URL math).

Properties

DisplayName string
User-visible language name.
HtmlLang string
Value to emit in hreflang and lang attributes.
IsCurrentLocale bool
True when this entry represents the current request locale.
Locale string
Locale code (e.g. en, fr, pt-BR).
Url string
URL of the page in this locale.

Constructors

AlternateLanguage

#
public AlternateLanguage(string Locale, string DisplayName, string HtmlLang, string Url, bool IsCurrentLocale = false)

One language version of a page, used for language switchers and hreflang link tags. Content-route-independent (pure URL math).

Parameters

Locale string
Locale code (e.g. en, fr, pt-BR).
DisplayName string
User-visible language name.
HtmlLang string
Value to emit in hreflang and lang attributes.
Url string
URL of the page in this locale.
IsCurrentLocale bool
True when this entry represents the current request locale.

Pennington.Localization.AlternateLanguage

namespace Pennington.Localization;

/// One language version of a page, used for language switchers and hreflang link tags. Content-route-independent (pure URL math).
public record AlternateLanguage
{
    /// One language version of a page, used for language switchers and hreflang link tags. Content-route-independent (pure URL math).
    
public AlternateLanguage(string Locale, string DisplayName, string HtmlLang, string Url, bool IsCurrentLocale = false)
; /// User-visible language name.
public string DisplayName { get; set; }
/// Value to emit in hreflang and lang attributes.
public string HtmlLang { get; set; }
/// True when this entry represents the current request locale.
public bool IsCurrentLocale { get; set; }
/// Locale code (e.g. en, fr, pt-BR).
public string Locale { get; set; }
/// URL of the page in this locale.
public string Url { get; set; }
}