no message

This commit is contained in:
Armamem0t 2025-07-01 10:25:43 +08:00
parent 570c41bc11
commit 3071859a3d
Signed by: minglipro
GPG Key ID: 5F355A77B22AA93B
4 changed files with 18 additions and 45 deletions

View File

@ -9,6 +9,7 @@
"build-jar-auto": "run-p \"build-only\" && gradle -Dorg.gradle.java.home=/opt/jdk/21.0.7/ build-jar",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-preview": "run-p build-only && vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --build",
"lint:oxlint": "oxlint . --fix -D correctness --ignore-path .gitignore",

View File

@ -16,7 +16,7 @@
}"
@click="router.push({ name: 'home' })">
<Icon icon="material-symbols:home" />
{{ t('nav.title.home') }}
{{ $t('nav.title.home') }}
<div class="after"></div>
</div>
<div
@ -86,15 +86,7 @@
<script lang="ts" setup>
import Icon from '@/components/Icon.vue';
import { UseBoolRef } from '@/util';
import {
type languageIndexItemValueType,
message,
messageData,
router,
t,
UseAuthStore,
UseSettingStore,
} from '@/plugin';
import { type languageIndexItemValueType, message, messageData, router, UseAuthStore, UseSettingStore } from '@/plugin';
import { getSysInfo } from '@/api/system.ts';
import type { SelectOption } from 'naive-ui/es/select/src/interface';
import type { VNodeChild } from 'vue';

View File

@ -4,13 +4,13 @@ import './assets/index.sass';
import { createApp } from 'vue';
import App from './App.vue';
import { installI18n, pinia, router } from './plugin';
import { i18n, installI18n, pinia, router } from './plugin';
installI18n().then((i18n) => {
const app = createApp(App);
app.use(i18n);
app.use(pinia);
app.use(router);
app.mount('#app');
console.log(i18n);
});
const app = createApp(App);
app.use(i18n);
app.use(pinia);
app.use(router);
app.mount('#app');
console.log(i18n);
await installI18n();

View File

@ -32,22 +32,12 @@ export const messages: languageType | any = {};
export const messageData = ref<languageIndexItemValueType[]>([]);
export let i18n: ReturnType<
typeof createI18n<
{
legacy: boolean;
locale: string;
fallbackLocale: string;
messages: any;
},
any,
any
>
>;
export function t(data: string): string {
return i18n.global.t(data);
}
export const i18n = createI18n({
legacy: false,
locale: 'zh-cn',
fallbackLocale: 'zh-cn',
messages,
});
export async function installI18n() {
const data: languageIndexType = await loadIndexFile();
@ -59,14 +49,4 @@ export async function installI18n() {
});
messages[i.id] = await loadLanguageFile(i.file);
}
console.log(messages);
console.log(languagedatas);
console.log(messageData);
i18n = createI18n({
legacy: false,
locale: 'zh-cn',
fallbackLocale: 'zh-cn',
messages,
});
return i18n;
}