feat: implement bilingual English/Spanish toggle with lossless i18n translation engine across all pages

This commit is contained in:
2026-09-11 21:07:34 -07:00
parent 8cd0fbce52
commit 7b483b8020
17 changed files with 877 additions and 45 deletions
+13
View File
@@ -246,10 +246,23 @@ document.addEventListener('DOMContentLoaded', () => {
if (selectedSize === 'acreage' && !timeText.includes('Days')) {
timeText = '1 - 2 Days (Full Crew)';
}
if (document.documentElement.lang === 'es') {
timeText = timeText.replace(/Same Day/gi, 'Mismo Día')
.replace(/Same-Day/gi, 'Mismo Día')
.replace(/Hours/gi, 'Horas')
.replace(/Days/gi, 'Días')
.replace(/Routine/gi, 'Rutina')
.replace(/\(Full Crew\)/gi, '(Equipo Completo)');
}
timeDisplay.textContent = timeText;
}
}
// Listen for language changes to update localized calculator output
window.addEventListener('languageChanged', () => {
updateEstimate();
});
// Listen to all calculator radio buttons
const calcInputs = document.querySelectorAll('input[name="calc-service"], input[name="calc-size"], input[name="calc-condition"]');
calcInputs.forEach(input => {