This commit is contained in:
@@ -13,6 +13,14 @@ const wrapper = ref(null);
|
||||
const props = defineProps(['data']);
|
||||
const data = props.data;
|
||||
|
||||
const { locales, setLocale, locale } = useI18n();
|
||||
|
||||
const changeLocale = (lang) => {
|
||||
console.log(lang);
|
||||
setLocale(lang.code);
|
||||
SetUserSetting('lang', lang.code);
|
||||
}
|
||||
|
||||
const id = data.id;
|
||||
|
||||
const rows = ref([{id: "account-settings", value: "settings.tabs.account-settings"}]);
|
||||
@@ -23,17 +31,10 @@ const langSelector = ref(null);
|
||||
const currentLanguage = ref("");
|
||||
*/
|
||||
onBeforeMount(() => {
|
||||
/*
|
||||
let codes = {
|
||||
"en-US": "English",
|
||||
"es-ES": "Spanish",
|
||||
"ca": "Catalan"
|
||||
}
|
||||
GetUserSetting('lang').then(value => {
|
||||
currentLanguage.value = codes[value ?? 'en']
|
||||
console.log(currentLanguage.value)
|
||||
});
|
||||
*/
|
||||
if(GetUser().admin) rows.value.push({
|
||||
id: "site-administration",
|
||||
value: "settings.tabs.site-administration"
|
||||
@@ -68,22 +69,8 @@ function OpenManageAccounts(){
|
||||
})
|
||||
}
|
||||
|
||||
function OpenManagePlugins(){
|
||||
ClearWindow('settings');
|
||||
CreateWindow('plugin_management', {
|
||||
type: 'plugin_management',
|
||||
title: 'settings.site-administration.manage-plugins.title',
|
||||
id: 'plugin-management',
|
||||
back: () => {
|
||||
ClearWindow('plugin-management')
|
||||
CreateWindow('settings', {
|
||||
id: 'settings',
|
||||
type: 'settings',
|
||||
title: 'settings.title',
|
||||
back: () => { ClearWindow('settings'); CreateWindow('main_menu'); }
|
||||
});
|
||||
}
|
||||
})
|
||||
const getLocaleName = (locale) => {
|
||||
return locale.name;
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -98,17 +85,14 @@ function OpenManagePlugins(){
|
||||
<template #account-settings>
|
||||
<div class="form-container">
|
||||
<div class="form-element">
|
||||
<label>{{ $t('settings.account.language') }}</label>
|
||||
|
||||
<label>{{ $t('settings.account-settings.language') }}</label>
|
||||
<Dropdown :options="locales" :keyFunc="getLocaleName" :onselect="changeLocale" :selected="locale"></Dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #site-administration>
|
||||
<div class="form-element centered">
|
||||
<button v-on:click.prevent="OpenManageAccounts">{{ $t('settings.site-administration.manage-accounts-button') }}</button>
|
||||
</div>
|
||||
<div class="form-element centered">
|
||||
<button v-on:click.prevent="OpenManagePlugins">{{ $t('settings.site-administration.manage-plugins-button') }}</button>
|
||||
<button v-on:click.prevent="OpenManageAccounts">{{ $t('settings.site-administration.manage-accounts') }}</button>
|
||||
</div>
|
||||
</template>
|
||||
</Tabs>
|
||||
|
||||
Reference in New Issue
Block a user