refactor(i18n): unify language labels (#463)

This commit is contained in:
Typed SIGTERM
2025-08-26 12:45:26 +08:00
committed by GitHub
parent 1340546d10
commit e6b1bdc615
6 changed files with 12 additions and 36 deletions
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { all } from '@proj-airi/i18n'
import { useSettings } from '@proj-airi/stage-ui/stores/settings'
import { FieldCheckbox, FieldSelect } from '@proj-airi/ui'
import { useDark } from '@vueuse/core'
@@ -8,16 +9,13 @@ import { useI18n } from 'vue-i18n'
const settings = useSettings()
const { t, messages } = useI18n()
const { t } = useI18n()
const { allowVisibleOnAllWorkspaces } = storeToRefs(settings)
const dark = useDark()
const languages = computed(() => {
return Object.keys(messages.value).map(lang => ({
label: t(`settings.language.options.${lang}`),
value: lang,
}))
return Object.entries(all).map(([value, label]) => ({ label, value }))
})
</script>
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { all } from '@proj-airi/i18n'
import { useSettings } from '@proj-airi/stage-ui/stores/settings'
import { FieldCheckbox, FieldSelect } from '@proj-airi/ui'
import { useDark } from '@vueuse/core'
@@ -7,14 +8,11 @@ import { useI18n } from 'vue-i18n'
const settings = useSettings()
const { t, messages } = useI18n()
const { t } = useI18n()
const dark = useDark()
const languages = computed(() => {
return Object.keys(messages.value).map(lang => ({
label: t(`settings.language.options.${lang}`),
value: lang,
}))
return Object.entries(all).map(([value, label]) => ({ value, label }))
})
</script>
+5
View File
@@ -0,0 +1,5 @@
export const all = {
'en': 'English',
'es': 'Español',
'zh-Hans': '简体中文',
}
+1 -9
View File
@@ -26,19 +26,11 @@ dialogs:
select-model: Choose model
no-models: No available models
no-models-help: Please return to the previous step and check your API key, or check the network connection.
language:
language:
title: Language
description: >
Change the language of the AIRI interface. This will not affect the language
of the character's responses.
options:
chinese: 简体中文
zh-CN: 简体中文
zh-Hans: 简体中文
english: English
en: English
en-US: English (US)
es: Spanish
live2d:
change-model:
from-file: Load from File
@@ -29,15 +29,6 @@ language:
description: >
Cambia el idioma de la interfaz de AIRI. Esto no afectará el idioma
de las respuestas del personaje.
options:
chinese: 简体中文
zh-CN: 简体中文
zh-Hans: 简体中文
english: English
en: English
en-US: English (US)
spanish: Español
es: Español
live2d:
change-model:
from-file: Cargar desde Archivo
@@ -27,14 +27,6 @@ dialogs:
language:
title: 语言
description: 切换显示界面的语言
options:
chinese: 简体中文
english: English
zh-Hans: 简体中文
zh-CN: 中文
en-US: English (US)
en: English
es: Spanish
live2d:
change-model:
from-file: 从文件加载