Add: Spanish on launcher

This commit is contained in:
LmeSzinc 2023-09-25 23:42:24 +08:00
parent 67ea7b3ce8
commit 166d4217e4
6 changed files with 12 additions and 4 deletions

View File

@ -33,6 +33,7 @@ import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
import enUS from '@arco-design/web-vue/es/locale/lang/en-us'; import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
import jaJP from '@arco-design/web-vue/es/locale/lang/ja-jp'; import jaJP from '@arco-design/web-vue/es/locale/lang/ja-jp';
import zhTW from '@arco-design/web-vue/es/locale/lang/zh-tw'; import zhTW from '@arco-design/web-vue/es/locale/lang/zh-tw';
import esES from '@arco-design/web-vue/es/locale/lang/es-es';
import type {ArcoLang} from '@arco-design/web-vue/es/locale/interface'; import type {ArcoLang} from '@arco-design/web-vue/es/locale/interface';
export default defineComponent({ export default defineComponent({
@ -47,6 +48,7 @@ export default defineComponent({
'en-US': enUS, 'en-US': enUS,
'ja-JP': jaJP, 'ja-JP': jaJP,
'zh-TW': zhTW, 'zh-TW': zhTW,
'es-ES': esES,
}; };
const locale = computed<ArcoLang>(() => { const locale = computed<ArcoLang>(() => {

View File

@ -5,7 +5,7 @@ export async function initAppConfigStore() {
const appStore = useAppStore(); const appStore = useAppStore();
const config = await window.__electron_preload__getAlasConfig(); const config = await window.__electron_preload__getAlasConfig();
appStore.setTheme(config?.theme ?? 'light'); appStore.setTheme(config?.theme ?? 'light');
appStore.setLanguage(config?.language ?? 'zh-TW'); appStore.setLanguage(config?.language ?? 'zh-CN');
appStore.setRepository( appStore.setRepository(
(repositoryValueMap[config?.repository] as 'global' | 'china') ?? 'global', (repositoryValueMap[config?.repository] as 'global' | 'china') ?? 'global',
); );

View File

@ -5,6 +5,7 @@ export const LOCALE: {[key: string]: LocaleType} = {
EN_US: 'en-US', EN_US: 'en-US',
JA_JP: 'ja-JP', JA_JP: 'ja-JP',
ZH_TW: 'zh-TW', ZH_TW: 'zh-TW',
ES_ES: 'es-ES',
}; };
// locale list // locale list
@ -25,6 +26,10 @@ export const localeList: {label: string; value: keyof typeof LOCALE}[] = [
label: '繁體中文', label: '繁體中文',
value: LOCALE.ZH_TW, value: LOCALE.ZH_TW,
}, },
{
label: 'Español',
value: LOCALE.ES_ES,
},
]; ];
export const localeSetting: LocaleSetting = { export const localeSetting: LocaleSetting = {

View File

@ -1,8 +1,8 @@
z; z;
/** /**
* 'zh-CN' | 'en-US' | 'ja-JP' | 'zh-TW' * 'zh-CN' | 'en-US' | 'ja-JP' | 'zh-TW' | 'en-ES'
*/ */
export type LocaleType = 'zh-CN' | 'en-US' | 'ja-JP' | 'zh-TW'; export type LocaleType = 'zh-CN' | 'en-US' | 'ja-JP' | 'zh-TW' | 'es-ES';
export interface LocaleSetting { export interface LocaleSetting {
showPicker: boolean; showPicker: boolean;

View File

@ -104,6 +104,7 @@ const config = {
'@arco-design/web-vue/es/locale/lang/en-us', '@arco-design/web-vue/es/locale/lang/en-us',
'@arco-design/web-vue/es/locale/lang/ja-jp', '@arco-design/web-vue/es/locale/lang/ja-jp',
'@arco-design/web-vue/es/locale/lang/zh-tw', '@arco-design/web-vue/es/locale/lang/zh-tw',
'@arco-design/web-vue/es/locale/lang/es-es',
], ],
}, },
}; };

View File

@ -58,7 +58,7 @@ declare interface DefAlasConfig {
Webui: { Webui: {
WebuiHost: string; WebuiHost: string;
WebuiPort: number; WebuiPort: number;
Language: 'zh-CN' | 'en-US' | 'ja-JP' | 'zh-TW'; Language: 'zh-CN' | 'en-US' | 'ja-JP' | 'zh-TW' | 'es-ES';
Theme: 'default' | 'dark'; Theme: 'default' | 'dark';
DpiScaling: boolean; DpiScaling: boolean;
Password: null | string; Password: null | string;