Initial commit: KidsAI Explorer with complete functionality
- Complete KidsAI Explorer application - Multi-language support (English/German) - AI-powered educational guidance using OpenAI - Interactive chat interface for children - Proper placeholder translation fixes - Mobile-responsive design - Educational framework for critical thinking
This commit is contained in:
44
test-translations.js
Normal file
44
test-translations.js
Normal file
@@ -0,0 +1,44 @@
|
||||
// Quick test script to validate translations
|
||||
const fs = require('fs');
|
||||
|
||||
// Load and parse translations manually
|
||||
const translationsCode = fs.readFileSync('translations.js', 'utf8');
|
||||
|
||||
// Extract just the translations object
|
||||
const translationsMatch = translationsCode.match(/const translations = ({[\s\S]*?});/);
|
||||
if (!translationsMatch) {
|
||||
console.error('Could not parse translations');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const translations = eval(`(${translationsMatch[1]})`);
|
||||
|
||||
// Test key translations exist
|
||||
const testKeys = [
|
||||
'title', 'tagline', 'welcome-title', 'welcome-text',
|
||||
'ai-teacher', 'scientific-explanation', 'type-thoughts-placeholder',
|
||||
'send-button', 'the-answer', 'reveal-answer', 'getting-answer',
|
||||
'great-thinking-fallback', 'thinking-about-answer', 'hmm'
|
||||
];
|
||||
|
||||
console.log('🧪 Testing translation completeness...\n');
|
||||
|
||||
let allGood = true;
|
||||
|
||||
testKeys.forEach(key => {
|
||||
const enExists = translations.en[key] !== undefined;
|
||||
const deExists = translations.de[key] !== undefined;
|
||||
|
||||
if (!enExists || !deExists) {
|
||||
console.log(`❌ Missing translation for '${key}': EN=${enExists}, DE=${deExists}`);
|
||||
allGood = false;
|
||||
} else {
|
||||
console.log(`✅ '${key}': EN="${translations.en[key]}" | DE="${translations.de[key]}"`);
|
||||
}
|
||||
});
|
||||
|
||||
if (allGood) {
|
||||
console.log('\n🎉 All translations complete!');
|
||||
} else {
|
||||
console.log('\n⚠️ Some translations are missing');
|
||||
}
|
||||
Reference in New Issue
Block a user