diff --git a/config.js b/config.js index 89ee91b..d75841e 100644 --- a/config.js +++ b/config.js @@ -8,7 +8,7 @@ window.CONFIG = { debug: 1, theme: 'ash', units: 'metric', - language: 'de' + language: 'en' }; // List of available themes. The key is the theme id (used in config.theme), diff --git a/i18n.js b/i18n.js index de7fc55..ce383ab 100644 --- a/i18n.js +++ b/i18n.js @@ -49,10 +49,16 @@ window.TRANSLATIONS = { }; window.getTranslation = function(key) { - var lang = (window.CONFIG && window.CONFIG.language) || 'de'; + var lang = (window.CONFIG && window.CONFIG.language) || 'en'; var entry = window.TRANSLATIONS[key]; if (!entry) return key; - return entry[lang] || entry.de || key; + // Fallback chain: requested language → 'en' → first available → key + if (entry[lang]) return entry[lang]; + if (entry.en) return entry.en; + for (var k in entry) { + if (entry.hasOwnProperty(k) && entry[k]) return entry[k]; + } + return key; }; window.t = window.getTranslation; \ No newline at end of file diff --git a/index.html b/index.html index 74a0da0..e776962 100644 --- a/index.html +++ b/index.html @@ -1277,8 +1277,8 @@ window.weatherThemes = { ]; var LANGUAGE_OPTIONS = [ - { value: 'de', label: 'DE' }, - { value: 'en', label: 'EN' } + { value: 'en', label: 'EN' }, + { value: 'de', label: 'DE' } ]; function applyI18n() {