Class

I18nLoader

lib/i18n/Loader.I18nLoader(http, resourcesopt, versionedSuffixopt)

Constructor

# new I18nLoader(http, resourcesopt, versionedSuffixopt)

Fetches and merges translation resources, supporting versioned suffixes and recursive merging.

Custom implementation of TranslateLoader for loading translations.

Parameters:
Name Type Attributes Default Description
http HttpClient

The HTTP client used to fetch translation resources.

resources Array.<I18nResourceConfig> <optional>
[]

The translation resources to be loaded.

versionedSuffix boolean <optional>
false

Whether to append a versioned suffix to resource URLs.

View Source lib/i18n/Loader.ts, line 86

Classes

I18nLoader

Methods

# getSuffix(suffix) → {string}

Generates a versioned suffix based on the current date.

Appends a versioned suffix to the resource URL if enabled.

Parameters:
Name Type Description
suffix string

The original suffix of the resource URL.

View Source lib/i18n/Loader.ts, line 107

  • The modified suffix with a version string appended.
string

# getTranslation(lang) → {Observable.<TranslationObject>}

Loads translation resources, merges them recursively, and includes library keys.

Fetches and merges translations for the specified language.

Parameters:
Name Type Description
lang string

The language code for the translations to load.

View Source lib/i18n/Loader.ts, line 289

  • An observable that emits the merged translation object.
Observable.<TranslationObject>