-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18n.js
More file actions
225 lines (219 loc) · 9.27 KB
/
Copy pathi18n.js
File metadata and controls
225 lines (219 loc) · 9.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
const translations = {
en: {
// Navbar
navHome: "Home",
navProjects: "Projects",
navSkills: "Skills",
navCertificates: "Certificates",
themeToggle: "Toggle theme",
// Hero
heroGreeting: "Hey, I'm",
heroTitle: "Pentester & Fullstack Web Developer",
heroDesc: "I build secure and user-friendly applications. Passionate about cybersecurity and web development.",
// GitHub Stats
githubStats: "GitHub Stats",
repos: "Repos",
stars: "Stars",
followers: "Followers",
// About
aboutTitle: "About Me",
aboutText: "I'm a passionate developer specializing in cybersecurity and web development. I love building secure, user-friendly applications and exploring new technologies.",
// Code Stack
codeStack: "Code Stack",
other: "Other",
noData: "No data",
// Projects
projectsTitle: "Projects",
noProjects: "No projects added yet",
viewOnGithub: "View on GitHub",
projectDesc: {
dclocate: "A multi-criteria decision support system for identifying optimal data center locations",
yfinance: "Command-line tool that fetches real-time market data, trains an LSTM model on historical prices, and produces a forecast chart",
portscanner: "A fast and lightweight TCP port scanner built with Node.js. No external dependencies required."
},
// Skills
skillsTitle: "Skills",
securityTools: "🛡️ Security Tools",
webDev: "🌐 Web Development",
progLangs: "💻 Programming Languages",
tools: "🔧 Tools",
// Education
educationTitle: "Education",
university: "Western Caspian University",
degree: "Bachelor of Computer Science",
field: "Computer Science",
// Certificates
certificatesTitle: "Certificates",
coursesTitle: "Courses",
course1Name: "Millisec Academy — Red Team",
course2Name: "Peerstack Academy — Fullstack Web Development",
certAlt: {
arc1: "Arc Certificate 1",
arc2: "Arc Certificate 2",
fullstack: "Fullstack Certificate",
googleCloud: "Google Cloud Certificate",
ibmCyber: "IBM Cybersecurity Certificate",
ibmIR: "IBM Incident Response Certificate",
codio: "Codio Certificate"
},
enlargeHint: "click to enlarge",
imageLoadError: "Image failed to load",
// Lightbox
lightboxLabel: "Certificate viewer",
closeLabel: "Close",
// Footer
githubProfile: "GitHub Profile"
},
ru: {
navHome: "Главная",
navProjects: "Проекты",
navSkills: "Навыки",
navCertificates: "Сертификаты",
themeToggle: "Переключить тему",
heroGreeting: "Привет, я",
heroTitle: "Пентестер и Fullstack Веб-Разработчик",
heroDesc: "Я создаю безопасные и удобные приложения. Увлечён кибербезопасностью и веб-разработкой.",
githubStats: "GitHub Статистика",
repos: "Репозитории",
stars: "Звёзды",
followers: "Подписчики",
aboutTitle: "Обо мне",
aboutText: "Я увлечённый разработчик, специализирующийся на кибербезопасности и веб-разработке. Люблю создавать безопасные, удобные приложения и изучать новые технологии.",
codeStack: "Стек кода",
other: "Другое",
noData: "Нет данных",
projectsTitle: "Проекты",
noProjects: "Проекты ещё не добавлены",
viewOnGithub: "Смотреть на GitHub",
projectDesc: {
dclocate: "Многокритериальная система поддержки принятия решений для определения оптимальных локаций дата-центров",
yfinance: "Инструмент командной строки для получения рыночных данных, обучения LSTM-модели и построения прогнозных графиков",
portscanner: "Быстрый и лёгкий TCP сканер портов на Node.js. Без внешних зависимостей."
},
skillsTitle: "Навыки",
securityTools: "🛡️ Инструменты безопасности",
webDev: "🌐 Веб-разработка",
progLangs: "💻 Языки программирования",
tools: "🔧 Инструменты",
educationTitle: "Образование",
university: "Western Caspian University",
degree: "Бакалавр компьютерных наук",
field: "Компьютерные науки",
certificatesTitle: "Сертификаты",
coursesTitle: "Курсы",
course1Name: "Millisec Academy — Red Team",
course2Name: "Peerstack Academy — Fullstack Веб-Разработка",
certAlt: {
arc1: "Сертификат Arc 1",
arc2: "Сертификат Arc 2",
fullstack: "Сертификат Fullstack",
googleCloud: "Сертификат Google Cloud",
ibmCyber: "Сертификат IBM Кибербезопасность",
ibmIR: "Сертификат IBM Реагирование на инциденты",
codio: "Сертификат Codio"
},
enlargeHint: "нажмите для увеличения",
imageLoadError: "Не удалось загрузить изображение",
lightboxLabel: "Просмотр сертификата",
closeLabel: "Закрыть",
githubProfile: "Профиль GitHub"
},
az: {
navHome: "Ana Səhifə",
navProjects: "Layihələr",
navSkills: "Bacarıqlar",
navCertificates: "Sertifikatlar",
themeToggle: "Temanı dəyiş",
heroGreeting: "Salam, mən",
heroTitle: "Pentester və Fullstack Veb Developer",
heroDesc: "Təhlükəsiz və istifadəçi dostu tətbiqlər yaradıram. Kibertəhlükəsizlik və veb inkişaf sahəsində çalışıram.",
githubStats: "GitHub Statistika",
repos: "Repolar",
stars: "Ulduzlar",
followers: "İzləyicilər",
aboutTitle: "Haqqımda",
aboutText: "Kibertəhlükəsizlik və veb inkişaf sahəsində ixtisaslaşmış həvəsli bir tərtibatçıyam. Təhlükəsiz, istifadəçi dostu tətbiqlər yaratmağı və yeni texnologiyaları öyrənməyi sevirəm.",
codeStack: "Kod Yığını",
other: "Digər",
noData: "Məlumat yoxdur",
projectsTitle: "Layihələr",
noProjects: "Hələ layihə əlavə edilməyib",
viewOnGithub: "GitHub-da bax",
projectDesc: {
dclocate: "Data mərkəzləri üçün optimal yerləri müəyyən edən çoxmeyarlı qərar dəstək sistemi",
yfinance: "Real vaxt bazar məlumatlarını alan, LSTM modeli öyrədən və proqnoz qrafiki yaradan komanda xətti aləti",
portscanner: "Node.js ilə qurulmuş sürətli və yüngül TCP port skaneri. Xarici asılılıq tələb etmir."
},
skillsTitle: "Bacarıqlar",
securityTools: "🛡️ Təhlükəsizlik Alətləri",
webDev: "🌐 Veb İnkişaf",
progLangs: "💻 Proqramlaşdırma Dilləri",
tools: "🔧 Alətlər",
educationTitle: "Təhsil",
university: "Western Caspian University",
degree: "Kompüter Elmləri Bakalavr",
field: "Kompüter Elmləri",
certificatesTitle: "Sertifikatlar",
coursesTitle: "Kurslar",
course1Name: "Millisec Academy — Red Team",
course2Name: "Peerstack Academy — Fullstack Veb İnkişaf",
certAlt: {
arc1: "Arc Sertifikat 1",
arc2: "Arc Sertifikat 2",
fullstack: "Fullstack Sertifikat",
googleCloud: "Google Cloud Sertifikat",
ibmCyber: "IBM Kibertəhlükəsizlik Sertifikat",
ibmIR: "IBM İnsident Cavab Sertifikat",
codio: "Codio Sertifikat"
},
enlargeHint: "böyütmək üçün klikləyin",
imageLoadError: "Şəkil yüklənə bilmədi",
lightboxLabel: "Sertifikat görüntüləyici",
closeLabel: "Bağla",
githubProfile: "GitHub Profil"
}
};
let currentLang = 'en';
function t(key) {
const keys = key.split('.');
let val = translations[currentLang];
for (const k of keys) {
if (val && typeof val === 'object') val = val[k];
else return key;
}
return val || key;
}
function setLanguage(lang) {
if (!translations[lang]) return;
currentLang = lang;
document.documentElement.setAttribute('lang', lang);
try { localStorage.setItem('lang', lang); } catch (e) {}
updatePageLanguage();
}
function initLanguage() {
try {
const saved = localStorage.getItem('lang');
if (saved && translations[saved]) { currentLang = saved; }
} catch (e) {}
document.documentElement.setAttribute('lang', currentLang);
}
function updatePageLanguage() {
// Nav links
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
el.textContent = t(key);
});
// Aria labels
document.querySelectorAll('[data-i18n-aria]').forEach(el => {
const key = el.getAttribute('data-i18n-aria');
el.setAttribute('aria-label', t(key));
});
// Re-render dynamic content
renderProjects();
renderCertificates();
renderCodeStack();
// Update language selector active state
document.querySelectorAll('.lang-btn').forEach(btn => {
btn.classList.toggle('active', btn.dataset.lang === currentLang);
});
}