NotableDateNameLocalizer Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
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
notableDateNotableDateThe resolved occurrence whose name is being localized.
cultureCultureInfoThe culture to localize for.
Returns
Exceptions
- ArgumentNullException
notableDateorcultureis 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
notableDateIdstringThe notable-date concept identifier the name applies to.
cultureCultureInfoThe culture the name is expressed in.
displayNamestringThe localized display name.
Returns
- NotableDateNameLocalizer
The same localizer, to allow chaining.
Exceptions
- ArgumentNullException
notableDateId,culture, ordisplayNameis null.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |