@filerobot/utils
Advanced tools
Comparing version 1.0.91 to 1.0.92-alpha.0
@@ -326,3 +326,3 @@ import { VisibilityIcon, CodeIcon, TagsIcon, MetaIcon, DetailsIcon, CommentsIcon, HistoryIcon, BranchesIcon, SimilarityIcon, LinkIcon, ShareFolderIcon, ShareAssetsIcon, CommentsSolidIcon } from '@filerobot/icons'; | ||
}, | ||
Type: { | ||
type: { | ||
contentI18nStr: 'sortByType' | ||
@@ -332,2 +332,5 @@ }, | ||
contentI18nStr: 'sortByResolution' | ||
}, | ||
tags: { | ||
contentI18nStr: 'sortByTags' | ||
} | ||
@@ -384,3 +387,4 @@ }; | ||
LAST_MODIFY: { | ||
i18nStr: 'viewListHeaderLastModify' | ||
i18nStr: 'viewListHeaderLastModify', | ||
sortValue: 'modified_at' | ||
} | ||
@@ -387,0 +391,0 @@ }; |
@@ -26,3 +26,3 @@ /** | ||
if (logInfo && i18n) { | ||
logInfo(i18n('linkCopied') || 'Copied successfully!', 'success', 3000); | ||
logInfo(i18n('fileLinkCopied') || 'Copied successfully!', 'success', 3000); | ||
} | ||
@@ -29,0 +29,0 @@ |
@@ -31,2 +31,4 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
var sentKeys = {}; | ||
var Translator = /*#__PURE__*/function () { | ||
@@ -169,3 +171,3 @@ // For saving the backend translations retrieved from core. | ||
* @param {string} key | ||
* @param {object} options with values that will be used to replace placeholders | ||
* @param {object} options with values that will be used to replace placeholders or default string value if key doesn't have value | ||
* @returns {Array} The translated and interpolated parts, in order. | ||
@@ -179,17 +181,23 @@ */ | ||
// JSON.parse() for handling the plural case that's being received from backend as string. | ||
if (!Translator.BACKEND_TRANSLATIONS) { | ||
return []; | ||
} // JSON.parse() for handling the plural case that's being received from backend as string. | ||
var value = (_this$locale$strings$ = this.locale.strings[key]) !== null && _this$locale$strings$ !== void 0 && (_this$locale$strings$2 = _this$locale$strings$.startsWith) !== null && _this$locale$strings$2 !== void 0 && _this$locale$strings$2.call(_this$locale$strings$, '{"') ? JSON.parse(this.locale.strings[key]) : this.locale.strings[key]; | ||
var valueOrDefault = !value && typeof options === 'string' ? options : value || ''; | ||
var hasPluralForms = _typeof(value) === 'object'; // For sending to the backend the missing translation keys | ||
if (!Translator.IS_DEV && Translator.BACKEND_TRANSLATIONS && !Translator.BACKEND_TRANSLATIONS[key] && value) { | ||
if (!Translator.IS_DEV && Translator.BACKEND_TRANSLATIONS && !Translator.BACKEND_TRANSLATIONS[key] && !sentKeys[key]) { | ||
sendMissingTranslationToBackend({ | ||
key: key, | ||
lang: Translator.LANGAUGE, | ||
default: hasPluralForms ? JSON.stringify(value) : value | ||
default: hasPluralForms ? JSON.stringify(valueOrDefault) : valueOrDefault | ||
}); | ||
Translator.BACKEND_TRANSLATIONS = _objectSpread(_objectSpread({}, Translator.BACKEND_TRANSLATIONS), {}, _defineProperty({}, key, value)); | ||
sentKeys[key] = true; | ||
Translator.BACKEND_TRANSLATIONS = _objectSpread(_objectSpread({}, Translator.BACKEND_TRANSLATIONS), {}, _defineProperty({}, key, valueOrDefault)); | ||
} | ||
if (hasPluralForms) { | ||
if (options && typeof options.smart_count !== 'undefined') { | ||
if (options && _typeof(options) === 'object' && typeof options.smart_count !== 'undefined') { | ||
var plural = this.locale.pluralize(options.smart_count); | ||
@@ -196,0 +204,0 @@ return this.interpolate(value[plural], options); |
@@ -6,3 +6,3 @@ { | ||
"types": "types/index.d.ts", | ||
"version": "1.0.91", | ||
"version": "1.0.92-alpha.0", | ||
"files": [ | ||
@@ -15,3 +15,3 @@ "/dist", | ||
"dependencies": { | ||
"@filerobot/icons": "1.0.91", | ||
"@filerobot/icons": "1.0.92-alpha.0", | ||
"abortcontroller-polyfill": "^1.4.0", | ||
@@ -18,0 +18,0 @@ "lodash.throttle": "^4.1.1" |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
160084
110
3060
2
+ Added@filerobot/icons@1.0.92-alpha.0(transitive)
- Removed@filerobot/icons@1.0.91(transitive)