Eloqua Blog | Landing Pages and Forms

How I use one language pack across Eloqua landing pages

How we took the repeated translation work out of Eloqua forms, kept their submitted values consistent and gave shared interface text one place to live.

First published:

Complexity: Intermediate | Audience: Marketing Ops and Eloqua teams | Focus: Language packs, forms and localisation

Advanced Oracle Eloqua marketing automation workspace.

The time saving starts with the second landing page. You have already translated the form labels, the country choices and the buttons. You should not have to find them all and paste them in again just because another campaign needs a page.

That was the reason I built a shared language pack for a set of multilingual Eloqua landing pages. The repeated work was in the small interface strings scattered around the forms. The JavaScript holds the language variants for shared header, form and footer text. On page load it reads the HTML lang setting and replaces the tagged front-end text, while retaining the approved values Eloqua expects to receive.

The bigger efficiency is having one place to maintain it over time. Add a translation, introduce shared text or change an approved field configuration in the script, and every connected landing page using those elements can pick up the released update. We do not have to make the same edit separately in each language version. The example below shows the approach before I get into the implementation.

For a sense of scale, the worked example below estimates a 45-minute saving on a small shared label change across twelve pages, with every affected page still checked. That is a planning estimate; the assumptions and calculation are set out below.

See for yourself

These are two short, editable examples for a fictional Acme form. The HTML defines the page language, fields and starting values. The JavaScript holds the translations and applies them when the page loads. Click Run now: live trial to generate the form from your current code in both panes.

Try this: in the HTML, change value="Jamie" to value="Alex". In the JavaScript, change the Spanish firstName text from "Nombre" to "Tu nombre". Run the trial: the input should contain Alex and its label should say Tu nombre.

  1. Edit the HTML or JavaScript below. Both panes are live inputs to the preview.
  2. Keep <html lang="es"> for Spanish, change it to en for English, or try es-ES to use the Spanish fallback. This compact example includes English and Spanish.
  3. Run the live trial, change the form’s input values and submit it inside the lightbox. The local payload shows the values produced by your current HTML. For example, Alemania still submits Germany.
  4. Close the preview, make another edit and run again. Your code stays in both panes until you use Reset both examples.
Editable HTML: language, fields and values
Editable JavaScript: matching translations

The generated form opens in a lightbox with the article darkened behind it. Only Close preview dismisses it; clicking outside or pressing Escape leaves it open.

To try a new field, add an input and a labelled span in the HTML, such as <span data-i18n="company">Company</span>. Add a matching JavaScript entry, company: { en: "Company", es: "Empresa" }, inside text, then run again. A named input is included in the local payload; translating its label does not rename the field.

The work we were repeating

The obvious translation work was already being done. Each campaign had its own headline, product copy and approved local content. The repetition was in the interface around it: the same form labels, the same dropdowns, the same contact preferences and the same buttons, copied into another page and checked again.

Then a small change would arrive. A label needed correcting. A placeholder had been missed. The form looked Italian until you moved to step two, where the heading was still in English. Each issue was easy enough to fix. Finding every place that needed the fix was taking the time.

I wanted the next landing page to start with the shared work already done. The approach we settled on was a JavaScript language pack, loaded by the pages that use those common elements. The page tells the script which language to use. The script supplies the interface text. Eloqua still receives the values its processing steps and integrations expect.

This fits an existing HTML and JavaScript setup. There is no requirement to rebuild the pages in a new framework or put a translation service in the visitor’s path. The translations are reviewed strings in a file we control.

What the language pack owns

The shared JavaScript file holds the language variants for the header, form and footer text that it owns. When a page loads, the script reads the HTML lang setting and applies the matching strings to the tagged elements. The front end changes language; the approved backend field names and values remain the same.

The useful boundary is between shared interface text and the content of an individual campaign. I give each a clear owner so a change to a field label does not become an excuse to rewrite a page.

The HTML language setting and known page selectors are read by the shared language pack. It updates visible text while the existing form sends its agreed values to Eloqua.
The language pack changes the display layer. The existing form contract stays in place.
The boundary between translation and form behaviour
Part of the pageWhere it belongsWhat I protect
Shared interfaceThe language pack: shared header text, form labels, placeholders, dropdown labels, navigation buttons, step headings, error messages and footer text.Existing IDs and selectors used by the page.
Campaign contentThe page’s translation and review process: headline, body copy, images, captions and campaign-specific CTAs.Approved wording, formatting and product context.
Data and processingThe existing form, Eloqua processing and integration mappings.Field names, option values, hidden attribution fields and submission behaviour.
Market-specific contentApproved wording and destinations supplied by the relevant owner.Privacy links, consent wording, distributor destinations and country rules.

Our pack also applies the approved country-specific privacy wording and the matching language and country destinations for header, privacy and footer links. The wording and URLs are supplied through the market approval process, then mapped explicitly in the script.

What happens on page load

There are three parts to wire together: the HTML language setting, tagged elements in the page and the shared JavaScript file. The language variants are already stored in the script. It does not translate the page by calling a service at runtime.

<!doctype html>
<html lang="es">
<head>
  <meta charset="utf-8">
  <script src="/js/acme-language-pack.js" defer></script>
</head>
<body>
  <header>
    <span id="header-message">Practical tools for busy teams.</span>
  </header>

  <form>
    <label for="firstName">
      <span id="first-name-label">First name</span>
    </label>
    <input id="firstName" name="firstName">

    <label for="country">Country</label>
    <select id="country" name="country">
      <option value="Germany">Germany</option>
    </select>
  </form>

  <footer>
    <span id="rights-label">All rights reserved.</span>
  </footer>
</body>
</html>

The span tags do not activate themselves. They mark the pieces of visible text the JavaScript is allowed to replace. Their IDs, or an agreed data attribute, let the script find the right element without changing the surrounding layout or the form field’s name.

  1. The browser builds the page, including its header, form and footer.
  2. The shared script runs after the DOM is ready and reads document.documentElement.lang. In this example, that is es.
  3. The pack resolves the language key and selects the stored Spanish variants for its tagged elements.
  4. It changes visible text and approved display attributes, such as a placeholder or a link destination.
  5. The form keeps the approved backend values, so selecting a translated country label still submits the agreed country value to Eloqua.

If I change the declaration to <html lang="fr"> and reload the same prepared page, the shared header, form and footer text uses the French entries instead. The JavaScript file and its dictionaries stay the same. The setting is read on page load; changing the attribute later would need an explicit re-render if live switching were required.

Resolving the language and its fallback

The page starts with a language declaration. For an Italian page, that is simply:

<html lang="it">

Our pack reads document.documentElement.lang, normalises the key and looks up the matching entry. The production work also had some older keys to support. The resolver was the right place to handle those aliases, rather than adding another exception to each page.

function resolveLang() {
  const raw = (document.documentElement.lang || 'en')
    .trim().toLowerCase().replace(/-/g, '_');

  const aliases = {
    sv: 'se', sv_se: 'se',
    da: 'dk', da_dk: 'dk'
  };

  return aliases[raw] || raw;
}

const LANG = resolveLang();

function t(map) {
  return map[LANG] || map[LANG.split('_')[0]] || map.en || '';
}

That lookup gives us an exact regional entry first, then the base language, then English. For example, a fr-BE page can use a Belgian French entry where one exists and the French entry for the rest of the interface. We do not have to duplicate a complete dictionary to change one phrase.

The legacy se and dk keys in this example are internal compatibility aliases. New HTML should use the standard language tags, such as sv and da. If I were starting a fresh pack, I would use standard tags in the dictionary too.

An English fallback keeps an incomplete map usable, but it can also conceal a missing translation. I treat a fallback as something to check before release, not proof that the page is finished. The compact Acme demo includes English and Spanish. An es-ES page falls back to its Spanish entries, using the same lookup order.

Labels and placeholders use the same wording

We already had a dictionary for field labels. When placeholders needed translating, adding a second dictionary would have given us two copies of the same wording to maintain. We reused the existing keys.

<label for="firstName">
  <span id="first-name-label">First name</span>
</label>
<input
  id="firstName"
  name="firstName"
  data-placeholder-id="first-name-label"
>

The markup supplies a stable hook for the shared text. The field ID and HTML name continue to belong to the form. A small rendering function can apply the same translation to both the label and the placeholder:

const fieldLabels = {
  'first-name-label': {
    en: 'First name',
    fr: 'Prénom',
    de: 'Vorname',
    it: 'Nome'
  }
};

function initFieldLabels() {
  Object.entries(fieldLabels).forEach(([id, map]) => {
    const label = document.getElementById(id);
    if (label) label.textContent = t(map);
  });

  document.querySelectorAll('[data-placeholder-id]').forEach(field => {
    const map = fieldLabels[field.dataset.placeholderId];
    if (map) field.placeholder = t(map);
  });
}

This is a trimmed example of the pattern, not a replacement for a complete production pack. In an existing implementation, I limit placeholder changes to the fields agreed in scope and check that the selectors match the actual page. I do not want a general text-replacement script guessing which parts it should touch.

A translated dropdown still has to submit the right value

This is the part I check before I call a localised form ready. A dropdown has a visible label and a submitted value. A visitor needs the label in their language. Eloqua needs the value agreed in the field mapping.

<option value="Germany">Deutschland</option>

The German visitor sees “Deutschland”. The form submits Germany. If an existing segment, CRM mapping or routing rule expects that English value, replacing it with the translated label changes the data contract.

The same country choice in three page languages
Page languageWhat the visitor seesWhat the form submits
EnglishGermanyGermany
GermanDeutschlandGermany
FrenchAllemagneGermany

We worked on keeping that distinction intact for countries and communication languages. It also applies to job roles and contact methods. Translating an option’s textContent does not require changing its value.

const countryLabels = {
  Germany: { en: 'Germany', de: 'Deutschland', fr: 'Allemagne' }
};

document.querySelectorAll('select[name="country"] option')
  .forEach(option => {
    const map = countryLabels[option.value];
    if (map) option.textContent = t(map);
  });

Some older modules identified an option by its existing English display text. That can work with known markup, but a text edit can break the match. For new modules, I prefer a stable value or an explicit translation key. The Acme example uses the option value for its lookup.

You can check this in the preview. Select a country and submit the sample form with made-up details. The local payload display shows the English country value, even when the dropdown label is translated. It creates no Eloqua contact and sends nothing to a CRM.

The form looked translated until somebody used it

One issue in the real work was particularly easy to miss. The language pack contained the translated error message, but a form function wrote a hardcoded English message when validation ran. On the initial screen, everything looked fine. The problem only appeared after an invalid submission.

The same can happen with step headings. Translating the first heading in the HTML is not enough if the stepper writes “Step 2 of 3” from its own English string when the visitor clicks Continue.

Our pack exposed translated step hints for the stepper to use. The important part is that the code rendering each new state actually reads those hints:

// Supplied by the language pack.
window.demoStepHints = {
  1: t({
    en: 'Step 1 of 3: Your details',
    it: 'Fase 1 di 3: I tuoi dati'
  }),
  2: t({
    en: 'Step 2 of 3: Your address',
    it: 'Fase 2 di 3: Il tuo indirizzo'
  })
};

// Consumed by the existing stepper whenever the step changes.
function updateStepHeading(stepNumber) {
  const heading = document.getElementById('stepHint');
  const text = window.demoStepHints?.[stepNumber];
  if (heading && text) heading.textContent = text;
}

For errors, the validation rule should continue to decide whether a field is valid. The language layer supplies the appropriate message. Moving a string into a dictionary should not change which fields are required, how an email address is checked or when a form is allowed to submit.

That is why my review includes going forwards and backwards through the form, submitting it empty, entering an invalid email address and correcting the error. Looking at the starting page tells you very little about the later states.

Page language, country and communication language are separate

A French page does not tell you that the visitor lives in France. A country selection does not always tell you which language they want future emails in. Treating those as one setting is a quick way to make a multilingual form confusing.

Three settings with different jobs
SettingWhat it controlsExample
Page languageThe text shown on this visit.<html lang="fr-BE">
CountryLocation data and any agreed country-dependent fields.A visitor chooses Switzerland.
Communication languageA stated preference for future contact.The visitor chooses French from the approved choices.

We worked through language-name labels and their capitalisation while preserving the English values used by Eloqua. We also checked the country-dependent visibility and choices for the communication-language field.

There needs to be one clear owner for that behaviour. Two country-change handlers, both changing the same field, can give different results depending on which runs last. The language pack should supply the display text without quietly creating a competing set of country rules.

The pack also holds the approved privacy wording for each country and language combination. This is the wording approved for that market, not simply a direct translation of a single English notice. The page’s configured language and country context selects the appropriate entry from the pack.

We applied the same approach to the links around the page. Header links, privacy links and footer links point to the specific pages they are meant to open within the main website’s matching language and country section. A Spanish page for Spain uses its approved Spanish and Spain-specific destinations. A French page for Belgium uses the approved Belgian French destinations.

Approved market content includes both the wording and the destination
Page elementWhat the language pack applies
Privacy text beside the formThe approved notice for the page’s country and language, including the appropriate linked text.
Header and navigation linksThe intended corporate homepage or other destination in the correct language and country section of the main website.
Privacy-policy linkThe exact approved privacy-page URL for that market and language.
Footer linksThe intended legal, privacy, contact or other corporate pages for the relevant language and country.

The approved text and destination URLs are explicit entries in the configuration. We do not guess a legal destination by changing a country code in a URL. On page load, the script reads the HTML language setting, uses the configured market mapping, updates the tagged text and sets the relevant links’ href attributes. The form’s approved backend values stay intact.

The page’s market configuration is separate from the visitor’s country answer in the form. Any behaviour that changes wording or links after a visitor selects a country needs to be deliberately defined. For release, I open the mapped destinations and check that they show the intended page in the correct language and country context. A link returning a successful response is only part of that check.

A shared file needs a proper release process

The benefit of a shared script is also its main operational risk: one edit can affect every page that loads it. I keep a known working copy, make changes in a controlled version and test representative forms before replacing the live file.

The pack waits until the DOM is ready, and its modules check whether their elements exist. A page without a particular dropdown should not fail because another form uses it. We also isolated initialisation so a failure in one module would not stop the rest of the pack.

function safeRun(fn) {
  try {
    fn();
  } catch (error) {
    console.warn('[LanguagePack] ' + fn.name + ' failed:', error);
  }
}

function init() {
  safeRun(initFieldLabels);
  // Add the other agreed modules here.
}

if (document.readyState === 'loading') {
  document.addEventListener('DOMContentLoaded', init);
} else {
  init();
}

Catching an error does not make it acceptable. I still check the console and fix the failed module. The isolation just stops one missing or broken element from taking the rest of the interface text with it.

For release, I want to know exactly which script each page is loading and how to restore the previous version. A filename or URL versioning approach, together with a cache check, makes that much easier to manage than overwriting a shared file and hoping every browser picks it up.

The checks I would run before a shared pack goes live
CheckWhat I expect to see
Exact and regional languagesThe correct regional text where supplied; base-language fallback where it is not.
Missing translationsKnown gaps reported for review. No unexplained English strings or blank labels.
Form steps and errorsCorrect headings, buttons and messages after interaction, including Back and Continue.
Country-dependent fieldsThe agreed country/region and communication-language behaviour still works.
Approved market text and linksThe privacy wording matches the approved country/language version. Header, privacy and footer links open their intended pages on the main website in that same market context.
Submitted payloadOriginal field names, values and hidden attribution fields preserved in a test submission.
Mobile layoutLonger labels, buttons, error messages and dropdowns remain readable and usable.
Shared-page regressionA short form and a longer form both work, including pages missing optional modules.
Release and rollbackThe intended script version loads after cache checks; the previous version can be restored.

Where the time saving actually comes from

The initial pack is extra work. You have to identify the shared elements, collect the translations, wire up the selectors and test the result. I would not sell it as a shortcut for a single page that will never be used again.

The return comes when the same interface is used again. The next campaign can inherit the reviewed labels and dropdown text. A correction has one place to go. A new language can be added against a known set of keys instead of rediscovered in a collection of copied pages.

One script to maintain as the landing pages evolve

The work does not stop when a campaign launches. New fields are requested, wording gets revised, dropdown choices change and another market needs its own version. With a shared script, those common definitions have one place to live.

Every connected landing page references that same script. When we add shared text, extend the translations for a field or update a centrally managed option list, we make the change once, test it and release the shared file. The connected pages using those elements pick it up on their next load once the new version is being served. The header, form, privacy text and footer do not each need a separate edit in every language page.

For a new field, we can maintain its labels, placeholders, dropdown choices and validation messages centrally. The field’s HTML still needs to exist in the shared form template or the relevant pages, with the agreed Eloqua field mapping. Once that is in place, its common configuration can be maintained through the pack.

The same principle applies when approved field values need to change over time. The shared definition is updated deliberately, checked against the Eloqua and CRM mappings and then released to the pages that use it. Ordinary localisation continues to preserve backend values; an approved mapping change is handled as a controlled update.

That is the lasting saving for me: one maintained script, a clear set of approved definitions and fewer copies of the same configuration drifting apart. It becomes easier to support the whole collection of landing pages as the requirements grow.

What changes for the next campaign
TaskWith separate page editsWith a shared pack
Reuse an existing formFind and replace its interface strings again.Load the shared pack and verify the page’s language and selectors.
Correct a common labelLocate the label in each connected variant.Change the owned dictionary entry, then regression-test the affected pages.
Add a languageFind the complete set of interface strings across the page.Translate the known keys and review the remaining page-specific content.
Introduce a new shared fieldAdd and translate its interface text separately in every page variant.Add the field to the shared form or relevant pages, then maintain its labels, choices and messages once in the pack.
Update approved field valuesFind every copy of the option list or mapping and keep them aligned.Update the shared definition, verify the backend mappings and release it across connected pages.
Revise shared text or a market linkRepeat the edit across the affected landing-page variants.Update the approved text or URL entry in one place and check the affected markets.
Investigate English text in a local formSearch page markup and scripts for the source.Check the dictionary, selector and function that writes that state.

What that could save on twelve landing pages

To put some realistic numbers around it, take twelve separately maintained landing pages: two campaigns in each of six languages. Assume the pages already load the shared pack, their selectors are in place and the translations, privacy wording and destination URLs have been approved. These are illustrative planning estimates, not timings measured on the client work.

The comparison includes hands-on editing, testing every affected page and a 15-minute release allowance for each change batch. Translation writing, approval waiting time and the original language-pack build are outside the figures on both sides. A new field is assumed to be approved and already configured in Eloqua.

Estimated effort per change batch across twelve pages, including QA and release
ChangeSeparate page editsShared scriptEstimated time saved
Correct one shared label in the existing languages2 h 15 min1 h 30 min45 min
Update approved privacy wording and its market links3 h 15 min2 h1 h 15 min
Add one simple field with translated labels and choices6 h 15 min4 h 45 min1 h 30 min

For the small label correction, the separate-page estimate is five minutes editing and five minutes checking each page, plus the release: 12 × 10 minutes + 15 minutes = 2 hours 15 minutes. With the pack, allow 15 minutes for the central edit, the same 60 minutes of page checks and 15 minutes to release: 1 hour 30 minutes. That saves roughly 45 minutes on one small change without reducing the testing.

The privacy-and-links example allows ten minutes of editing per page, or 45 minutes to update the six approved market entries centrally. Both approaches retain five minutes of checking per page. For the new field, both include two hours for adding the input markup across the twelve pages, ten minutes of QA per page and the release allowance. The saving comes from maintaining the labels and choices once: 30 minutes centrally instead of ten minutes of repeated configuration per page.

Across those three example change batches, the total moves from 11 h 45 min to 8 h 15 min. That is about 3 h 30 min saved, or roughly 30% less hands-on effort in this particular workload. It is a useful planning example for recurring maintenance, not a claim that every task becomes 30% faster.

The initial build still has to earn its time back. If the pages use different form structures, the translations need reapproval or a value change affects CRM routing, the estimate needs to include that extra work. The repeatable saving is the page-by-page editing that a shared definition removes.

If your team has reached the point where a small wording correction means opening a long list of landing pages, a shared language pack is worth considering. Start with one common form and a few languages. Be precise about what the pack owns, preserve the Eloqua field mappings and test the form after somebody has actually used it.

Talk to me about your Eloqua landing pages, or read the other Eloqua development articles.

Acme form live trial

Your current HTML and JavaScript in action. Only Close preview dismisses this lightbox.

Loading your preview…