no message
This commit is contained in:
parent
570c41bc11
commit
3071859a3d
@ -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",
|
||||
|
@ -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';
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user