EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
time zone enum option translations
Yuri Kuznetsov5301ce5b7037
diff --git a/application/Espo/Resources/metadata/entityDefs/Settings.json b/application/Espo/Resources/metadata/entityDefs/Settings.jsonindex bf1a0675e5..203c2fad7f 100644--- a/application/Espo/Resources/metadata/entityDefs/Settings.json+++ b/application/Espo/Resources/metadata/entityDefs/Settings.json@@ -123,7 +123,8 @@"Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"- ]+ ],+ "view": "views/settings/fields/time-zone"},"dateFormat": {"type": "enum",diff --git a/client/src/views/preferences/fields/time-zone.js b/client/src/views/preferences/fields/time-zone.jsindex ec9a8fba11..a8e8c19ce9 100644--- a/client/src/views/preferences/fields/time-zone.js+++ b/client/src/views/preferences/fields/time-zone.js@@ -32,9 +32,18 @@ export default class extends EnumFieldView {setupOptions() {this.params.options = Espo.Utils.clone(this.getHelper().getAppParam('timeZoneList')) || [];- this.params.options.unshift('');- this.translatedOptions = this.translatedOptions || {};- this.translatedOptions[''] = `${this.translate('Default')} · ${this.getConfig().get('timeZone')}`;+ this.translatedOptions = this.params.options.reduce((o, it) => {+ o[it] = it.replace('/', ' / ');++ return o;+ }, {});++ /** @type {string} */+ const systemValue = this.getConfig().get('timeZone') ?? '';+ const systemLabel = systemValue.replace('/', ' / ');++ this.params.options.unshift('');+ this.translatedOptions[''] = `${this.translate('Default')} · ${systemLabel}`;}}diff --git a/client/src/views/settings/fields/time-zone.js b/client/src/views/settings/fields/time-zone.jsnew file mode 100644index 0000000000..73b5b51d5a--- /dev/null+++ b/client/src/views/settings/fields/time-zone.js@@ -0,0 +1,42 @@+/************************************************************************+ * This file is part of EspoCRM.+ *+ * EspoCRM – Open Source CRM application.+ * Copyright (C) 2014-2025 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko+ * Website: https://www.espocrm.com+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as published by+ * the Free Software Foundation, either version 3 of the License, or+ * (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ *+ * The interactive user interfaces in modified source and object code versions+ * of this program must display Appropriate Legal Notices, as required under+ * Section 5 of the GNU Affero General Public License version 3.+ *+ * In accordance with Section 7(b) of the GNU Affero General Public License version 3,+ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word.+ ************************************************************************/++import EnumFieldView from 'views/fields/enum';++export default class TimeZoneFieldView extends EnumFieldView {++ setupOptions() {+ super.setupOptions();++ this.translatedOptions = this.params.options.reduce((o, it) => {+ o[it] = it.replace('/', ' / ');++ return o;+ }, {});+ }+}