From cfa9c34962093ef1c04feebbff2cd04a2e7b99e0 Mon Sep 17 00:00:00 2001 From: Alessio Tudisco Date: Sun, 5 Apr 2026 00:36:12 +0200 Subject: [PATCH] feat: add italian language --- index.html | 12 +--- js/i18n.js | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 197 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 7d9c8ad..341c2b6 100644 --- a/index.html +++ b/index.html @@ -15,17 +15,6 @@ : window.matchMedia('(prefers-color-scheme: dark)').matches; if (!prefersDark) document.documentElement.setAttribute('data-theme', 'light'); })(); - // Apply saved language before first paint to avoid flash - (function() { - const l = localStorage.getItem('stlt-lang'); - if (l === 'de' || l === 'en') { - document.documentElement.setAttribute('data-lang', l); - document.documentElement.setAttribute('lang', l); - } else if (navigator.language && navigator.language.toLowerCase().startsWith('de')) { - document.documentElement.setAttribute('data-lang', 'de'); - document.documentElement.setAttribute('lang', 'de'); - } - })();