// ===== ДАННЫЕ ДЛЯ ЛОКАЛИЗАЦИИ ===== const LANG_DATA = { ru: { main: 'Главная', mods: 'Моды', combo: 'Комбо', devTitle: '⚙️ LyonzyiLeonid5 DevHub', devInfo: 'Здесь собраны все открытые проекты, утилиты и инструменты, разработанные для ETS2 и сообщества. Исходный код, скрипты, конфигураторы и полезные мелочи — всё в одном месте.', statsTitle: '📊 Статистика разработок', gotogithub: '🐙Перейти на Github', repoLabel: 'репозитория', starsLabel: 'звёзд ⭐', forksLabel: 'форков', commitsLabel: 'релиза', reposTitle: '📦 Открытые репозитории', toolsTitle: '🛠️ Инструменты и утилиты', roadmapTitle: '🗺️ План развития (Roadmap)', contribTitle: '🤝 Как внести вклад', contribDesc: 'Любая помощь приветствуется! Вот что можно сделать:', goToOptions: ['Перейти к...', '📌 О проекте', '📊 Статистика', '📦 Репозитории', '🛠️ Инструменты', '🗺️ Roadmap', '🤝 Вклад'], repos: [ { name: 'Extractor Fork', desc: 'Экстрактор от sk-zk, в котором добавлена возможность чтения и исполнения DLL-файлов.', lang: 'C#', stars: 0, forks: 0, icon: '📦', url: 'https://github.com/LyonzyiLeonid5/Extractor-fork' }, //{ name: 'Compressor Plugin', desc: 'Сжимает SCS файлы.', lang: 'C#', stars: 0, forks: 0, icon: '🗜️', url: 'https://github.com/LyonzyiLeonid5/Compressor-Plugin' }, //{ name: 'Mod-Validator', desc: 'Утилита для проверки модов на совместимость, поиска конфликтов и ошибок в manifest.sii.', lang: 'Python', stars: 8, forks: 1, icon: '🔍', url: 'https://github.com/LyonzyiLeonid5/mod-validator' }, //{ name: 'ETS2-Config-Generator', desc: 'Генератор конфигурационных файлов для ETS2 с оптимизацией под разные ПК.', lang: 'JavaScript', stars: 6, forks: 2, icon: '⚙️', url: 'https://github.com/LyonzyiLeonid5/ets2-config-generator' }, //{ name: 'Map-Order-Tool', desc: 'Интерактивный инструмент для визуализации порядка подключения карт в комбо-сборке.', lang: 'HTML/CSS', stars: 5, forks: 0, icon: '📋', url: 'https://github.com/LyonzyiLeonid5/map-order-tool' }, //{ name: 'Telemetry-Exporter', desc: 'Экспорт телеметрии ETS2 в JSON/CSV для анализа и создания дашбордов.', lang: 'C#', stars: 7, forks: 1, icon: '📊', url: 'https://github.com/LyonzyiLeonid5/telemetry-exporter' }, //{ name: 'Save-Editor', desc: 'Редактор сохранений ETS2 с возможностью менять деньги, опыт, парк и параметры грузовиков.', lang: 'Python', stars: 4, forks: 1, icon: '💾', url: 'https://github.com/LyonzyiLeonid5/save-editor' }, ], tools: [ { name: 'Compressor Plugin', desc: 'Сжимает SCS файлы.', lang: 'C#', stars: 0, forks: 0, icon: '🗜️', url: 'https://github.com/LyonzyiLeonid5/Compressor-Plugin' }, //{ name: 'Def-Parser', desc: 'Парсер def-файлов для извлечения и редактирования параметров грузов, трейлеров и двигателей.', lang: 'Python', icon: '📄', url: 'https://github.com/LyonzyiLeonid5/def-parser' }, //{ name: 'Map-Image-Generator', desc: 'Генерация растровых карт из игровых данных для визуализации комбо-сборок.', lang: 'Python', icon: '🖼️', url: 'https://github.com/LyonzyiLeonid5/map-image-generator' }, ], roadmap: [ { text: 'Релиз Extractor Fork', status: 'done' }, { text: 'Релиз Compressor Plugin', status: 'done' }, { text: 'В планах создать автоустановщик комбо-сборок', status: 'plan' }, ] }, en: { main: 'Main', mods: 'Mods', combo: 'Combo', devTitle: '⚙️ LyonzyiLeonid5 DevHub', devInfo: 'All open projects, utilities and tools developed for ETS2 and the community. Source code, scripts, configurators and useful stuff — all in one place.', statsTitle: '📊 Development Stats', gotogithub: '🐙Go to Github', repoLabel: 'repositories', starsLabel: 'stars ⭐', forksLabel: 'forks', commitsLabel: 'releases', reposTitle: '📦 Open Repositories', toolsTitle: '🛠️ Tools & Utilities', roadmapTitle: '🗺️ Roadmap', contribTitle: '🤝 How to Contribute', contribDesc: 'Any help is welcome! Here\'s what you can do:', goToOptions: ['Go to ...', '📌 About', '📊 Stats', '📦 Repositories', '🛠️ Tools', '🗺️ Roadmap', '🤝 Contribute'], repos: [ { name: 'Extractor Fork', desc: 'Extractor by sk-zk, which adds the ability to read and execute DLL files.', lang: 'C#', stars: 0, forks: 0, icon: '📦', url: 'https://github.com/LyonzyiLeonid5/Extractor-fork' }, //{ name: 'Compressor Plugin', desc: 'Compresses SCS files.', lang: 'C#', stars: 0, forks: 0, icon: '🗜️', url: 'https://github.com/LyonzyiLeonid5/Compressor-Plugin' }, //{ name: 'Mod-Validator', desc: 'Utility for checking mods compatibility, finding conflicts and errors in manifest.sii.', lang: 'Python', stars: 8, forks: 1, icon: '🔍', url: 'https://github.com/LyonzyiLeonid5/mod-validator' }, //{ name: 'ETS2-Config-Generator', desc: 'Generator of configuration files for ETS2 with optimization for different PCs.', lang: 'JavaScript', stars: 6, forks: 2, icon: '⚙️', url: 'https://github.com/LyonzyiLeonid5/ets2-config-generator' }, //{ name: 'Map-Order-Tool', desc: 'Interactive tool for visualizing map load order in combo builds.', lang: 'HTML/CSS', stars: 5, forks: 0, icon: '📋', url: 'https://github.com/LyonzyiLeonid5/map-order-tool' }, //{ name: 'Telemetry-Exporter', desc: 'ETS2 telemetry export to JSON/CSV for analysis and dashboard creation.', lang: 'C#', stars: 7, forks: 1, icon: '📊', url: 'https://github.com/LyonzyiLeonid5/telemetry-exporter' }, //{ name: 'Save-Editor', desc: 'ETS2 save editor with ability to change money, XP, fleet and truck parameters.', lang: 'Python', stars: 4, forks: 1, icon: '💾', url: 'https://github.com/LyonzyiLeonid5/save-editor' }, ], tools: [ { name: 'Compressor Plugin', desc: 'Compresses SCS files.', lang: 'C#', stars: 0, forks: 0, icon: '🗜️', url: 'https://github.com/LyonzyiLeonid5/Compressor-Plugin' }, //{ name: 'Def-Parser', desc: 'Parser for def-files to extract and edit cargo, trailer and engine parameters.', lang: 'Python', icon: '📄', url: 'https://github.com/LyonzyiLeonid5/def-parser' }, //{ name: 'Map-Image-Generator', desc: 'Generate raster maps from game data for visualizing combo builds.', lang: 'Python', icon: '🖼️', url: 'https://github.com/LyonzyiLeonid5/map-image-generator' }, ], roadmap: [ { text: 'Release Extractor Fork', status: 'done' }, { text: 'Release Compressor Plugin', status: 'done' }, { text: 'There are plans to create an automatic installer for combos.', status: 'plan' }, ] } }; // ===== ТЕКУЩИЙ ЯЗЫК (используем ОБЩИЙ ключ 'lang') ===== let currentLang = localStorage.getItem('lang') || 'ru'; // ===== ФУНКЦИЯ УСТАНОВКИ ЯЗЫКА ===== function setLang(lang) { if (!LANG_DATA[lang]) return; currentLang = lang; const data = LANG_DATA[lang]; // Header tabs const headerTabs = document.querySelectorAll('.nav .tab'); if (headerTabs[0]) headerTabs[0].innerText = data.main; if (headerTabs[1]) headerTabs[1].innerText = data.mods; if (headerTabs[2]) headerTabs[2].innerText = data.combo; // Side panel tabs const sideTabs = document.querySelectorAll('.left-panel .tab'); if (sideTabs[0]) sideTabs[0].innerText = data.main; if (sideTabs[1]) sideTabs[1].innerText = data.mods; if (sideTabs[2]) sideTabs[2].innerText = data.combo; // === Основные тексты === document.getElementById('devTitle').textContent = data.devTitle; document.getElementById('devInfo').textContent = data.devInfo; document.getElementById('statsTitle').textContent = data.statsTitle; document.getElementById('gotogithub').innerHTML = data.gotogithub; document.getElementById('repoLabel').textContent = data.repoLabel; //document.getElementById('starsLabel').textContent = data.starsLabel; //document.getElementById('forksLabel').textContent = data.forksLabel; document.getElementById('commitsLabel').textContent = data.commitsLabel; document.getElementById('reposTitle').textContent = data.reposTitle; //document.getElementById('toolsTitle').textContent = data.toolsTitle; document.getElementById('roadmapTitle').textContent = data.roadmapTitle; //document.getElementById('contribTitle').textContent = data.contribTitle; //document.getElementById('contribDesc').textContent = data.contribDesc; // === Обновляем GoTo селекты === const goToOptions = data.goToOptions; const selects = ['navSelect', 'gotonavSelect']; selects.forEach(id => { const select = document.getElementById(id); if (select) { const options = select.options; for (let i = 0; i < options.length && i < goToOptions.length; i++) { options[i].text = goToOptions[i]; } select.value = ''; } }); // === Обновляем селекты языка === document.querySelectorAll('#langSelect, #langSelectSide').forEach(select => { select.value = lang; }); // === Рендерим контент === renderRepos(data.repos, 'repoGrid'); renderRepos(data.tools, 'toolsGrid', true); renderRoadmap(data.roadmap); // === Сохраняем язык в ОБЩИЙ ключ === localStorage.setItem('lang', lang); } // ===== РЕНДЕРИНГ РЕПОЗИТОРИЕВ ===== function renderRepos(repos, containerId, isTool = false) { const container = document.getElementById(containerId); if (!container) return; container.innerHTML = ''; repos.forEach(repo => { const card = document.createElement('div'); card.className = 'repo-card'; card.innerHTML = `