Service for identifying cultures that you will use in the app, by their CultureID ('en', 'en-US', 'en-GB', etc), and provides fallbacks for when a requested CultureID is not found.

interface ICultureService {
    activeCultureId: string;
    serviceName: string;
    register(culture): void;
    getClosestCultureId(cultureId): null | string;
    find(cultureId): null | CultureIdFallback;
    availableCultures(): string[];
    availableLanguages(): string[];
    dispose(): void;
}

Hierarchy (view full)

Implemented by

Properties

activeCultureId: string

The culture shown to the user in the app. Its the ISO language-region format. This value is the starting point to search through localizations.

serviceName: string

Methods

  • Check for the presence of a Culture. Will fallback to language only check if language-country cultureID doesn't find a match. In other words, if 'en-US' isn't found, it tries 'en'.

    Parameters

    • cultureId: string

    Returns null | string

    the found cultureID, so you know if it exactly matched or just got the language. If no match, returns null.

  • If the user needs to abandon this instance, they should use this to clean up active resources (like timers) and to release memory that would stall the garbage collector from disposing this object. It should assign any object reference to undefined as a strong indicator that the object has been disposed.

    Returns void

Generated using TypeDoc v0.25.12