1
0
Fork 0
mirror of https://github.com/Luzifer/share.git synced 2024-12-20 18:41:17 +00:00
share/frontend-src/main.ts
Knut Ahlers 549f0d1f36
Port frontend to Vue 3 / Bootstrap 5.3
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-03-18 20:22:31 +01:00

39 lines
1 KiB
TypeScript

/* eslint-disable sort-imports */
import 'bootstrap/dist/css/bootstrap.css'
import '@fortawesome/fontawesome-free/css/all.css'
import { createApp, h } from 'vue'
import { createI18n } from 'vue-i18n'
import ContentDisplay from './display.vue'
const messages = {
en: {
fileNotFound: 'The requested file has not been found.',
genericError: 'Something went wrong (Status {status})',
loading: 'Loading file details...',
notPermitted: 'Access to this file was denied.',
},
de: {
fileNotFound: 'Die angegebene Datei wurde nicht gefunden.',
genericError: 'Irgendwas lief schief... (Status {status})',
loading: 'Lade Datei-Informationen...',
notPermitted: 'Der Zugriff auf diese Datei wurde verweigert.',
},
}
const app = createApp({
name: 'Share',
render() {
return h(ContentDisplay)
},
})
app.use(createI18n({
fallbackLocale: 'en',
locale: new URLSearchParams(window.location.search).get('hl') || navigator.languages?.[0].split('-')[0] || navigator.language?.split('-')[0] || 'en',
messages,
}))
app.mount('#app')