angular-l10n
Version:
An Angular library to translate messages, dates and numbers
162 lines • 5.02 kB
JavaScript
/**
* @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
*/
var L10nLoader = /** @class */ (function () {
function L10nLoader() {
}
L10nLoader.decorators = [
{ type: Injectable }
];
return L10nLoader;
}());
export { L10nLoader };
if (false) {
/**
* Loads l10n services.
* @abstract
* @return {?}
*/
L10nLoader.prototype.load = function () { };
}
var LocaleLoader = /** @class */ (function () {
function LocaleLoader(locale, translation) {
this.locale = locale;
this.translation = translation;
}
/**
* @return {?}
*/
LocaleLoader.prototype.load = /**
* @return {?}
*/
function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.locale.init()];
case 1:
_a.sent();
return [4 /*yield*/, this.translation.init()
.catch(function (error) { throw error; })];
case 2:
_a.sent();
return [2 /*return*/];
}
});
});
};
LocaleLoader.decorators = [
{ type: Injectable }
];
/** @nocollapse */
LocaleLoader.ctorParameters = function () { return [
{ type: LocaleService },
{ type: TranslationService }
]; };
return LocaleLoader;
}());
export { LocaleLoader };
if (false) {
/** @type {?} */
LocaleLoader.prototype.locale;
/** @type {?} */
LocaleLoader.prototype.translation;
}
var TranslationLoader = /** @class */ (function () {
function TranslationLoader(translation) {
this.translation = translation;
}
/**
* @return {?}
*/
TranslationLoader.prototype.load = /**
* @return {?}
*/
function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.translation.init()
.catch(function (error) { throw error; })];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
TranslationLoader.decorators = [
{ type: Injectable }
];
/** @nocollapse */
TranslationLoader.ctorParameters = function () { return [
{ type: TranslationService }
]; };
return TranslationLoader;
}());
export { TranslationLoader };
if (false) {
/** @type {?} */
TranslationLoader.prototype.translation;
}
var LocalizedRoutingLoader = /** @class */ (function () {
function LocalizedRoutingLoader(localizedRouting, locale, translation) {
this.localizedRouting = localizedRouting;
this.locale = locale;
this.translation = translation;
}
/**
* @return {?}
*/
LocalizedRoutingLoader.prototype.load = /**
* @return {?}
*/
function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
this.localizedRouting.init();
return [4 /*yield*/, this.locale.init()];
case 1:
_a.sent();
return [4 /*yield*/, this.translation.init()
.catch(function (error) { throw error; })];
case 2:
_a.sent();
return [2 /*return*/];
}
});
});
};
LocalizedRoutingLoader.decorators = [
{ type: Injectable }
];
/** @nocollapse */
LocalizedRoutingLoader.ctorParameters = function () { return [
{ type: LocalizedRouting },
{ type: LocaleService },
{ type: TranslationService }
]; };
return LocalizedRoutingLoader;
}());
export { LocalizedRoutingLoader };
if (false) {
/** @type {?} */
LocalizedRoutingLoader.prototype.localizedRouting;
/** @type {?} */
LocalizedRoutingLoader.prototype.locale;
/** @type {?} */
LocalizedRoutingLoader.prototype.translation;
}
//# sourceMappingURL=l10n-loader.js.map