chore: restructure project and add i18n support
- Reorganize project structure with new electron and shared directories - Add comprehensive i18n support with Chinese, English, and Japanese locales - Update build configurations and TypeScript paths for new structure - Add various UI components including chat interface and task management - Include Windows release binaries and localization files - Update dependencies and fix import paths throughout the codebase
This commit is contained in:
49
src/pages/setting/components/Version/index.vue
Normal file
49
src/pages/setting/components/Version/index.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="flex-1 h-full p-[20px] select-none">
|
||||
<TitleSection title="账号设置" desc="请关联PMS和渠道房型名称,可使用智能对标" />
|
||||
|
||||
<div
|
||||
class="w-full flex items-center mt-[20px] py-[20px] box-border border-b-[1px] border-dashed border-b-[#E5E8EE]">
|
||||
<div class="label w-[64px] text-[16px] font-medium text-[#171717] mr-[24px]">当前版本</div>
|
||||
<div class="value text-[16px] font-medium text-[#171717]">1.0.0</div>
|
||||
<el-button type="text" class="ml-auto">检查更新</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 语言设置 -->
|
||||
<div
|
||||
class="w-full flex items-center mt-[20px] py-[20px] box-border border-b-[1px] border-dashed border-b-[#E5E8EE]">
|
||||
<div class="label w-[64px] text-[16px] font-medium text-[#171717] mr-[24px]">语言设置</div>
|
||||
<div class="value flex gap-2">
|
||||
<el-button v-for="lang in supportedLanguages" :key="lang.code"
|
||||
:type="currentLanguage === lang.code ? 'primary' : 'text'" @click="handleLanguageChange(lang.code)"
|
||||
class="px-4">
|
||||
{{ lang.label }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import TitleSection from '@src/components/TitleSection/index.vue'
|
||||
import { setLanguage, getLanguage, type LanguageType } from '@src/i18n'
|
||||
|
||||
const supportedLanguages = [
|
||||
{ code: 'zh', label: '中文' },
|
||||
{ code: 'en', label: 'English' },
|
||||
{ code: 'ja', label: '日本語' }
|
||||
] as const
|
||||
|
||||
const currentLanguage = ref<LanguageType>('zh')
|
||||
|
||||
onMounted(() => {
|
||||
currentLanguage.value = getLanguage() as LanguageType
|
||||
})
|
||||
|
||||
const handleLanguageChange = async (langCode: LanguageType) => {
|
||||
if (langCode === currentLanguage.value) return
|
||||
await setLanguage(langCode)
|
||||
currentLanguage.value = langCode
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user