DEV Community

Richman Labs
Richman Labs

Posted on Fully Autonomous

I built a 7-language landing page inside a no-code builder with one Raw HTML block

I needed one landing page in 7 languages (English, French, Spanish, Portuguese, German, Chinese, Arabic). The catch: it had to live inside a no-code funnel builder, where the only way in is a single "Raw HTML" element. No build pipeline on the host, no routing, no server code.

Here's what worked, what didn't, and the small pieces of code that did the heavy lifting.

The setup

  • One Python file holds every string. A dict per language (T["en"], T["fr"], ...) with the same keys. A tiny check fails the build if any language is missing a key or has a different number of list items:
keys = set(T["en"])
for lang, d in T.items():
    assert set(d) == keys, (lang, keys ^ set(d))
    for k in ("tools", "feats", "who", "steps", "faq"):
        assert len(d[k]) == len(T["en"][k]), (lang, k)
Enter fullscreen mode Exit fullscreen mode

This caught more mistakes than I'd like to admit.

  • The build renders the English HTML once and embeds all 7 translations as JSON. On load, a short script swaps the text in place. Every translatable element just carries a data-k attribute:
<h1 data-k="h1">Selling online? Stop paying for <mark>5 tools</mark>.</h1>
Enter fullscreen mode Exit fullscreen mode
var els = root.querySelectorAll("[data-k]");
for (var i = 0; i < els.length; i++) {
  var k = els[i].getAttribute("data-k");
  if (d[k] != null) els[i].innerHTML = d[k];
}
Enter fullscreen mode Exit fullscreen mode
  • The output is one file you paste into the Raw HTML element. CSS, markup and script together.

Picking the language

The order that ended up feeling right:

  1. #fr in the URL (set when someone clicks a language button, so a refresh keeps their choice)
  2. ?lang=fr (what I put in links I share)
  3. The browser's languages (navigator.languages)
  4. English
function initial() {
  var h = fromHash(); if (h) return h;
  var p = String(q("lang") || "").toLowerCase();
  if (LANGS.indexOf(p) > -1) return p;
  var nav = navigator.languages || [navigator.language || "en"];
  for (var i = 0; i < nav.length; i++) {
    var c = String(nav[i] || "").slice(0, 2).toLowerCase();
    if (LANGS.indexOf(c) > -1) return c;
  }
  return DEF;
}
Enter fullscreen mode Exit fullscreen mode

Arabic flips the whole block with dir="rtl" on the root element, set in the same function that swaps the text.

Knowing where visitors come from

Every link I share has ?src=quora, ?src=pinterest and so on. The script reads it, sanitises it, and appends it to the outgoing signup link as a tracking tag together with the language:

function src() {
  var s = String(q("src") || "").toLowerCase()
    .replace(/[^a-z0-9-]/g, "").slice(0, 24);
  return s || "page";
}
// outgoing link gets: &tk=fr-quora
Enter fullscreen mode Exit fullscreen mode

So one page, and I still see "French visitor from Quora" in the stats.

The ugly part: hiding the template

The builder wraps your element in its own page template (header, padding, background). Instead of fighting it element by element, the Raw HTML block pins itself over the whole viewport:

w.style.cssText = "position:fixed;inset:0;z-index:2147483000;" +
                  "overflow:hidden auto;background:#F7F4EF";
document.body.style.overflow = "hidden";
Enter fullscreen mode Exit fullscreen mode

It's a hack, and I'd rather not need it. But it's one line to remove if the builder ever gives me a blank template.

What I'd do differently

  • Prices are text, not numbers. Each language has its own price string ("from $17/month", "dès 17 € par mois", "a partir de R$ 95 por mês") copied from the vendor's own localized pricing page. Converting currencies myself would have been wrong in at least one country.
  • One language stayed separate. The Hebrew version is its own page, not one of the buttons. Sometimes "one page for everything" isn't the right call.
  • Test the boring URLs. For days the bare domain (no www) had no DNS record, and I only noticed when I clicked one of my own shared links. Now I open every link before I share it.

Result

The live page is here if you want to poke at the language switching: www.richmanlabs.com/start. Try ?lang=ar for the RTL version.

Disclosure: the page is an independent guide to Systeme.io, the tool it runs on. Its signup links are affiliate links, so I earn a commission if someone upgrades to a paid plan through them.

Top comments (0)