diff --git a/html/kidsai/script-new.js b/html/kidsai/script-new.js index da800ce..26fb698 100644 --- a/html/kidsai/script-new.js +++ b/html/kidsai/script-new.js @@ -242,15 +242,16 @@ class KidsAIExplorer { const welcomeStep = document.createElement('div'); welcomeStep.className = 'conversation-step visible'; - // Get translated messages + // Get translations before creating HTML to avoid context issues const encouragementText = guidance.encouragement || this.getTranslation('default-encouragement') || "Great question! Let's explore this together step by step! 🚀"; const detectiveHelpText = this.getTranslation('detective-help') || "Instead of giving you the answer right away, I'll help you think through this like a detective! 🕵️"; + const aiTeacherText = this.getTranslation('ai-teacher') || "AI Teacher"; welcomeStep.innerHTML = `
🤖 - ${this.getTranslation('ai-teacher')} + ${aiTeacherText}

${encouragementText}

@@ -579,18 +580,24 @@ class KidsAIExplorer { } addContinueChoiceButtons() { + // Get translations before creating HTML to avoid context issues + const exploreDeeperText = this.getTranslation('explore-deeper') || "I want to explore this deeper"; + const continueLearningText = this.getTranslation('continue-learning') || "Continue with next topic"; + const tellMeMoreText = this.getTranslation('tell-me-more') || "Tell me more! 🤔"; + const nextQuestionText = this.getTranslation('next-question') || "Next question! ➡️"; + const choiceContainer = document.createElement('div'); choiceContainer.className = 'choice-container'; choiceContainer.innerHTML = `
-

💭 ${this.getTranslation('explore-deeper')} oder ${this.getTranslation('continue-learning')}?

+

💭 ${exploreDeeperText} oder ${continueLearningText}?

`;