playable
Version:
Video player based on HTML5Video
28 lines • 944 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var default_texts_1 = (0, tslib_1.__importDefault)(require("./default-texts"));
var TextMap = /** @class */ (function () {
function TextMap(_a) {
var config = _a.config;
this._textMap = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, default_texts_1.default), config.texts);
}
TextMap.prototype.get = function (id, args, defaultText) {
if (!this._textMap) {
return;
}
var text = this._textMap[id] || defaultText;
if (typeof text === 'function') {
return text(args);
}
return text;
};
TextMap.prototype.destroy = function () {
this._textMap = null;
};
TextMap.moduleName = 'textMap';
TextMap.dependencies = ['config'];
return TextMap;
}());
exports.default = TextMap;
//# sourceMappingURL=text-map.js.map