All checks were successful
Deploy to production / deploy (push) Successful in 2m47s
- Updated the create-german-for-bisaya-course-content.js script to improve lesson pattern retrieval by introducing a new function for generating a lesson pattern pool. - Added new exercises for various topics including 'Wohnung & Nachbarn', 'Besuch empfangen', 'Arzt, Apotheke, Termin', and 'Amt, Dokumente, Anmeldung', enhancing practical language skills for learners. - Improved localization by integrating translation keys for various UI elements and error messages across multiple components, ensuring a consistent user experience in both German and Bisaya. - Enhanced the main.js file to recognize Bisaya language preferences in browser settings, improving accessibility for users.
70 lines
2.1 KiB
JavaScript
70 lines
2.1 KiB
JavaScript
import { createApp } from 'vue';
|
|
import App from './App.vue';
|
|
import store from './store';
|
|
import router from './router';
|
|
import './assets/styles.scss';
|
|
import i18n from './i18n';
|
|
import { createVuetify } from 'vuetify';
|
|
import * as components from 'vuetify/components';
|
|
import * as directives from 'vuetify/directives';
|
|
import feedbackPlugin from './utils/feedback';
|
|
|
|
function getBrowserLanguage() {
|
|
// Prüfe zuerst die bevorzugte Sprache
|
|
const browserLanguage = navigator.language || navigator.languages[0];
|
|
|
|
if (browserLanguage.startsWith('ceb') || browserLanguage.startsWith('bis')) {
|
|
return 'ceb';
|
|
}
|
|
|
|
// Deutschsprachige Länder: Deutschland, Österreich, Schweiz, Liechtenstein
|
|
const germanSpeakingCountries = ['de', 'at', 'ch', 'li'];
|
|
|
|
// Prüfe ob die Sprache mit 'de' beginnt (deutsch)
|
|
if (browserLanguage.startsWith('de')) {
|
|
return 'de';
|
|
}
|
|
|
|
// Prüfe alle verfügbaren Sprachen für deutschsprachige Länder
|
|
const allLanguages = navigator.languages || [navigator.language];
|
|
for (const lang of allLanguages) {
|
|
if (lang.startsWith('ceb') || lang.startsWith('bis')) {
|
|
return 'ceb';
|
|
}
|
|
// Prüfe auf de-XX Format (z.B. de-DE, de-AT, de-CH, de-LI)
|
|
if (lang.startsWith('de-')) {
|
|
const countryCode = lang.split('-')[1]?.toLowerCase();
|
|
if (germanSpeakingCountries.includes(countryCode)) {
|
|
return 'de';
|
|
}
|
|
}
|
|
// Prüfe auch auf direkte Länderkennung (z.B. de_AT, de_CH)
|
|
if (lang.startsWith('de_')) {
|
|
const countryCode = lang.split('_')[1]?.toLowerCase();
|
|
if (germanSpeakingCountries.includes(countryCode)) {
|
|
return 'de';
|
|
}
|
|
}
|
|
}
|
|
|
|
// Fallback: Englisch für alle anderen Sprachen
|
|
return 'en';
|
|
}
|
|
|
|
const vuetify = createVuetify({
|
|
components,
|
|
directives,
|
|
});
|
|
|
|
store.dispatch('setLanguage', getBrowserLanguage());
|
|
|
|
const app = createApp(App);
|
|
|
|
app.use(store);
|
|
app.use(router);
|
|
app.use(i18n);
|
|
app.use(vuetify);
|
|
app.use(feedbackPlugin);
|
|
|
|
app.mount('#app');
|