feat:#60 format, lint and fix build

This commit is contained in:
masterElmar
2023-11-16 23:45:45 +01:00
parent 9f937afe94
commit e9db7cb4b0
24 changed files with 307 additions and 271 deletions

View File

@@ -1,14 +1,14 @@
import { createI18n } from "vue-i18n";
import en from './translations/en.json'
import de from './translations/de.json'
import en from "./translations/en.json";
import de from "./translations/de.json";
import localeStore from "../store/localeStore.ts";
export const supportedLocales= {
'en': { name: 'English'},
'de': { name: 'Deutsch'},
}
export const supportedLocales = {
en: { name: "English" },
de: { name: "Deutsch" },
};
// Private instance of VueI18n object
let _i18n: any
let _i18n: any;
// Initializer
function setup() {
_i18n = createI18n({
@@ -17,30 +17,30 @@ function setup() {
fallbackLocale: "en",
messages: {
en,
de
de,
},
})
return _i18n
});
return _i18n;
}
// Sets the active locale.
function setLocale(newLocale : any) {
_i18n.global.locale = newLocale
setDocumentAttributesFor(newLocale)
function setLocale(newLocale: any) {
_i18n.global.locale = newLocale;
setDocumentAttributesFor(newLocale);
}
function setDocumentAttributesFor(locale: any) {
const htmlElement = document.querySelector('html')
const htmlElement = document.querySelector("html");
htmlElement?.setAttribute('lang', locale)
htmlElement?.setAttribute("lang", locale);
}
// Public interface
export default {
// Expose the VueI18n instance via a getter
get vueI18n() {
return _i18n
return _i18n;
},
setup,
setLocale,
}
};

View File

@@ -1,5 +1,5 @@
export default {
en : {
en: {
createCalendar: "Create Calendar",
editCalendar: "Edit Calendar",
roomFinder: "Room Finder",
@@ -7,12 +7,12 @@ export default {
imprint: "Imprint",
privacy: "Privacy Policy",
},
de : {
de: {
createCalendar: "Kalender erstellen",
editCalendar: "Kalender bearbeiten",
roomFinder: "Raumfinder",
faq: "FAQ",
imprint: "Impressum",
privacy: "Datenschutz"
}
}
privacy: "Datenschutz",
},
};

View File

@@ -23,7 +23,7 @@
"dropDownSelect": "Bitte wähle einen Raum aus",
"noRoomsAvailable": "Keine Räume verfügbar"
},
"moduleSelection":{
"moduleSelection": {
"nextStep": "Weiter",
"selectAll": "Alle anwählen",
"deselectAll": "Alle abwählen",
@@ -57,7 +57,7 @@
"subTitle": "Konfigurieren Sie die ausgewählten Module nach Ihren Wünschen.",
"nextStep": "Weiter"
},
"moduleTemplateDialog":{
"moduleTemplateDialog": {
"explanationOne": "Hier können Module nach Wunsch umbenannt werden. Welche dann als Anzeigename im Kalender dargestellt werden.",
"explanationTwo": "Zusätzlich können Sie Benachrichtigungen für jedes Modul einschalten, damit für jeden Termin 15 Minuten vor Beginn einen Erinnerung geschalten wird.",
"tableDescription": "Sie können die folgenden Platzhalter in Ihren Modulnamen verwenden:",
@@ -81,4 +81,4 @@
"toGoogleCalendar": "Google Kalender",
"toMicrosoftCalendar": "Microsoft Kalender"
}
}
}

View File

@@ -23,7 +23,7 @@
"dropDownSelect": "Please select a room",
"noRoomsAvailable": "No rooms listed"
},
"moduleSelection":{
"moduleSelection": {
"nextStep": "next step",
"selectAll": "select all",
"deselectAll": "deselect all",
@@ -57,7 +57,7 @@
"subTitle": "Configure your selected Modules to your liking.",
"nextStep": "next step"
},
"moduleTemplateDialog":{
"moduleTemplateDialog": {
"explanationOne": "Here you can rename your modules to your liking. This will be the name of the event in your calendar.",
"explanationTwo": "Additionally, you can toggle notifications for each module. If you do so, you will be notified 15 minutes before the event starts.",
"tableDescription": "You can use the following placeholders in your module names:",
@@ -81,4 +81,4 @@
"toGoogleCalendar": "to Google Calendar",
"toMicrosoftCalendar": "to Microsoft Calendar"
}
}
}