feat(i18n): add French language support and enhance localization
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:
Torsten Schulz (local)
2026-04-07 18:04:03 +02:00
parent f715c6125d
commit f7030bbabe
56 changed files with 5220 additions and 175 deletions

View File

@@ -1,25 +1,17 @@
import { getPublicBaseUrl } from './appConfig.js';
import {
SEO_UI_LOCALES,
HREFLANG_FOR_UI,
OG_LOCALE_FOR_UI,
} from '../i18n/supportedLocales.js';
const DEFAULT_BASE_URL = 'https://www.your-part.de';
const DEFAULT_SITE_NAME = 'YourPart';
const DEFAULT_TITLE = 'YourPart - Community, Chat, Forum, Vokabeltrainer, Falukant und Minispiele';
const DEFAULT_DESCRIPTION = 'YourPart verbindet Community, Chat, Forum, Blogs, Vokabeltrainer, das Aufbauspiel Falukant und Browser-Minispiele auf einer Plattform.';
const DEFAULT_IMAGE = `${DEFAULT_BASE_URL}/images/logos/logo.png`;
const SEO_UI_LOCALES = ['de', 'en', 'es', 'ceb'];
const HREFLANG_FOR_UI = {
de: 'de',
en: 'en',
es: 'es',
ceb: 'ceb',
};
const OG_LOCALE_FOR_UI = {
de: 'de_DE',
en: 'en_GB',
es: 'es_ES',
ceb: 'ceb_PH',
};
export { SEO_UI_LOCALES, HREFLANG_FOR_UI, OG_LOCALE_FOR_UI };
const MANAGED_META_KEYS = [
['name', 'description'],
@@ -138,7 +130,7 @@ function uiLocaleToOgLocale(ui) {
return OG_LOCALE_FOR_UI[ui] || OG_LOCALE_FOR_UI.de;
}
/** OpenGraph locale (z. B. de_DE) aus UI-Sprache (de|en|es|ceb). */
/** OpenGraph locale (z. B. de_DE) aus UI-Sprache (de|en|es|ceb|fr). */
export function seoOgLocale(ui) {
return uiLocaleToOgLocale(ui);
}