Skip to content

Commit

Permalink
1,575th Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Oct 25, 2024
1 parent ad94fcb commit 8b25227
Show file tree
Hide file tree
Showing 7 changed files with 276 additions and 320 deletions.
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"nprogress": "0.2.0",
"ofetch": "1.4.0",
"valibot": "0.42.1",
"vue": "3.5.8",
"vue": "3.5.12",
"vue-advanced-cropper": "2.8.9",
"vue-component-type-helpers": "2.1.6",
"vue-formor": "5.0.0",
"vue-localer": "1.5.2",
"vue-localer": "1.5.3",
"vue-qrcode-image": "1.2.0",
"vue-router": "4.4.5",
"vue-storer": "0.6.0",
Expand Down
5 changes: 4 additions & 1 deletion app/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import '@unocss/reset/tailwind.css';
import 'uno.css';
import { createApp } from 'vue';

import localer from '~/plugins/localer';
import router from '~/plugins/router';
import localer from '~/plugins/localer';

import App from './App.vue';

const app = createApp(App);

app.use(router);
window.router = router;

app.use(localer);
window.localer = localer;

app.mount('#root');
4 changes: 3 additions & 1 deletion app/src/plugins/localer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { createLocaler } from 'vue-localer';

import enUS from '~/locales/en-US';

export default createLocaler({
const localer = createLocaler({
fallbackLocale: 'en-US',
messages: {
'en-US': enUS,
...import.meta.glob(['~/locales/*.ts', '!~/locales/index.ts', '!~/locales/en-US.ts']),
},
});

export default localer;
10 changes: 10 additions & 0 deletions app/src/shims.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
/// <reference types="vite-plugin-vue-routes/client" />

import type { Router } from 'vue-router';
import type { Localer } from 'vue-localer';

declare global {
interface Window {
router: Router;
localer: Localer;
}
}
Loading

0 comments on commit 8b25227

Please sign in to comment.