merge: 合并 fwten 贡献的国际化改进

从 fork/fwten/develop 分支选择性应用以下改进:
- 模型管理器的本地化增强
- 文档标题动态化功能
- 保持 AGPL-3.0 许可证和项目规范
This commit is contained in:
linshen committed 2025-10-30 23:43:17 +08:00
commit 5bca0c1345
5 files changed
+47 -6

No files matched your search

@@ -33,14 +33,14 @@
</NFormItem>
<NDivider style="margin: 12px 0 8px 0;" />
<NH4 style="margin: 0 0 12px 0; font-size: 14px;">提供商配置</NH4>
<NH4 style="margin: 0 0 12px 0; font-size: 14px;">{{ t('modelManager.provider.section') }}</NH4>
<NFormItem label="提供商">
<NFormItem :label="t('modelManager.provider.label')">
<NSelect
v-model:value="form.providerId"
:options="providerOptions"
:loading="isLoadingProviders"
placeholder="选择提供商"
:placeholder="t('modelManager.provider.placeholder')"
@update:value="onProviderChange"
required
/>
@@ -82,7 +82,7 @@
</NFormItem>
<NDivider style="margin: 12px 0 8px 0;" />
<NH4 style="margin: 0 0 12px 0; font-size: 14px;">模型配置</NH4>
<NH4 style="margin: 0 0 12px 0; font-size: 14px;">{{ t('modelManager.model.section') }}</NH4>
<NFormItem :label="t('modelManager.selectModel')">
<NSpace align="center" style="width: 100%;">
+9
View File
@@ -732,6 +732,15 @@ export default {
addModel: "Add",
addImageModel: "Add Image Model",
provider: {
section: "Provider Configuration",
label: "Provider",
placeholder: "Select Provider",
},
model: {
section: "Model Configuration",
},
// Advanced Parameters
advancedParameters: {
title: "Advanced Parameters",
+9
View File
@@ -713,6 +713,15 @@ export default {
addModel: "添加",
addImageModel: "添加图像模型",
provider: {
section: "提供商配置",
label: "提供商",
placeholder: "选择提供商",
},
model: {
section: "模型配置",
},
// 高级参数
advancedParameters: {
title: "高级参数",
+9
View File
@@ -712,6 +712,15 @@ export default {
addModel: "新增",
addImageModel: "新增圖像模型",
provider: {
section: "提供商配置",
label: "提供商",
placeholder: "選擇提供商",
},
model: {
section: "模型配置",
},
// 進階參數
advancedParameters: {
title: "進階參數",
+16 -2
View File
@@ -15,8 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { createApp } from 'vue'
import { installI18nOnly } from '@prompt-optimizer/ui'
import { createApp, watch } from 'vue'
import { installI18nOnly, i18n } from '@prompt-optimizer/ui'
import App from './App.vue'
import '@prompt-optimizer/ui/dist/style.css'
@@ -24,6 +24,20 @@ import '@prompt-optimizer/ui/dist/style.css'
const app = createApp(App)
// 只安装i18n插件,语言初始化将在App.vue中服务准备好后进行
installI18nOnly(app)
// 同步文档标题和语言属性
if (typeof document !== 'undefined') {
const syncDocumentTitle = () => {
document.title = i18n.global.t('common.appName')
const currentLocale = String(i18n.global.locale.value || '')
const htmlLang = currentLocale.startsWith('zh') ? 'zh' : 'en'
document.documentElement.setAttribute('lang', htmlLang)
}
syncDocumentTitle()
watch(i18n.global.locale, syncDocumentTitle)
}
app.mount('#app')
// 只在Vercel环境中加载Analytics