Use site language for emails
This commit is contained in:
@@ -907,11 +907,17 @@ function setLang(lang) {
|
||||
// (risk banner, recs, budget, timeline) so they pick up the new language
|
||||
// without a reload.
|
||||
if (document.body.classList.contains('results-active')) rerenderResults()
|
||||
syncPreferredLanguageField()
|
||||
saveState()
|
||||
}
|
||||
|
||||
function t(key) { return T[currentLang][key] || T['en'][key] || key }
|
||||
|
||||
function syncPreferredLanguageField() {
|
||||
const field = document.getElementById('f_pref_lang')
|
||||
if (field) field.value = currentLang
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════
|
||||
// QUESTIONS
|
||||
// ══════════════════════════════════════
|
||||
@@ -1691,7 +1697,7 @@ function submitCapture(e) {
|
||||
const city = g('f_city')
|
||||
const country = g('f_country')
|
||||
const phone = g('f_phone')
|
||||
const prefLang = g('f_pref_lang') || currentLang
|
||||
const prefLang = currentLang
|
||||
const protein = g('f_protein_detail')
|
||||
const newsletter = gc('f_newsletter') ? 'yes' : 'no'
|
||||
|
||||
@@ -2121,6 +2127,7 @@ let savedScrollY = 0
|
||||
function openCaptureModal() {
|
||||
const modal = document.getElementById('capture-modal')
|
||||
if (!modal) return
|
||||
syncPreferredLanguageField()
|
||||
savedScrollY = window.scrollY || window.pageYOffset || 0
|
||||
modal.classList.add('open')
|
||||
modal.setAttribute('aria-hidden', 'false')
|
||||
|
||||
Reference in New Issue
Block a user