Skip to content

Commit

Permalink
Add: Spanish on launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
LmeSzinc committed Sep 25, 2023
1 parent 67ea7b3 commit 166d421
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions webapp/packages/renderer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 jaJP from '@arco-design/web-vue/es/locale/lang/ja-jp';
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';
export default defineComponent({
Expand All @@ -47,6 +48,7 @@ export default defineComponent({
'en-US': enUS,
'ja-JP': jaJP,
'zh-TW': zhTW,
'es-ES': esES,
};
const locale = computed<ArcoLang>(() => {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/renderer/src/logics/initAppConfigStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export async function initAppConfigStore() {
const appStore = useAppStore();
const config = await window.__electron_preload__getAlasConfig();
appStore.setTheme(config?.theme ?? 'light');
appStore.setLanguage(config?.language ?? 'zh-TW');
appStore.setLanguage(config?.language ?? 'zh-CN');
appStore.setRepository(
(repositoryValueMap[config?.repository] as 'global' | 'china') ?? 'global',
);
Expand Down
5 changes: 5 additions & 0 deletions webapp/packages/renderer/src/settings/localSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const LOCALE: {[key: string]: LocaleType} = {
EN_US: 'en-US',
JA_JP: 'ja-JP',
ZH_TW: 'zh-TW',
ES_ES: 'es-ES',
};

// locale list
Expand All @@ -25,6 +26,10 @@ export const localeList: {label: string; value: keyof typeof LOCALE}[] = [
label: '繁體中文',
value: LOCALE.ZH_TW,
},
{
label: 'Español',
value: LOCALE.ES_ES,
},
];

export const localeSetting: LocaleSetting = {
Expand Down
4 changes: 2 additions & 2 deletions webapp/packages/renderer/types/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
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 {
showPicker: boolean;
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/renderer/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const config = {
'@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/zh-tw',
'@arco-design/web-vue/es/locale/lang/es-es',
],
},
};
Expand Down
2 changes: 1 addition & 1 deletion webapp/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ declare interface DefAlasConfig {
Webui: {
WebuiHost: string;
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';
DpiScaling: boolean;
Password: null | string;
Expand Down

0 comments on commit 166d421

Please sign in to comment.