aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src/components/PersonalInfo/LanguageSection/LanguageSection.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/src/components/PersonalInfo/LanguageSection/LanguageSection.vue')
-rw-r--r--apps/settings/src/components/PersonalInfo/LanguageSection/LanguageSection.vue59
1 files changed, 24 insertions, 35 deletions
diff --git a/apps/settings/src/components/PersonalInfo/LanguageSection/LanguageSection.vue b/apps/settings/src/components/PersonalInfo/LanguageSection/LanguageSection.vue
index 90882b23869..4e92436fd63 100644
--- a/apps/settings/src/components/PersonalInfo/LanguageSection/LanguageSection.vue
+++ b/apps/settings/src/components/PersonalInfo/LanguageSection/LanguageSection.vue
@@ -1,35 +1,18 @@
<!--
- - @copyright 2021, Christopher Ng <chrng8@gmail.com>
- -
- - @author Christopher Ng <chrng8@gmail.com>
- -
- - @license GNU AGPL version 3 or any later version
- -
- - 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 <http://www.gnu.org/licenses/>.
- -
+ - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ - SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<section>
- <HeaderBar :account-property="accountProperty"
- label-for="language" />
+ <HeaderBar :input-id="inputId"
+ :readable="propertyReadable" />
- <template v-if="isEditable">
- <Language :common-languages="commonLanguages"
- :other-languages="otherLanguages"
- :language.sync="language" />
- </template>
+ <Language v-if="isEditable"
+ :input-id="inputId"
+ :common-languages="commonLanguages"
+ :other-languages="otherLanguages"
+ :language.sync="language" />
<span v-else>
{{ t('settings', 'No language set') }}
@@ -40,10 +23,10 @@
<script>
import { loadState } from '@nextcloud/initial-state'
-import Language from './Language'
-import HeaderBar from '../shared/HeaderBar'
+import Language from './Language.vue'
+import HeaderBar from '../shared/HeaderBar.vue'
-import { ACCOUNT_SETTING_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
+import { ACCOUNT_SETTING_PROPERTY_ENUM, ACCOUNT_SETTING_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants.js'
const { languageMap: { activeLanguage, commonLanguages, otherLanguages } } = loadState('settings', 'personalInfoParameters', {})
@@ -55,16 +38,26 @@ export default {
HeaderBar,
},
- data() {
+ setup() {
+ // Non reactive instance properties
return {
- accountProperty: ACCOUNT_SETTING_PROPERTY_READABLE_ENUM.LANGUAGE,
commonLanguages,
otherLanguages,
+ propertyReadable: ACCOUNT_SETTING_PROPERTY_READABLE_ENUM.LANGUAGE,
+ }
+ },
+
+ data() {
+ return {
language: activeLanguage,
}
},
computed: {
+ inputId() {
+ return `account-setting-${ACCOUNT_SETTING_PROPERTY_ENUM.LANGUAGE}`
+ },
+
isEditable() {
return Boolean(this.language)
},
@@ -75,9 +68,5 @@ export default {
<style lang="scss" scoped>
section {
padding: 10px 10px;
-
- &::v-deep button:disabled {
- cursor: default;
- }
}
</style>