mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 02:50:39 +00:00
Language editor refactoring part 2 (backend + frontend)
This commit is contained in:
Vendored
+24
-9
@@ -1,4 +1,6 @@
|
||||
import i18n from '@/i18n/index'
|
||||
import axios from "axios";
|
||||
import Vue from "vue";
|
||||
|
||||
const defaultState = {
|
||||
fileInfoPanelVisible: localStorage.getItem('file_info_visibility') === 'true' || false,
|
||||
@@ -14,11 +16,11 @@ const defaultState = {
|
||||
},
|
||||
roles: [
|
||||
{
|
||||
label: i18n.t('roles.admin'),
|
||||
label: 'roles.admin',
|
||||
value: 'admin',
|
||||
},
|
||||
{
|
||||
label: i18n.t('roles.user'),
|
||||
label: 'roles.user',
|
||||
value: 'user',
|
||||
},
|
||||
],
|
||||
@@ -269,31 +271,31 @@ const defaultState = {
|
||||
],
|
||||
expirationList: [
|
||||
{
|
||||
label: i18n.t('shared_form.expiration_hour', {value: 1}),
|
||||
label: ['shared_form.expiration_hour', {value: 1}],
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: i18n.t('shared_form.expiration_hour', {value: 2}),
|
||||
label: ['shared_form.expiration_hour', {value: 2}],
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: i18n.t('shared_form.expiration_hour', {value: 6}),
|
||||
label: ['shared_form.expiration_hour', {value: 6}],
|
||||
value: 6,
|
||||
},
|
||||
{
|
||||
label: i18n.t('shared_form.expiration_hour', {value: 12}),
|
||||
label: ['shared_form.expiration_hour', {value: 12}],
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
label: i18n.t('shared_form.expiration_day', {value: 1}),
|
||||
label: ['shared_form.expiration_day', {value: 1}],
|
||||
value: 24,
|
||||
},
|
||||
{
|
||||
label: i18n.t('shared_form.expiration_day', {value: 2}),
|
||||
label: ['shared_form.expiration_day', {value: 2}],
|
||||
value: 48,
|
||||
},
|
||||
{
|
||||
label: i18n.t('shared_form.expiration_day', {value: 7}),
|
||||
label: ['shared_form.expiration_day', {value: 7}],
|
||||
value: 168,
|
||||
},
|
||||
],
|
||||
@@ -989,6 +991,19 @@ const actions = {
|
||||
context.commit('FILE_INFO_TOGGLE', visibility)
|
||||
}
|
||||
},
|
||||
getLanguageTranslations: ({commit, state}, lang) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
axios.get(`/translations/${lang}`)
|
||||
.then(response => {
|
||||
|
||||
i18n.setLocaleMessage(lang, response.data)
|
||||
i18n.locale = lang
|
||||
|
||||
resolve(response)
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
|
||||
Reference in New Issue
Block a user