From c83ac376dd3206b055a0ca75f80ecadc443fb0a2 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 17 Feb 2022 13:16:36 +0530 Subject: [PATCH] feat: add selectors for language - remove instance config - use app level config instead --- .../doctype/SystemSettings/SystemSettings.js | 11 -- src/components/Controls/LanguageSelector.vue | 45 +++++ src/components/Controls/Select.vue | 2 +- src/initialization.js | 1 - src/main.js | 14 +- src/pages/DatabaseSelector.vue | 12 +- src/pages/Settings/Settings.vue | 13 +- src/pages/Settings/TabSystem.vue | 7 +- src/pages/SetupWizard/SetupWizard.vue | 163 +++++++++++------- src/pages/SetupWizard/Slide.vue | 45 +++++ src/pages/SetupWizard/setupCompany.js | 7 +- src/utils.js | 52 ++++-- 12 files changed, 261 insertions(+), 111 deletions(-) create mode 100644 src/components/Controls/LanguageSelector.vue create mode 100644 src/pages/SetupWizard/Slide.vue diff --git a/frappe/models/doctype/SystemSettings/SystemSettings.js b/frappe/models/doctype/SystemSettings/SystemSettings.js index f8a6b5cd..454bcaf5 100644 --- a/frappe/models/doctype/SystemSettings/SystemSettings.js +++ b/frappe/models/doctype/SystemSettings/SystemSettings.js @@ -4,9 +4,7 @@ const { DEFAULT_DISPLAY_PRECISION, DEFAULT_INTERNAL_PRECISION, DEFAULT_LOCALE, - DEFAULT_LANGUAGE, } = require('../../../utils/consts'); -const { languageCodeMap } = require('@/languageCodeMap'); let dateFormatOptions = (() => { let formats = [ @@ -53,14 +51,6 @@ module.exports = { default: DEFAULT_LOCALE, description: t`Set the local code, this is used for number formatting.`, }, - { - fieldname: 'language', - label: t`Language`, - fieldtype: 'Select', - options: Object.keys(languageCodeMap), - default: DEFAULT_LANGUAGE, - description: t`Set the display language.`, - }, { fieldname: 'displayPrecision', label: t`Display Precision`, @@ -104,7 +94,6 @@ module.exports = { ], quickEditFields: [ 'locale', - 'language', 'dateFormat', 'displayPrecision', 'hideGetStarted', diff --git a/src/components/Controls/LanguageSelector.vue b/src/components/Controls/LanguageSelector.vue new file mode 100644 index 00000000..a96cf2d0 --- /dev/null +++ b/src/components/Controls/LanguageSelector.vue @@ -0,0 +1,45 @@ + + diff --git a/src/components/Controls/Select.vue b/src/components/Controls/Select.vue index 24b31f6a..49dea2a5 100644 --- a/src/components/Controls/Select.vue +++ b/src/components/Controls/Select.vue @@ -14,7 +14,7 @@ :class="inputClasses" >