fix translate option
This commit is contained in:
@@ -389,6 +389,10 @@ function (marked, DOMPurify, /** typeof Handlebars */Handlebars) {
|
||||
}
|
||||
}
|
||||
|
||||
if (name === null) {
|
||||
name = '';
|
||||
}
|
||||
|
||||
return translationHash[name] || name;
|
||||
});
|
||||
|
||||
|
||||
@@ -79,11 +79,14 @@ function (Dep, Selectize, _) {
|
||||
}
|
||||
}
|
||||
|
||||
let translationKey = value || '';
|
||||
|
||||
if (
|
||||
typeof value !== 'undefined' && value !== null && value !== ''
|
||||
typeof value !== 'undefined' && value !== null && value !== ''
|
||||
||
|
||||
value === '' && (
|
||||
value in (this.translatedOptions || {}) && (this.translatedOptions || {})[value] !== ''
|
||||
translationKey === '' && (
|
||||
translationKey in (this.translatedOptions || {}) &&
|
||||
(this.translatedOptions || {})[translationKey] !== ''
|
||||
)
|
||||
) {
|
||||
data.isNotEmpty = true;
|
||||
|
||||
@@ -26,14 +26,15 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('views/preferences/fields/theme', 'views/fields/enum', function (Dep) {
|
||||
define('views/preferences/fields/theme', ['views/fields/enum'], function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setup: function () {
|
||||
this.params.options = Object.keys(this.getMetadata().get('themes')).sort(function (v1, v2) {
|
||||
return this.translate(v1, 'themes').localeCompare(this.translate(v2, 'themes'));
|
||||
}.bind(this));
|
||||
this.params.options = Object.keys(this.getMetadata().get('themes'))
|
||||
.sort((v1, v2) => {
|
||||
return this.translate(v1, 'themes').localeCompare(this.translate(v2, 'themes'));
|
||||
});
|
||||
|
||||
this.params.options.unshift('');
|
||||
|
||||
@@ -41,11 +42,10 @@ Espo.define('views/preferences/fields/theme', 'views/fields/enum', function (Dep
|
||||
|
||||
this.translatedOptions = this.translatedOptions || {};
|
||||
|
||||
var defaultTranslated = this.translatedOptions[this.getConfig().get('theme')] || this.getConfig().get('theme');
|
||||
var defaultTranslated = this.translatedOptions[this.getConfig().get('theme')] ||
|
||||
this.getConfig().get('theme');
|
||||
|
||||
this.translatedOptions[''] = this.translate('Default') + ' (' + defaultTranslated + ')';
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user