pref: add locale auto switch for components of naive ui
This commit is contained in:
parent
30346f7b73
commit
df63381413
|
@ -59,6 +59,7 @@ watch(
|
|||
:inline-theme-disabled="true"
|
||||
:theme="prefStore.isDark ? darkTheme : undefined"
|
||||
:theme-overrides="themeOverrides"
|
||||
:locale="prefStore.themeLocale"
|
||||
class="fill-height">
|
||||
<n-global-style />
|
||||
<n-dialog-provider>
|
||||
|
|
|
@ -64,7 +64,7 @@ defineExpose({
|
|||
<n-form-item :label="$t('filter_keyword')">
|
||||
<n-input v-model:value="data.keyword" clearable placeholder="" />
|
||||
</n-form-item>
|
||||
<n-form-item>
|
||||
<n-form-item label=" ">
|
||||
<icon-button :icon="Refresh" border t-tooltip="refresh" @click="loadHistory" />
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
} from 'wailsjs/go/services/preferencesService.js'
|
||||
import { BrowserOpenURL } from 'wailsjs/runtime/runtime.js'
|
||||
import { i18nGlobal } from '@/utils/i18n.js'
|
||||
import { useOsTheme } from 'naive-ui'
|
||||
import { zhCN, enUS, useOsTheme } from 'naive-ui'
|
||||
|
||||
const osTheme = useOsTheme()
|
||||
const usePreferencesStore = defineStore('preferences', {
|
||||
|
@ -142,6 +142,16 @@ const usePreferencesStore = defineStore('preferences', {
|
|||
}
|
||||
},
|
||||
|
||||
themeLocale() {
|
||||
const lang = this.currentLanguage
|
||||
switch (lang) {
|
||||
case 'zh':
|
||||
return zhCN
|
||||
default:
|
||||
return enUS
|
||||
}
|
||||
},
|
||||
|
||||
autoCheckUpdate() {
|
||||
return get(this.general, 'checkUpdate', false)
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue