feat(i18n): add support for Polish, Spanish, Arabic, and Ukrainian

- Create lesson directories and copy English lessons as templates
- Add full UI translations for pl, es, ar, uk languages
- Update lessons.js with module stores for all new languages
- Implement language cycling (en → de → pl → es → ar → uk → en)
- Fix playground mode detection (lesson.mode takes precedence)
This commit is contained in:
2025-12-31 01:45:52 +01:00
parent 89ad5228b4
commit b9d9a0ab0c
63 changed files with 9275 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ import { LessonEngine } from "./impl/LessonEngine.js";
import { CodeEditor } from "./impl/CodeEditor.js";
import { renderLesson, renderModuleList, renderLevelIndicator, updateActiveLessonInSidebar } from "./helpers/renderer.js";
import { loadModules } from "./config/lessons.js";
import { initI18n, t, getLanguage, setLanguage, applyTranslations } from "./i18n.js";
import { initI18n, t, getLanguage, setLanguage, getNextLanguage, applyTranslations } from "./i18n.js";
// Simplified state - LessonEngine now manages lesson state and progress
const state = {
@@ -119,7 +119,7 @@ function toggleExpectedResult() {
function toggleLanguage() {
const currentLang = getLanguage();
const newLang = currentLang === "en" ? "de" : "en";
const newLang = getNextLanguage(currentLang);
// Add transition class before any updates
elements.editorSection?.classList.add("transitioning");