added backend which maintains ai instances;

added frontend as control panel
This commit is contained in:
wea_ondara
2024-04-24 19:40:03 +02:00
parent 9cafd8b1e9
commit 41474d474c
79 changed files with 9022 additions and 0 deletions

35
frontend/src/locale/de.ts Normal file
View File

@@ -0,0 +1,35 @@
import {messagesEn} from '@/locale/en';
export const messagesDe = {
design: 'Design',
locale: 'Sprache',
locales: messagesEn.locales,
menu: {
about: 'Über',
list: 'Liste',
},
search: 'Suche',
};
export const datetimeFormatsDe = {
date: {
year: 'numeric',
month: 'numeric',
day: 'numeric',
},
datetime: {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
},
datetimeSeconds: {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
seconds: 'numeric',
},
};

36
frontend/src/locale/en.ts Normal file
View File

@@ -0,0 +1,36 @@
export const messagesEn = {
design: 'Design',
locale: 'Language',
locales: {
'de': 'Deutsch',
'en': 'English',
},
menu: {
about: 'About',
list: 'List',
},
search: 'Search',
};
export const datetimeFormatsEn = {
date: {
year: 'numeric',
month: 'numeric',
day: 'numeric',
},
datetime: {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
},
datetimeSeconds: {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
seconds: 'numeric',
},
};

View File

@@ -0,0 +1,32 @@
import type {I18n} from 'vue-i18n';
import {createI18n as vueCreateI18n} from 'vue-i18n';
import {datetimeFormatsEn, messagesEn} from '@/locale/en';
import {datetimeFormatsDe, messagesDe} from '@/locale/de';
const messages = {
en: messagesEn,
de: messagesDe,
};
const datetimeFormats = {
en: datetimeFormatsEn,
de: datetimeFormatsDe,
};
export function createI18n(): I18n {
let browserLocale = (navigator.language ?? '').toLowerCase();
const match = browserLocale.match(/^([a-z][a-z])/);
if (match) {
browserLocale = match[1];
} else {
browserLocale = 'en';
}
return vueCreateI18n({
locale: browserLocale,
fallbackLocale: 'en',
messages: messages,
//@ts-ignore TS2769 TODO weird typing issue
datetimeFormats: datetimeFormats,
legacy: true,
});
}