@stemy/backend 3.5.7 → 3.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/stemy-backend.umd.js +13 -10
- package/bundles/stemy-backend.umd.js.map +1 -1
- package/esm2015/services/assets.js +3 -2
- package/esm2015/services/translator.js +5 -6
- package/fesm2015/stemy-backend.js +6 -6
- package/fesm2015/stemy-backend.js.map +1 -1
- package/package.json +1 -1
- package/services/translator.d.ts +1 -1
|
@@ -1798,9 +1798,10 @@
|
|
|
1798
1798
|
case 0:
|
|
1799
1799
|
metadata = metadata || {};
|
|
1800
1800
|
metadata.filename = metadata.filename || url;
|
|
1801
|
+
metadata.url = url;
|
|
1801
1802
|
metadata.uploadTime = new Date().getTime();
|
|
1802
1803
|
oneWeek = 1000 * 3600 * 24 * 7;
|
|
1803
|
-
return [4 /*yield*/, this.find({
|
|
1804
|
+
return [4 /*yield*/, this.find({ "metadata.url": url, "metadata.uploadTime": { $gt: metadata.uploadTime - oneWeek } })];
|
|
1804
1805
|
case 1:
|
|
1805
1806
|
asset = _b.sent();
|
|
1806
1807
|
if (asset)
|
|
@@ -4075,18 +4076,20 @@
|
|
|
4075
4076
|
exports.Translator = /** @class */ (function () {
|
|
4076
4077
|
function Translator(translationProvider) {
|
|
4077
4078
|
this.translationProvider = translationProvider;
|
|
4078
|
-
this.
|
|
4079
|
+
this.dictionaries = {};
|
|
4079
4080
|
}
|
|
4080
4081
|
Translator.prototype.getDictionary = function (language) {
|
|
4081
4082
|
return __awaiter$g(this, void 0, void 0, function () {
|
|
4082
|
-
var
|
|
4083
|
-
return __generator(this, function (
|
|
4084
|
-
switch (
|
|
4085
|
-
case 0:
|
|
4083
|
+
var _a, _b;
|
|
4084
|
+
return __generator(this, function (_c) {
|
|
4085
|
+
switch (_c.label) {
|
|
4086
|
+
case 0:
|
|
4087
|
+
_a = this.dictionaries;
|
|
4088
|
+
_b = language;
|
|
4089
|
+
return [4 /*yield*/, this.translationProvider.getDictionary(language)];
|
|
4086
4090
|
case 1:
|
|
4087
|
-
|
|
4088
|
-
this.
|
|
4089
|
-
return [2 /*return*/, dictionary];
|
|
4091
|
+
_a[_b] = _c.sent();
|
|
4092
|
+
return [2 /*return*/, this.dictionaries[language]];
|
|
4090
4093
|
}
|
|
4091
4094
|
});
|
|
4092
4095
|
});
|
|
@@ -4095,7 +4098,7 @@
|
|
|
4095
4098
|
if (!isString(key) || !key.length) {
|
|
4096
4099
|
throw new Error("Parameter \"key\" required");
|
|
4097
4100
|
}
|
|
4098
|
-
var dictionary = this.
|
|
4101
|
+
var dictionary = this.dictionaries[language];
|
|
4099
4102
|
var translation = getValue(dictionary, key, key) || key;
|
|
4100
4103
|
return this.interpolate(translation, params);
|
|
4101
4104
|
};
|