Table of Contents

NotableDateLocalizationExtensions Class

Definition

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

Provides extension methods that apply an INotableDateNameLocalizer to resolved occurrences, replacing each display name with its culture-specific form.

public static class NotableDateLocalizationExtensions
Inheritance
NotableDateLocalizationExtensions
Inherited Members

Examples

IReadOnlyList<NotableDate> dates = service.Resolve(2026, "CA-QC");

// Replace display names with their French-Canadian forms where the localizer has them.
INotableDateNameLocalizer localizer = new NotableDateNameLocalizer(translations);
IReadOnlyList<NotableDate> localized = dates.Localize(localizer, CultureInfo.GetCultureInfo("fr-CA"));

Remarks

Resolution always emits the authored (invariant) display name; localization is a separate, opt-in step applied to the results. When the localizer supplies no name for an occurrence in the requested culture, that occurrence is returned unchanged so the invariant name remains as a fallback.

Methods

Localize(NotableDate, INotableDateNameLocalizer, CultureInfo)

Returns the occurrence with its display name localized for the requested culture.

public static NotableDate Localize(this NotableDate notableDate, INotableDateNameLocalizer localizer, CultureInfo culture)

Parameters

notableDate NotableDate

The resolved occurrence to localize.

localizer INotableDateNameLocalizer

The localizer that supplies the culture-specific name.

culture CultureInfo

The culture to localize for.

Returns

NotableDate

A copy with the localized display name, or the same occurrence when the localizer supplies no name.

Exceptions

ArgumentNullException

notableDate, localizer, or culture is null.

Localize(IReadOnlyList<NotableDate>, INotableDateNameLocalizer, CultureInfo)

Returns the occurrences with their display names localized for the requested culture.

public static IReadOnlyList<NotableDate> Localize(this IReadOnlyList<NotableDate> occurrences, INotableDateNameLocalizer localizer, CultureInfo culture)

Parameters

occurrences IReadOnlyList<NotableDate>

The resolved occurrences to localize.

localizer INotableDateNameLocalizer

The localizer that supplies the culture-specific names.

culture CultureInfo

The culture to localize for.

Returns

IReadOnlyList<NotableDate>

The occurrences with localized display names, preserving order.

Exceptions

ArgumentNullException

occurrences, localizer, or culture is null.

Applies to

ProductVersions
.NET8, 10

See Also