root.libs.composum.nodes.commons.components.js.i18n.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of composum-nodes-commons Show documentation
Show all versions of composum-nodes-commons Show documentation
general components and objects to use the Sling API
(function(d){d.i18n={const:{uri:{translate:"/bin/cpm/core/translate.object.json"}},_cache:{},get:function(a,c){var b=d.i18n._missed(a,d.i18n._cache),e=void 0;_.isEmpty(b)?(e=d.i18n._fromCache(a,d.i18n._cache),_.isFunction(c)&&c(e)):d.ajaxPut(d.i18n.const.uri.translate,JSON.stringify(b),{dataType:"json",async:_.isFunction(c)},_.bind(function(b){d.i18n._toCache(b,d.i18n._cache);e=d.i18n._fromCache(a,d.i18n._cache);_.isFunction(c)&&c(e)},this));return e},_missed:function(a,c){var b={};if(_.isString(a)){var e=
_.isObject(c)?c[a]:c;_.isEmpty(e)&&(b[a]=a)}else _.isArray(a)?a.forEach(function(a){_.isEmpty(c[a])&&(b[a]=a)}):_.isObject(a)&&_.keys(a).forEach(function(g){var f=c[g];_.isEmpty(f)?b[g]=a[g]:(f=d.i18n._missed(a[g],f),_.isEmpty(f)||(b[g]=f))});return b},_fromCache:function(a,c){var b=a;if(_.isString(a)){var e=_.isObject(c)?c[a]:c;_.isEmpty(e)||(b=e)}else _.isArray(a)?(b=[],a.forEach(function(a){var f=d.i18n._fromCache(a,c);b.push(_.isEmpty(f)?a:f)})):_.isObject(a)&&(b={},_.keys(a).forEach(function(e){var f=
d.i18n._fromCache(a[e],c[e]);b[e]=_.isEmpty(f)?a[e]:f}));return b},_toCache:function(a,c){_.keys(a).forEach(function(b){_.isObject(a[b])?(_.isObject(c[b])||(c[b]={}),d.i18n._toCache(a[b],c[b])):c[b]=a[b]})}}})(CPM.core);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy