UNPKG

angular-l10n

Version:

An Angular library to translate messages, dates and numbers

129 lines 3.33 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ import * as tslib_1 from "tslib"; import { Injectable } from '@angular/core'; import { LocaleService } from './locale.service'; import { TranslationService } from './translation.service'; import { LocalizedRouting } from '../models/localized-routing'; /** * Initializes the services. * @abstract */ export class L10nLoader { } L10nLoader.decorators = [ { type: Injectable } ]; if (false) { /** * Loads l10n services. * @abstract * @return {?} */ L10nLoader.prototype.load = function () { }; } export class LocaleLoader { /** * @param {?} locale * @param {?} translation */ constructor(locale, translation) { this.locale = locale; this.translation = translation; } /** * @return {?} */ load() { return tslib_1.__awaiter(this, void 0, void 0, function* () { yield this.locale.init(); yield this.translation.init() .catch((error) => { throw error; }); }); } } LocaleLoader.decorators = [ { type: Injectable } ]; /** @nocollapse */ LocaleLoader.ctorParameters = () => [ { type: LocaleService }, { type: TranslationService } ]; if (false) { /** @type {?} */ LocaleLoader.prototype.locale; /** @type {?} */ LocaleLoader.prototype.translation; } export class TranslationLoader { /** * @param {?} translation */ constructor(translation) { this.translation = translation; } /** * @return {?} */ load() { return tslib_1.__awaiter(this, void 0, void 0, function* () { yield this.translation.init() .catch((error) => { throw error; }); }); } } TranslationLoader.decorators = [ { type: Injectable } ]; /** @nocollapse */ TranslationLoader.ctorParameters = () => [ { type: TranslationService } ]; if (false) { /** @type {?} */ TranslationLoader.prototype.translation; } export class LocalizedRoutingLoader { /** * @param {?} localizedRouting * @param {?} locale * @param {?} translation */ constructor(localizedRouting, locale, translation) { this.localizedRouting = localizedRouting; this.locale = locale; this.translation = translation; } /** * @return {?} */ load() { return tslib_1.__awaiter(this, void 0, void 0, function* () { this.localizedRouting.init(); yield this.locale.init(); yield this.translation.init() .catch((error) => { throw error; }); }); } } LocalizedRoutingLoader.decorators = [ { type: Injectable } ]; /** @nocollapse */ LocalizedRoutingLoader.ctorParameters = () => [ { type: LocalizedRouting }, { type: LocaleService }, { type: TranslationService } ]; if (false) { /** @type {?} */ LocalizedRoutingLoader.prototype.localizedRouting; /** @type {?} */ LocalizedRoutingLoader.prototype.locale; /** @type {?} */ LocalizedRoutingLoader.prototype.translation; } //# sourceMappingURL=l10n-loader.js.map