i18n: Aufraeumen und Doku-Update (Phase 5)
- lagebild.js: tote initLangToggle() und switchContent() entfernt; initTranslations()-Aufruf aus init() raus (translations.js gibt es nicht mehr). Kein neues Verhalten, nur Aufraeumen. - CLAUDE.md aktualisiert: en/situations/-Struktur, Slug-Mapping, Daten-Freigabe-Konzept, Kontaktformular i18n-Hinweis, CHANGE_LOG erweitert. Backend (contact-form.py) wurde live ausgerollt und ist nicht im Repo (liegt unter /opt/v2-Docker/aegis-website/), Backup unter contact-form.py.bak.<timestamp>. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -110,9 +110,6 @@ var Lagebild = {
|
||||
},
|
||||
|
||||
async init() {
|
||||
if (typeof initTranslations === 'function') {
|
||||
try { initTranslations(); } catch(e) {}
|
||||
}
|
||||
this.initScrollProgress();
|
||||
this.initParticles();
|
||||
try {
|
||||
@@ -134,7 +131,6 @@ var Lagebild = {
|
||||
};
|
||||
this.render();
|
||||
this.initTabs();
|
||||
this.initLangToggle();
|
||||
this.initScrollReveal();
|
||||
this.initFloatingCta();
|
||||
this.initLiveFeed();
|
||||
@@ -1214,68 +1210,6 @@ var Lagebild = {
|
||||
}
|
||||
},
|
||||
|
||||
initLangToggle: function() {
|
||||
var btn = document.querySelector('.lang-toggle');
|
||||
if (!btn) return;
|
||||
var self = this;
|
||||
btn.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
var cur = (typeof getCurrentLanguage === 'function') ? getCurrentLanguage() : 'de';
|
||||
var newLang = cur === 'de' ? 'en' : 'de';
|
||||
if (typeof switchLanguage === 'function') switchLanguage(newLang);
|
||||
self.switchContent(newLang);
|
||||
});
|
||||
},
|
||||
|
||||
switchContent: async function(lang) {
|
||||
var base = this.dataBase();
|
||||
var jsonFile = base + (lang === 'en' ? 'data/current_en.json' : 'data/current.json');
|
||||
try {
|
||||
var resp = await fetch(jsonFile + '?t=' + Date.now());
|
||||
if (!resp.ok && lang === 'en') {
|
||||
resp = await fetch(base + 'data/current.json?t=' + Date.now());
|
||||
}
|
||||
if (!resp.ok) throw new Error('HTTP ' + resp.status);
|
||||
this.data = await resp.json();
|
||||
this.allSnapshots = {};
|
||||
this.currentView = {
|
||||
summary: this.data.current_lagebild.summary_markdown,
|
||||
sources_json: this.data.current_lagebild.sources_json,
|
||||
updated_at: this.data.current_lagebild.updated_at || this.data.generated_at,
|
||||
articles: this.data.articles,
|
||||
fact_checks: this.data.fact_checks,
|
||||
article_count: this.data.incident.article_count,
|
||||
fact_check_count: this.data.incident.factcheck_count
|
||||
};
|
||||
this.render();
|
||||
// Update hero title for language
|
||||
var heroH1 = document.getElementById('hero-title');
|
||||
if (heroH1) {
|
||||
var isResearch = this.data.incident && this.data.incident.type === 'research';
|
||||
heroH1.textContent = isResearch ? this.t('heroResearch') : this.t('hero');
|
||||
}
|
||||
// Update tab labels
|
||||
var tabBtns = document.querySelectorAll('.tab-btn');
|
||||
var isResearch = this.data.incident && this.data.incident.type === 'research';
|
||||
for (var i = 0; i < tabBtns.length; i++) {
|
||||
var tab = tabBtns[i].getAttribute('data-tab');
|
||||
if (tab === 'lagebild') tabBtns[i].childNodes[0].textContent = isResearch ? this.t('tabBriefingResearch') : this.t('tabBriefing');
|
||||
else if (tab === 'ueberblick') tabBtns[i].childNodes[0].textContent = isResearch ? this.t('tabUeberblickResearch') : this.t('tabUeberblick');
|
||||
else if (tab === 'karte') tabBtns[i].childNodes[0].textContent = this.t('tabMap');
|
||||
else if (tab === 'faktenchecks') tabBtns[i].childNodes[0].textContent = this.t('tabFactchecks') + ' ';
|
||||
else if (tab === 'quellen') tabBtns[i].childNodes[0].textContent = this.t('tabSources') + ' ';
|
||||
}
|
||||
// Update Ueberblick H2 title
|
||||
var ueberblickH2 = document.getElementById('ueberblick-title');
|
||||
if (ueberblickH2) ueberblickH2.textContent = isResearch ? this.t('tabUeberblickResearch') : this.t('tabUeberblick');
|
||||
// Update data source note
|
||||
var dsNote = document.querySelector('.data-source-note');
|
||||
if (dsNote) dsNote.textContent = this.t('dataSource');
|
||||
} catch(e) {
|
||||
console.error('Language switch failed:', e);
|
||||
}
|
||||
},
|
||||
|
||||
/* ===== FLOATING CTA ===== */
|
||||
initFloatingCta: function() {
|
||||
var cta = document.createElement('div');
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren