-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18n.js
More file actions
191 lines (166 loc) · 8.83 KB
/
Copy pathi18n.js
File metadata and controls
191 lines (166 loc) · 8.83 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
// i18n System - Comprehensive Bilingual Support (ES/EN)
const translations = {
es: {
// Navigation & General UI
'nav.resources': 'Recursos',
'nav.jobs': 'Jobs & Career',
'nav.studios': 'Studios DB',
'nav.community': 'Comunidad',
'nav.cta': '🎮 Únete a EGDC',
'ui.back_to_hub': '← Regresar al Hub',
'ui.loading': 'Cargando...',
// Hero Sections
'hero.badge.free': '🆓 Recursos 100% gratuitos para LATAM',
'hero.badge.career': '💼 Career Boost Activo',
'hero.badge.tools': '🛠️ Production Ready',
'hero.badge.studios': '🌎 LATAM Power',
'hero.badge.marketing': '📢 Visibility Hack',
'hero.title.home': 'Level up tu carrera en <span class="text-neon-pink">Game Development</span>',
'hero.subtitle.home': 'Templates, guías, ofertas de trabajo y herramientas creadas por profesionales de la industria. <strong>¡Consigue chamba</strong> y funda tu estudio rentable!',
'hero.cta.explore': '🕹️ Explorar Recursos',
'hero.cta.jobs': '💼 Ver Ofertas Diarias',
'hero.title.jobs': 'LEVEL UP YOUR CAREER',
'hero.subtitle.jobs': 'Tu guía definitiva para trabajar en la industria de videojuegos en LATAM. Tips de nivel senior para entrar a estudios AA/AAA.',
'hero.title.tools': 'PRODUCTION TOOLS',
'hero.subtitle.tools': 'Templates probados en estudios AA/AAA. No reinventes la rueda, usa lo que ya funciona profesionalmente.',
'hero.title.database': 'LATAM STUDIOS DB',
'hero.subtitle.database': 'El mapa más completo de la industria en Latinoamérica. Encuentra estudios, tecnología y vacantes.',
'hero.title.marketing': 'MARKETING PLAYBOOK',
'hero.subtitle.marketing': 'Tu juego no se vende solo. Aprende a crear comunidades, llamar la atención de publishers y dominar Steam.',
// Sections
'section.guides.title': 'Guías de Carrera',
'section.guides.desc': 'Inspirado en los recursos de Amir Satvat, adaptados a nuestra realidad en LATAM.',
'section.jobs_where.title': 'DÓNDE BUSCAR CHAMBA',
'section.jobs_where.desc': 'Los mejores lugares para encontrar vacantes reales y filtradas.',
'section.tools.title': 'GDD & Blueprinting',
'section.tools.badge': '📋 Standard Docs',
'section.studios.title': 'Directorio de Estudios',
'section.marketing.title': 'Estrategias de Lanzamiento',
// Cards & Features
'card.cv.title': 'El CV Perfecto',
'card.cv.desc': 'Plantillas y consejos para que tu currículum destaque ante reclutadores.',
'card.portfolio.title': 'Portafolio que Vende',
'card.portfolio.desc': 'Cómo presentar tu trabajo para Arte, Programación o Diseño.',
'card.interview.title': 'Interview Prep',
'card.interview.desc': 'Preguntas comunes y cómo negociar tu salario sin morir en el intento.',
'card.read_guide': 'Leer Guía',
'card.coming_soon': 'Próximamente',
'card.download': 'Descargar',
// Footer
'footer.tagline': 'Recursos premium para game devs en LATAM. Profesionales, gratuitos y con onda gamer.',
'footer.resources': '🎒 Recursos',
'footer.ecosystem': '🌐 Ecosistema',
'footer.connect': '🔗 Conecta',
'footer.copyright': '© 2026 Game Industry Resources. Hecho con 💙 por',
'footer.tagline.small': '"It\'s dangerous to go alone! Take this." 🗡️',
// Registration Modal
'modal.title': '👾 CREAR CUENTA',
'modal.subtitle': '¡Únete a la elite de LATAM y guarda tu progreso de XP!',
'modal.label.name': 'Nombre',
'modal.label.lastname': 'Apellido',
'modal.label.phone': 'WhatsApp / Teléfono',
'modal.btn': '🚀 UNIRME AL NEXUS',
'modal.footer': 'Al unirte, aceptas que te contactemos con recursos épicos.'
},
en: {
// Navigation & General UI
'nav.resources': 'Resources',
'nav.jobs': 'Jobs & Career',
'nav.studios': 'Studios DB',
'nav.community': 'Community',
'nav.cta': '🎮 Join EGDC',
'ui.back_to_hub': '← Back to Hub',
'ui.loading': 'Loading...',
// Hero Sections
'hero.badge.free': '🆓 100% Free Resources for LATAM',
'hero.badge.career': '💼 Career Boost Active',
'hero.badge.tools': '🛠️ Production Ready',
'hero.badge.studios': '🌎 LATAM Power',
'hero.badge.marketing': '📢 Visibility Hack',
'hero.title.home': 'Level up your career in <span class="text-neon-pink">Game Development</span>',
'hero.subtitle.home': 'Templates, guides, job offers and tools created by industry professionals. <strong>Get hired</strong> and build your studio!',
'hero.cta.explore': '🕹️ Explore Resources',
'hero.cta.jobs': '💼 See Daily Offers',
'hero.title.jobs': 'LEVEL UP YOUR CAREER',
'hero.subtitle.jobs': 'Your ultimate guide to working in the LATAM game industry. Senior-level tips to enter AA/AAA studios.',
'hero.title.tools': 'PRODUCTION TOOLS',
'hero.subtitle.tools': 'Tested templates from AA/AAA studios. Don\'t reinvent the wheel, use what works professionally.',
'hero.title.database': 'LATAM STUDIOS DB',
'hero.subtitle.database': 'The most complete map of the industry in Latin America. Find studios, tech, and job openings.',
'hero.title.marketing': 'MARKETING PLAYBOOK',
'hero.subtitle.marketing': 'Your game won\'t sell itself. Learn to build communities, get publishers\' attention, and master Steam.',
// Sections
'section.guides.title': 'Career Guides',
'section.guides.desc': 'Inspired by Amir Satvat\'s world-class resources, adapted to our LATAM reality.',
'section.jobs_where.title': 'WHERE TO FIND JOBS',
'section.jobs_where.desc': 'The best places to find real, filtered job openings.',
'section.tools.title': 'GDD & Blueprinting',
'section.tools.badge': '📋 Standard Docs',
'section.studios.title': 'Studio Directory',
'section.marketing.title': 'Launch Strategies',
// Cards & Features
'card.cv.title': 'The Perfect CV',
'card.cv.desc': 'Templates and tips to make your resume stand out to recruiters.',
'card.portfolio.title': 'Selling Portfolio',
'card.portfolio.desc': 'How to present your work for Art, Programming, or Design.',
'card.interview.title': 'Interview Prep',
'card.interview.desc': 'Common questions and how to negotiate your salary like a pro.',
'card.read_guide': 'Read Guide',
'card.coming_soon': 'Coming Soon',
'card.download': 'Download',
// Footer
'footer.tagline': 'Premium resources for game devs in LATAM. Professional, free, and with gamer vibes.',
'footer.resources': '🎒 Resources',
'footer.ecosystem': '🌐 Ecosystem',
'footer.connect': '🔗 Connect',
'footer.copyright': '© 2026 Game Industry Resources. Made with 💙 by',
'footer.tagline.small': '"It\'s dangerous to go alone! Take this." 🗡️',
// Registration Modal
'modal.title': '👾 CREATE ACCOUNT',
'modal.subtitle': 'Join the LATAM elite and save your XP progress!',
'modal.label.name': 'First Name',
'modal.label.lastname': 'Last Name',
'modal.label.phone': 'WhatsApp / Phone',
'modal.btn': '🚀 JOIN THE NEXUS',
'modal.footer': 'By joining, you agree to receive epic resources and updates.'
}
};
// Current language
let currentLang = localStorage.getItem('gamedev_lang') || 'es';
// Get translation
function t(key) {
return translations[currentLang][key] || key;
}
// Switch language
function switchLanguage(lang) {
currentLang = lang;
localStorage.setItem('gamedev_lang', lang);
// Update UI elements with data-i18n attribute
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
if (el.tagName === 'INPUT' || el.tagName === 'TEXTAREA') {
el.placeholder = t(key);
} else {
el.innerHTML = t(key);
}
});
// Update active state of buttons
document.querySelectorAll('.lang-btn').forEach(btn => {
btn.classList.toggle('active', btn.getAttribute('data-lang') === lang);
});
// Update gamification context if available
if (typeof gameState !== 'undefined') {
gameState.lang = lang;
if (typeof saveState === 'function') saveState();
}
}
// Initialize on page load
document.addEventListener('DOMContentLoaded', () => {
switchLanguage(currentLang);
document.querySelectorAll('.lang-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
e.preventDefault();
switchLanguage(btn.getAttribute('data-lang'));
});
});
});