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. |
Classes
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. |
- 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. |
- An observable that emits the merged translation object.
Observable.<TranslationObject>