This site provides a machine-readable index at /llms.txt.

Skip to main content Skip to navigation

AlternateLanguage Pennington.Infrastructure

Represents 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
Default: false
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

.ctor

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

Represents 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 (optional)
True when this entry represents the current request locale.

Pennington.Infrastructure.AlternateLanguage

namespace Pennington.Infrastructure;

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