feat(i18n): add French language support and enhance localization
All checks were successful
Deploy to production / deploy (push) Successful in 2m48s
All checks were successful
Deploy to production / deploy (push) Successful in 2m48s
- Introduced French as a supported language across the application, updating locale files and adding translations for various components. - Enhanced language handling logic to accommodate French, ensuring proper detection and fallback mechanisms. - Updated UI elements to include French language options, improving accessibility for French-speaking users. - Refactored SEO handling to include French in hreflang links, enhancing search engine indexing for multilingual content. - Added new scripts for managing French translations and ensuring consistency across language files.
This commit is contained in:
@@ -5,6 +5,7 @@ import router from './router';
|
||||
import './assets/styles.scss';
|
||||
import i18n from './i18n';
|
||||
import { setSeoI18nAccessor, applyRouteSeo } from './utils/seo';
|
||||
import { SUPPORTED_UI_LOCALES } from './i18n/supportedLocales.js';
|
||||
import { createVuetify } from 'vuetify';
|
||||
import * as components from 'vuetify/components';
|
||||
import * as directives from 'vuetify/directives';
|
||||
@@ -25,7 +26,15 @@ function getBrowserLanguage() {
|
||||
if (browserLanguage.startsWith('de')) {
|
||||
return 'de';
|
||||
}
|
||||
|
||||
|
||||
if (browserLanguage.startsWith('fr')) {
|
||||
return 'fr';
|
||||
}
|
||||
|
||||
if (browserLanguage.startsWith('es')) {
|
||||
return 'es';
|
||||
}
|
||||
|
||||
// Prüfe alle verfügbaren Sprachen für deutschsprachige Länder
|
||||
const allLanguages = navigator.languages || [navigator.language];
|
||||
for (const lang of allLanguages) {
|
||||
@@ -47,13 +56,23 @@ function getBrowserLanguage() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const lang of allLanguages) {
|
||||
if (lang.startsWith('fr')) {
|
||||
return 'fr';
|
||||
}
|
||||
}
|
||||
|
||||
for (const lang of allLanguages) {
|
||||
if (lang.startsWith('es')) {
|
||||
return 'es';
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: Englisch für alle anderen Sprachen
|
||||
return 'en';
|
||||
}
|
||||
|
||||
const SUPPORTED_UI_LOCALES = ['de', 'en', 'ceb', 'es'];
|
||||
|
||||
function readLangFromUrl() {
|
||||
try {
|
||||
const q = new URLSearchParams(window.location.search).get('lang');
|
||||
|
||||
Reference in New Issue
Block a user