added backend which maintains ai instances;
added frontend as control panel
This commit is contained in:
35
frontend/src/locale/de.ts
Normal file
35
frontend/src/locale/de.ts
Normal 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
36
frontend/src/locale/en.ts
Normal 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',
|
||||
},
|
||||
};
|
||||
32
frontend/src/locale/locale.ts
Normal file
32
frontend/src/locale/locale.ts
Normal 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,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user