Table of Contents

NotableDateNameLocalizer Class

Definition

Namespace
Bodu.Globalization.Calendar
Assembly
Bodu.Globalization.Calendar.dll
Package
Bodu.Globalization.Calendar 1.0.1
Source
NotableDateNameLocalizer.cs

A dictionary-backed INotableDateNameLocalizer keyed by notable-date concept identifier and culture, with parent-culture fallback.

public sealed class NotableDateNameLocalizer : INotableDateNameLocalizer
Inheritance
NotableDateNameLocalizer
Implements
Inherited Members
Extension Methods

Remarks

Names are registered against a concept id and a culture; a lookup walks the culture's fallback chain (for example fr-FR → fr → invariant), returning the first registered name. Registering against InvariantCulture supplies a default that applies when no more specific culture matches.

Constructors

NotableDateNameLocalizer()

public NotableDateNameLocalizer()

Methods

GetDisplayName(NotableDate, CultureInfo)

Returns the display name of an occurrence for the requested culture.

public string? GetDisplayName(NotableDate notableDate, CultureInfo culture)

Parameters

notableDate NotableDate

The resolved occurrence whose name is being localized.

culture CultureInfo

The culture to localize for.

Returns

string

The localized display name, or null to fall back to the occurrence's existing display name.

Exceptions

ArgumentNullException

notableDate or culture is null.

Register(string, CultureInfo, string)

Registers a display name for a concept and culture, replacing any existing registration.

public NotableDateNameLocalizer Register(string notableDateId, CultureInfo culture, string displayName)

Parameters

notableDateId string

The notable-date concept identifier the name applies to.

culture CultureInfo

The culture the name is expressed in.

displayName string

The localized display name.

Returns

NotableDateNameLocalizer

The same localizer, to allow chaining.

Exceptions

ArgumentNullException

notableDateId, culture, or displayName is null.

Applies to

ProductVersions
.NET8, 10