feat: implement bilingual English/Spanish toggle with lossless i18n translation engine across all pages
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user