- Rebuild complet SvelteKit 2 + Svelte 5 runes + TypeScript, adapter-static - Images self-hébergées optimisées au build (vite-imagetools), fonts Archivo/Inter en woff2 local — BunnyCDN et Google Fonts supprimés (corrige les 403 d'images) - Tokens charte OKI, thème sombre par défaut / clair opt-in, zéro emoji (set SVG) - Motion : KineticText (stagger syncopé gwoka), ScrollProgressBar, View Transitions - Village SVG isométrique pour les services hébergés + fallback accessible - PWA (manifest + SW hors-ligne), 404 en KA, CSP nettoyée (.htaccess + _headers) - Lighthouse mobile : 91/100/100/100 — JS initial 67 Ko gzip
16 lines
657 B
JavaScript
16 lines
657 B
JavaScript
(function() {
|
|
// Redirection automatique selon la langue du navigateur, sauf choix explicite déjà mémorisé
|
|
var pref = localStorage.getItem('oki-lang-pref');
|
|
if (pref) return;
|
|
|
|
var browserLang = (navigator.language || navigator.userLanguage || '').toLowerCase();
|
|
var wantsEnglish = browserLang.indexOf('en') === 0;
|
|
var currentLocale = document.documentElement.dataset.locale || 'fr';
|
|
|
|
if (wantsEnglish && currentLocale !== 'en') {
|
|
window.location.replace('/en/' + window.location.hash);
|
|
} else if (!wantsEnglish && currentLocale === 'en') {
|
|
window.location.replace('/' + window.location.hash);
|
|
}
|
|
})();
|