From b923f4d9b055c6adabd9aabcb0258130a1734c2d Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 Jun 2025 10:00:26 +0200 Subject: [PATCH] Fix JavaScript error: Replace this.translate() with this.getTranslation() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ› Bug Fix: - Fixed TypeError: this.translate is not a function - Replaced all calls to this.translate() with this.getTranslation() - The choice button feature was using non-existent translate method - Now uses the correct getTranslation method that exists in the class โœ… Result: Choice buttons and translations now work correctly --- html/kidsai/script-new.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/html/kidsai/script-new.js b/html/kidsai/script-new.js index bf9b79a..da800ce 100644 --- a/html/kidsai/script-new.js +++ b/html/kidsai/script-new.js @@ -250,7 +250,7 @@ class KidsAIExplorer {
๐Ÿค– - ${this.translate('ai-teacher')} + ${this.getTranslation('ai-teacher')}

${encouragementText}

@@ -389,10 +389,10 @@ class KidsAIExplorer {
๐Ÿค– - ${this.translate('ai-teacher')} + ${this.getTranslation('ai-teacher')}
-

${this.translate('thinking-about-answer')}

+

${this.getTranslation('thinking-about-answer')}

`; @@ -433,7 +433,7 @@ class KidsAIExplorer {
๐Ÿค– - ${this.translate('ai-teacher')} + ${this.getTranslation('ai-teacher')}

${data.response}

@@ -451,10 +451,10 @@ class KidsAIExplorer {
๐Ÿค– - ${this.translate('ai-teacher')} + ${this.getTranslation('ai-teacher')}
-

${this.translate('great-thinking-fallback')}

+

${this.getTranslation('great-thinking-fallback')}

`; @@ -526,7 +526,7 @@ class KidsAIExplorer { responseBubble.innerHTML = `
๐Ÿค– - ${this.translate('ai-teacher')} + ${this.getTranslation('ai-teacher')}

${data.response}

@@ -558,10 +558,10 @@ class KidsAIExplorer { responseBubble.innerHTML = `
๐Ÿค– - ${this.translate('ai-teacher')} + ${this.getTranslation('ai-teacher')}
-

${this.translate('great-thinking-fallback')}

+

${this.getTranslation('great-thinking-fallback')}

`; @@ -583,14 +583,14 @@ class KidsAIExplorer { choiceContainer.className = 'choice-container'; choiceContainer.innerHTML = `
-

๐Ÿ’ญ ${this.translate('explore-deeper')} oder ${this.translate('continue-learning')}?

+

๐Ÿ’ญ ${this.getTranslation('explore-deeper')} oder ${this.getTranslation('continue-learning')}?

`; @@ -645,7 +645,7 @@ class KidsAIExplorer { explorationBubble.innerHTML = `
๐Ÿค– - ${this.translate('ai-teacher')} + ${this.getTranslation('ai-teacher')}

${data.response}

@@ -676,7 +676,7 @@ class KidsAIExplorer { explorationBubble.innerHTML = `
๐Ÿค– - ${this.translate('ai-teacher')} + ${this.getTranslation('ai-teacher')}

๐Ÿ” Das ist ein wirklich interessantes Thema! Hast du schon mal daran gedacht, wie komplex die Wissenschaft dahinter ist? Mรถchtest du noch mehr darรผber erfahren?