Подэтап 2.3 — Мультиязычность
Browse filesВнедрить Next-i18n.
Добавить локализации: RU, TJ, UZ, KG, EN, UA.
Автоматическая подстановка языка по IP / выбор вручную.
- auth.html +13 -4
- data-architecture.html +12 -3
- i18n-setup.js +111 -0
- index.html +12 -3
- select-role.html +13 -4
auth.html
CHANGED
|
@@ -37,10 +37,16 @@
|
|
| 37 |
<div class="container mx-auto px-4 py-12">
|
| 38 |
<div class="max-w-md mx-auto glass-card p-8">
|
| 39 |
<div class="text-center mb-8">
|
| 40 |
-
<div class="flex justify-center mb-4">
|
| 41 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
</div>
|
| 43 |
-
|
| 44 |
<p class="text-slate-300">Sign in to continue</p>
|
| 45 |
</div>
|
| 46 |
|
|
@@ -140,8 +146,11 @@
|
|
| 140 |
alert('Google sign-in failed: ' + error.message);
|
| 141 |
});
|
| 142 |
});
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
feather.replace();
|
| 145 |
-
|
| 146 |
</body>
|
| 147 |
</html>
|
|
|
|
| 37 |
<div class="container mx-auto px-4 py-12">
|
| 38 |
<div class="max-w-md mx-auto glass-card p-8">
|
| 39 |
<div class="text-center mb-8">
|
| 40 |
+
<div class="flex justify-between items-center mb-4">
|
| 41 |
+
<div class="flex items-center">
|
| 42 |
+
<i data-feather="cpu" class="text-indigo-500 w-12 h-12"></i>
|
| 43 |
+
</div>
|
| 44 |
+
<a href="i18n-setup.html" class="flex items-center text-sm hover:text-indigo-400 transition-colors">
|
| 45 |
+
<i data-feather="globe" class="w-4 h-4 mr-1"></i>
|
| 46 |
+
<span id="currentLang">EN</span>
|
| 47 |
+
</a>
|
| 48 |
</div>
|
| 49 |
+
<h1 class="text-3xl font-bold gradient-text mb-2">Welcome to QuantumCode</h1>
|
| 50 |
<p class="text-slate-300">Sign in to continue</p>
|
| 51 |
</div>
|
| 52 |
|
|
|
|
| 146 |
alert('Google sign-in failed: ' + error.message);
|
| 147 |
});
|
| 148 |
});
|
| 149 |
+
// Set initial language
|
| 150 |
+
document.getElementById('currentLang').textContent =
|
| 151 |
+
document.cookie.match('(^|;)\\s*NEXT_LOCALE\\s*=\\s*([^;]+)')?.pop() || 'EN';
|
| 152 |
|
| 153 |
feather.replace();
|
| 154 |
+
</script>
|
| 155 |
</body>
|
| 156 |
</html>
|
data-architecture.html
CHANGED
|
@@ -41,7 +41,13 @@
|
|
| 41 |
<i data-feather="cpu" class="text-indigo-500"></i>
|
| 42 |
<span class="text-xl font-bold gradient-text">QuantumCode</span>
|
| 43 |
</div>
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
<a href="index.html" class="hover:text-indigo-400 transition-colors">Home</a>
|
| 46 |
<a href="index.html#features" class="hover:text-indigo-400 transition-colors">Features</a>
|
| 47 |
<a href="index.html#roadmap" class="hover:text-indigo-400 transition-colors">Roadmap</a>
|
|
@@ -155,9 +161,12 @@
|
|
| 155 |
</p>
|
| 156 |
</div>
|
| 157 |
</footer>
|
| 158 |
-
|
| 159 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
feather.replace();
|
| 161 |
-
|
| 162 |
</body>
|
| 163 |
</html>
|
|
|
|
| 41 |
<i data-feather="cpu" class="text-indigo-500"></i>
|
| 42 |
<span class="text-xl font-bold gradient-text">QuantumCode</span>
|
| 43 |
</div>
|
| 44 |
+
<div class="flex items-center space-x-2">
|
| 45 |
+
<a href="i18n-setup.html" class="flex items-center text-sm hover:text-indigo-400 transition-colors">
|
| 46 |
+
<i data-feather="globe" class="w-4 h-4 mr-1"></i>
|
| 47 |
+
<span id="currentLang">EN</span>
|
| 48 |
+
</a>
|
| 49 |
+
</div>
|
| 50 |
+
<div class="hidden md:flex space-x-8">
|
| 51 |
<a href="index.html" class="hover:text-indigo-400 transition-colors">Home</a>
|
| 52 |
<a href="index.html#features" class="hover:text-indigo-400 transition-colors">Features</a>
|
| 53 |
<a href="index.html#roadmap" class="hover:text-indigo-400 transition-colors">Roadmap</a>
|
|
|
|
| 161 |
</p>
|
| 162 |
</div>
|
| 163 |
</footer>
|
|
|
|
| 164 |
<script>
|
| 165 |
+
// Set initial language
|
| 166 |
+
document.getElementById('currentLang').textContent =
|
| 167 |
+
document.cookie.match('(^|;)\\s*NEXT_LOCALE\\s*=\\s*([^;]+)')?.pop() || 'EN';
|
| 168 |
+
|
| 169 |
feather.replace();
|
| 170 |
+
</script>
|
| 171 |
</body>
|
| 172 |
</html>
|
i18n-setup.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>i18n Setup | QuantumCode</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 10 |
+
<style>
|
| 11 |
+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
|
| 12 |
+
|
| 13 |
+
body {
|
| 14 |
+
font-family: 'Space Grotesk', sans-serif;
|
| 15 |
+
background-color: #0f172a;
|
| 16 |
+
color: #e2e8f0;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.gradient-text {
|
| 20 |
+
background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%);
|
| 21 |
+
-webkit-background-clip: text;
|
| 22 |
+
background-clip: text;
|
| 23 |
+
color: transparent;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.glass-card {
|
| 27 |
+
background: rgba(15, 23, 42, 0.7);
|
| 28 |
+
backdrop-filter: blur(10px);
|
| 29 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 30 |
+
border-radius: 1rem;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.language-option {
|
| 34 |
+
transition: all 0.2s ease;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.language-option:hover {
|
| 38 |
+
transform: scale(1.05);
|
| 39 |
+
background: rgba(124, 58, 237, 0.1);
|
| 40 |
+
}
|
| 41 |
+
</style>
|
| 42 |
+
</head>
|
| 43 |
+
<body class="min-h-screen flex items-center justify-center">
|
| 44 |
+
<div class="container mx-auto px-4 py-12">
|
| 45 |
+
<div class="max-w-md mx-auto glass-card p-8">
|
| 46 |
+
<div class="text-center mb-8">
|
| 47 |
+
<div class="flex justify-center mb-4">
|
| 48 |
+
<i data-feather="globe" class="text-indigo-500 w-12 h-12"></i>
|
| 49 |
+
</div>
|
| 50 |
+
<h1 class="text-3xl font-bold gradient-text mb-2">Select Language</h1>
|
| 51 |
+
<p class="text-slate-300">Choose your preferred language</p>
|
| 52 |
+
</div>
|
| 53 |
+
|
| 54 |
+
<div class="grid grid-cols-2 gap-4 mb-8">
|
| 55 |
+
<div class="language-option flex items-center p-4 rounded-lg cursor-pointer border border-slate-700" data-lang="en">
|
| 56 |
+
<img src="https://flagcdn.com/w20/gb.png" class="w-6 h-4 mr-3">
|
| 57 |
+
<span>English</span>
|
| 58 |
+
</div>
|
| 59 |
+
<div class="language-option flex items-center p-4 rounded-lg cursor-pointer border border-slate-700" data-lang="ru">
|
| 60 |
+
<img src="https://flagcdn.com/w20/ru.png" class="w-6 h-4 mr-3">
|
| 61 |
+
<span>Русский</span>
|
| 62 |
+
</div>
|
| 63 |
+
<div class="language-option flex items-center p-4 rounded-lg cursor-pointer border border-slate-700" data-lang="tj">
|
| 64 |
+
<img src="https://flagcdn.com/w20/tj.png" class="w-6 h-4 mr-3">
|
| 65 |
+
<span>Тоҷикӣ</span>
|
| 66 |
+
</div>
|
| 67 |
+
<div class="language-option flex items-center p-4 rounded-lg cursor-pointer border border-slate-700" data-lang="uz">
|
| 68 |
+
<img src="https://flagcdn.com/w20/uz.png" class="w-6 h-4 mr-3">
|
| 69 |
+
<span>O'zbekcha</span>
|
| 70 |
+
</div>
|
| 71 |
+
<div class="language-option flex items-center p-4 rounded-lg cursor-pointer border border-slate-700" data-lang="kg">
|
| 72 |
+
<img src="https://flagcdn.com/w20/kg.png" class="w-6 h-4 mr-3">
|
| 73 |
+
<span>Кыргызча</span>
|
| 74 |
+
</div>
|
| 75 |
+
<div class="language-option flex items-center p-4 rounded-lg cursor-pointer border border-slate-700" data-lang="ua">
|
| 76 |
+
<img src="https://flagcdn.com/w20/ua.png" class="w-6 h-4 mr-3">
|
| 77 |
+
<span>Українська</span>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
|
| 81 |
+
<div class="text-center">
|
| 82 |
+
<button id="confirmLanguage" class="px-6 py-3 bg-indigo-600 hover:bg-indigo-700 rounded-lg font-medium transition-colors">
|
| 83 |
+
Confirm Selection
|
| 84 |
+
</button>
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
<script>
|
| 90 |
+
document.querySelectorAll('.language-option').forEach(option => {
|
| 91 |
+
option.addEventListener('click', function() {
|
| 92 |
+
document.querySelectorAll('.language-option').forEach(opt => {
|
| 93 |
+
opt.classList.remove('border-indigo-500', 'bg-indigo-900/20');
|
| 94 |
+
});
|
| 95 |
+
this.classList.add('border-indigo-500', 'bg-indigo-900/20');
|
| 96 |
+
});
|
| 97 |
+
});
|
| 98 |
+
|
| 99 |
+
document.getElementById('confirmLanguage').addEventListener('click', function() {
|
| 100 |
+
const selected = document.querySelector('.language-option.border-indigo-500');
|
| 101 |
+
if (selected) {
|
| 102 |
+
const lang = selected.getAttribute('data-lang');
|
| 103 |
+
document.cookie = `NEXT_LOCALE=${lang};path=/;max-age=31536000`;
|
| 104 |
+
window.location.href = window.location.pathname;
|
| 105 |
+
}
|
| 106 |
+
});
|
| 107 |
+
|
| 108 |
+
feather.replace();
|
| 109 |
+
</script>
|
| 110 |
+
</body>
|
| 111 |
+
</html>
|
index.html
CHANGED
|
@@ -40,7 +40,13 @@
|
|
| 40 |
<i data-feather="cpu" class="text-indigo-500"></i>
|
| 41 |
<span class="text-xl font-bold gradient-text">QuantumCode</span>
|
| 42 |
</div>
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
<a href="#" class="hover:text-indigo-400 transition-colors">Features</a>
|
| 45 |
<a href="#" class="hover:text-indigo-400 transition-colors">Roadmap</a>
|
| 46 |
<a href="data-architecture.html" class="hover:text-indigo-400 transition-colors">Data Architecture</a>
|
|
@@ -195,10 +201,13 @@
|
|
| 195 |
</div>
|
| 196 |
</div>
|
| 197 |
</footer>
|
| 198 |
-
|
| 199 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
VANTA.GLOBE({
|
| 201 |
-
|
| 202 |
mouseControls: true,
|
| 203 |
touchControls: true,
|
| 204 |
gyroControls: false,
|
|
|
|
| 40 |
<i data-feather="cpu" class="text-indigo-500"></i>
|
| 41 |
<span class="text-xl font-bold gradient-text">QuantumCode</span>
|
| 42 |
</div>
|
| 43 |
+
<div class="flex items-center space-x-2">
|
| 44 |
+
<a href="i18n-setup.html" class="flex items-center text-sm hover:text-indigo-400 transition-colors">
|
| 45 |
+
<i data-feather="globe" class="w-4 h-4 mr-1"></i>
|
| 46 |
+
<span id="currentLang">EN</span>
|
| 47 |
+
</a>
|
| 48 |
+
</div>
|
| 49 |
+
<div class="hidden md:flex space-x-8">
|
| 50 |
<a href="#" class="hover:text-indigo-400 transition-colors">Features</a>
|
| 51 |
<a href="#" class="hover:text-indigo-400 transition-colors">Roadmap</a>
|
| 52 |
<a href="data-architecture.html" class="hover:text-indigo-400 transition-colors">Data Architecture</a>
|
|
|
|
| 201 |
</div>
|
| 202 |
</div>
|
| 203 |
</footer>
|
|
|
|
| 204 |
<script>
|
| 205 |
+
// Set initial language
|
| 206 |
+
document.getElementById('currentLang').textContent =
|
| 207 |
+
document.cookie.match('(^|;)\\s*NEXT_LOCALE\\s*=\\s*([^;]+)')?.pop() || 'EN';
|
| 208 |
+
|
| 209 |
VANTA.GLOBE({
|
| 210 |
+
el: "#vanta-bg",
|
| 211 |
mouseControls: true,
|
| 212 |
touchControls: true,
|
| 213 |
gyroControls: false,
|
select-role.html
CHANGED
|
@@ -53,10 +53,16 @@
|
|
| 53 |
<div class="container mx-auto px-4 py-12">
|
| 54 |
<div class="max-w-2xl mx-auto glass-card p-8">
|
| 55 |
<div class="text-center mb-8">
|
| 56 |
-
<div class="flex justify-center mb-4">
|
| 57 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
</div>
|
| 59 |
-
|
| 60 |
<p class="text-slate-300">Choose how you'll use QuantumCode</p>
|
| 61 |
</div>
|
| 62 |
|
|
@@ -147,8 +153,11 @@
|
|
| 147 |
window.location.href = 'auth.html';
|
| 148 |
}
|
| 149 |
});
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
feather.replace();
|
| 152 |
-
|
| 153 |
</body>
|
| 154 |
</html>
|
|
|
|
| 53 |
<div class="container mx-auto px-4 py-12">
|
| 54 |
<div class="max-w-2xl mx-auto glass-card p-8">
|
| 55 |
<div class="text-center mb-8">
|
| 56 |
+
<div class="flex justify-between items-center mb-4">
|
| 57 |
+
<div class="flex items-center">
|
| 58 |
+
<i data-feather="user" class="text-indigo-500 w-12 h-12"></i>
|
| 59 |
+
</div>
|
| 60 |
+
<a href="i18n-setup.html" class="flex items-center text-sm hover:text-indigo-400 transition-colors">
|
| 61 |
+
<i data-feather="globe" class="w-4 h-4 mr-1"></i>
|
| 62 |
+
<span id="currentLang">EN</span>
|
| 63 |
+
</a>
|
| 64 |
</div>
|
| 65 |
+
<h1 class="text-3xl font-bold gradient-text mb-2">Select Your Role</h1>
|
| 66 |
<p class="text-slate-300">Choose how you'll use QuantumCode</p>
|
| 67 |
</div>
|
| 68 |
|
|
|
|
| 153 |
window.location.href = 'auth.html';
|
| 154 |
}
|
| 155 |
});
|
| 156 |
+
// Set initial language
|
| 157 |
+
document.getElementById('currentLang').textContent =
|
| 158 |
+
document.cookie.match('(^|;)\\s*NEXT_LOCALE\\s*=\\s*([^;]+)')?.pop() || 'EN';
|
| 159 |
|
| 160 |
feather.replace();
|
| 161 |
+
</script>
|
| 162 |
</body>
|
| 163 |
</html>
|