feat(i18n): add loading states and system settings translations

This commit is contained in:
Dawn
2026-01-12 03:54:34 +08:00
parent 0aaf60c0d2
commit a08bb762ff
6 changed files with 46 additions and 14 deletions

12
locales/en/home.json vendored
View File

@@ -1,11 +1,17 @@
{
"search_suggestions": "Search Suggestions",
"search_suggestions": "Suggestions",
"search_guide": "Search in the search box",
"no_search_results": "No relevant results found",
"search_result": "Search Results",
"no_search_results": "No results found",
"search_result": "Results",
"search_history": "History",
"search_input_placeholder": "Search",
"clear_search_history": "Clear",
"loading": {
"app": "Loading app...",
"left_panel": "Loading left panel...",
"data": "Loading data...",
"right_panel": "Loading right panel..."
},
"action": {
"message": "Messages",
"message_short_title": "Msg",

View File

@@ -46,6 +46,16 @@
"PingFang": "PingFang",
"AliFangYuan": "Alibaba Rounded"
}
},
"system": {
"title": "System",
"close_panel": "Close Panel",
"close_options": {
"minimize_to_tray": "Minimize to Tray",
"exit_program": "Exit Directly"
},
"close_prompt": "Close Prompt",
"esc_close_window": "ESC Close Window"
}
},
"login": {

View File

@@ -6,6 +6,12 @@
"search_history": "历史记录",
"search_input_placeholder": "搜索",
"clear_search_history": "清空",
"loading": {
"app": "加载应用中...",
"left_panel": "加载左侧面板...",
"data": "加载数据中...",
"right_panel": "加载右侧面板..."
},
"action": {
"message": "消息列表",
"message_short_title": "消息",

View File

@@ -46,6 +46,16 @@
"PingFang": "苹方",
"AliFangYuan": "阿里妈妈方圆体"
}
},
"system": {
"title": "系统",
"close_panel": "关闭面板",
"close_options": {
"minimize_to_tray": "最小化到托盘",
"exit_program": "直接退出"
},
"close_prompt": "关闭提示",
"esc_close_window": "ESC关闭窗口"
}
},
"login": {

View File

@@ -79,7 +79,7 @@ const userUid = computed(() => userStore.userInfo?.uid ?? '')
const hasCachedSessions = computed(() => chatStore.sessionList.length > 0)
const appWindow = WebviewWindow.getCurrent()
const loadingPercentage = ref(10)
const loadingText = ref('正在加载应用...')
const loadingText = ref(t('home.loading.app'))
const { resetLoginState, logout, init } = useLogin()
// 是否需要阻塞首屏并做初始化同步
const requiresInitialSync = ref(true)
@@ -162,7 +162,7 @@ const AsyncLeft = defineAsyncComponent({
const blockInit = shouldBlockInitialRender.value
const initTask = ensureInitStarted(blockInit)
await maybeDelayForInitialRender()
loadingText.value = '正在加载左侧面板...'
loadingText.value = t('home.loading.left_panel')
const comp = await import('./left/index.vue')
loadingPercentage.value = 33
if (blockInit) {
@@ -178,7 +178,7 @@ const AsyncCenter = defineAsyncComponent({
const blockInit = shouldBlockInitialRender.value
const initTask = ensureInitStarted(blockInit)
await import('./left/index.vue')
loadingText.value = '正在加载数据中...'
loadingText.value = t('home.loading.data')
const comp = await import('./center/index.vue')
loadingPercentage.value = 66
if (blockInit) {
@@ -195,7 +195,7 @@ const AsyncRight = defineAsyncComponent({
const initTask = ensureInitStarted(blockInit)
await maybeDelayForInitialRender()
await import('./center/index.vue')
loadingText.value = '正在加载右侧面板...'
loadingText.value = t('home.loading.right_panel')
const comp = await import('./right/index.vue')
loadingPercentage.value = 100
if (blockInit) {

View File

@@ -25,25 +25,25 @@
<!-- 系统设置 -->
<n-flex v-if="isWindows()" vertical class="text-(14px [--text-color])" :size="16">
<span class="pl-10px">系统</span>
<span class="pl-10px">{{ t('setting.general.system.title') }}</span>
<n-flex class="item" :size="12" vertical>
<!-- 关闭面板 -->
<n-flex v-if="isWindows()" align="center" justify="space-between">
<span>关闭主面板</span>
<n-flex v-if="isWindows()" align="center" justify="space-between" :wrap="false">
<span>{{ t('setting.general.system.close_panel') }}</span>
<label class="text-(14px #707070) flex gap-6px lh-16px items-center">
<n-radio :value="CloseBxEnum.HIDE" />
<span>最小化到系统托盘</span>
<span>{{ t('setting.general.system.close_options.minimize_to_tray') }}</span>
</label>
<label class="text-(14px #707070) flex gap-6px lh-16px items-center">
<n-radio :value="CloseBxEnum.CLOSE" />
<span>直接退出程序</span>
<span>{{ t('setting.general.system.close_options.exit_program') }}</span>
</label>
<label class="text-(12px #909090) flex gap-6px justify-end items-center">
<n-checkbox size="small" v-model:checked="tips.notTips" />
<span>是否关闭提示</span>
<span>{{ t('setting.general.system.close_prompt') }}</span>
</label>
</n-flex>
@@ -51,7 +51,7 @@
<!-- ESC关闭面板 -->
<n-flex v-if="isWindows()" align="center" justify="space-between">
<span>是否启用ESC关闭窗口</span>
<span>{{ t('setting.general.system.esc_close_window') }}</span>
<n-switch size="small" v-model:value="escClose" />
</n-flex>