Docs / Get started

Set up Eachlang

Last checked 6 November 2026Both setups, step by step

There are two ways to set up Eachlang, and the dashboard suggests one based on how your site is built.

Not built with an AI tool? On WordPress and Shopify, the Eachlang plugin or app puts your languages in subfolders like yoursite.com/fr/, which is the default. On Squarespace, Webflow or another platform, write to us and we’ll tell you which addresses your site gets.

Before either setup you can preview a translated page of your own site. The 14-day trial runs on Pro and needs no card. Your plan is for the whole account and includes every language and every setup on this page, the website widget too: Pro is $39 a month billed yearly ($49 monthly) with one site, Agency is $99 a month billed yearly ($125 monthly) with 10 sites, and each extra site is $10 a month; see Pricing. Words are counted once, in your original language, however many languages you add.

Nothing upgrades by itself. At a limit your translated pages stay live and new text waits for next month, or you add more in one step. Changed your mind later? Every step on this page can be undone without our help: see Pause, roll back or remove.

Not yet tested What this mark means

Steps marked not yet tested have not been run end to end on a real site yet. Bolt and v0 are not tested yet.

Which setup should I use?

Your siteUseWhy
LovableUseAI promptWhyLovable apps render in the browser with React. A proxy can translate the HTML, but React then redraws the page in the original language, so translation has to happen inside the app.
Next.js (App Router)UseAI prompt (Next.js version)WhySame reason.
v0Not yet testedWhyv0 projects are usually Next.js, so the Next.js prompt should fit, but we have not run it on a v0 project yet.
BoltNot yet testedWhyMost Bolt projects are Vite + React, and our prompt for plain Vite + React is not available yet. If your Bolt project is Next.js, the Next.js prompt should fit.
WordPress, ShopifyUsePlugin or app, subfoldersWhySubfolders are the default.
Squarespace, Webflow, staticUseWrite to us firstWhyWe check your site and tell you which addresses it gets.
Renders in the browser (single-page app without server HTML)UseWebsite widgetWhySearch engines can’t read the original page, so the widget translates it for visitors. When your site gets server HTML, move to a subfolder setup with the same translations.
Already has language subdomainsUseDNS (CNAME)WhyKeeps your existing language addresses, like fr.yoursite.com. The page HTML comes from your host, so Eachlang translates it on the subdomain without touching your code.

Not sure? Start with the one the dashboard suggests. You can switch later: open Settings › Setup and go back to the Install path step.

Where things are in the dashboard

Open your project at app.eachlang.com. The menu on the left has:

  • Overview: your site's status and languages, usage and the Setup check (with DNS setup, Open check opens the install check), the Getting set up steps (a Setup link once they're all done), Updates, your Plan (Upgrade or Change plan), the Pause translation switch and Need help? (Ask AI and email).
  • Translations › Languages: add or remove languages, and choose or change your plan (Upgrade, Change plan).
  • Translations › Translation list: the translated texts.
  • Translations › Glossary: words that are never translated, or always translated one way.
  • Translations › Images: show a different image in a language.
  • Settings › General: the basics for your site, and pausing translations.
  • Settings › Language switcher: how visitors change language.
  • Settings › Setup: your setup steps (AI prompt) or the install check (DNS).
  • Settings › Project members: invite team members.
  • Account › Sites: all your sites.
  • Account › Billing: plan, next invoice, Cancel subscription and Keep my subscription.
  • Account › Refer & earn: your referral code and credit.
  • Ask AI (top right, or ⌘J / Ctrl J): ask about setup, DNS, your plan or moving from Weglot. The assistant can see this project's setup and status, but it doesn't change anything; you make changes yourself. If it can't sort something out, it points you to support@eachlang.com.

Part 1

AI prompt setup (Lovable, Next.js)

On npm

The prompt installs one package: @eachlang/next for Next.js or @eachlang/tanstack for Lovable / TanStack Start. Both are MIT-licensed. The full prompts are on the setup prompts page.

Test status

The Lovable prompt was tested on one Lovable project; not yet tested end to end on a published site. Bolt and v0: not tested yet.

What the prompt does

The prompt asks your coding agent to:

  1. install the Eachlang package and add your public key (pk_…);
  2. keep your original language at the root (/about stays /about) and add target languages under /fr/about, /de/about; the path itself is not translated;
  3. load translations on the server, so the page your visitor gets is already translated;
  4. wrap every visible text in t("…"), using the original text as the key;
  5. add <html lang>, hreflang links (with x-default) and a self-referencing canonical to every page;
  6. add a language switcher and save an offline copy of the translations in your repo;
  7. add an “Eachlang i18n rules” section to AGENTS.md, so later prompts keep using t("…").

Your original-language pages do not depend on the Eachlang API. If the API is slow or down, your app shows the last translation it knew, then the offline copy, then the original text. It never shows an error page because of Eachlang.

Don’t let the agent write the translations itself

When you ask Lovable (and other agents) for “a French version”, they often write the French text into your code by hand. That is not what this prompt does: Eachlang translates, and the agent only adds the plumbing. If your agent starts writing French, German or Spanish sentences into files, stop it and reply:

Paste to your agentDon’t write translations yourself. Use the Eachlang API as described in the prompt; t() only wraps the original text.

On Lovable, check the project’s knowledge first. If you asked Lovable for a translated version before, it may have saved a rule like “I will translate new text myself”. Undoing the edit does not remove that rule. Delete it before you paste the Eachlang prompt.

Step by step

  1. Create the project and pick languages. In the Eachlang dashboard, add your site’s URL, choose your source and target languages, and look at the preview. Your trial starts on Pro; no card is needed for setup.
  2. Choose “AI prompt” and your builder tab: Lovable / TanStack Start or Next.js (App Router). v0 and Bolt (Next.js projects only): the Next.js tab should fit, but this is not tested yet.
  3. Copy the prompt. It already contains your languages, your site URL and your public key (pk_live_…). The public key is not a secret: it can only read your published translations and report new texts.
  4. Make a restore point. Commit your code, or note the current version in Lovable’s history. The prompt changes many files at once; one restore point makes undoing it one step.
  5. Paste the prompt into your agent as one message and let it finish. If it asks a question, answer it with the setting from the prompt; don’t change the URL structure.
  6. Set the two environment variables if the agent asks you to: EACHLANG_PUBLIC_KEY = your pk_… key, and EACHLANG_API_BASE = https://api.eachlang.com. Both are read on the server only, so they have no NEXT_PUBLIC_ or VITE_ prefix. Not yet tested on Lovable with a VITE_ prefix.
  7. Publish your app, then open yoursite.com/fr/. The dashboard shows “First request received” once your app has called the API.
  8. Open your translated pages once. When a page is opened in a target language, your app reports texts that have no translation yet, and Eachlang translates them in the background. Reload a little later. To have everything translated before you share the site, open each page once in each language.
  9. Go through the checklist below.

Lovable / TanStack Start

  • Page routes move under src/routes/{-$lang}/. Your root route, API routes and static files stay where they are.
  • If the agent does something the prompt doesn’t ask for, tell us at support@eachlang.com.

Next.js (App Router)

  • Pages and layouts move under app/[lang]/. app/api/, sitemap.ts, robots.ts and icons stay at the app/ root.
  • On Next.js 16 the routing file is proxy.ts; on 15 or earlier it is middleware.ts. The prompt covers both.
  • /en/… redirects to the root path with a 308, so there are no duplicate URLs.
  • Static pages (SSG/ISR) show new translations after the next revalidation or deploy.

Checklist after setup

0 of 9 checked

The first five matter most

Then

Troubleshooting

The translations are being loaded in the browser instead of on the server, or the server and browser use different texts.

Paste to your agentLoad Eachlang translations on the server only, in the [lang] layout (Next.js) or the {-$lang} route loader (TanStack). Pass the strings to EachlangProvider. Remove any useEffect or browser fetch that loads translations.

Part 2

DNS setup (CNAME)

How it works

Use this setup only if your site already has language subdomains, for example from Weglot. Otherwise your languages go in subfolders like yoursite.com/fr/ (see the top of this page).

Each language gets its own subdomain on your domain: fr.yoursite.com, de.yoursite.com. You point that subdomain to Eachlang with a CNAME record. When a visitor opens fr.yoursite.com/about, Eachlang fetches yoursite.com/about, translates it and serves it on the French subdomain.

Your main site does not go through Eachlang and keeps working exactly as before. Translated pages keep the same path as the original page; slugs are not translated. You need a custom domain, and the language address must be a subdomain.

Record Name Value How many
TXT (ownership) _eachlang-challenge Copy it from the dashboard One per domain
CNAME fr edge.eachlang.com One per language

You don’t add a certificate record. Once the CNAME points to Eachlang, our provider, Cloudflare, checks it and issues the SSL certificate for fr.yoursite.com on its own.

Text your scripts render after load. Translated pages include one small script from the same address (/__eachlang/rt.js, about 2 KB compressed, no inline code). When your own JavaScript adds or changes text after the page loads (tabs, carousels, counters, cookie banners, lists loaded later), it swaps in your published translations before the browser paints, so visitors do not see the original flash. It follows the same exclusions and uses the same published translations, glossary and locked rows as the page itself. New sentences it has no translation for are queued for translation and appear once published. If your site sends a Content-Security-Policy header, it needs 'self' in script-src and https://api.eachlang.com in connect-src; without them the page is still translated, only text added later stays in the original language. Pages that never change their text after load are not affected.

Step by step

  1. Create the project and pick languages in the Eachlang dashboard, check the preview and start your trial; no card is needed for setup.
  2. Choose “DNS”.
  3. Add the TXT record. Copy the name and value from the dashboard into your DNS provider, save, then click Verify. The TXT record doesn’t change anything on your live site.
  4. Add one CNAME per language: name fr, target edge.eachlang.com. The language is ready when both its address and SSL certificate show Active
  5. Open https://fr.yoursite.com once the status is Active.
  6. Add one line to your site’s robots.txt (the dashboard shows the exact line). It lets search engines connect each original page with its translations without changing your page HTML.
    Sitemap: https://fr.yoursite.com/eachlang-sitemap.xml
    • Webflow: Site settings → SEO → Indexing → robots.txt.
    • WordPress: your SEO plugin’s robots.txt editor, or the file in your site root.
    • Static site: public/robots.txt.
    • Squarespace: you can’t edit robots.txt; use step 7.
  7. Click “Run check”. It reads your site the way a search engine does and tells you one thing to fix at a time. Can’t add the robots.txt line? Submit the Eachlang sitemap in Google Search Console, or add the head block from the dashboard to every page.
  8. Submit your language subdomains in Google Search Console (optional but recommended) and request indexing for a few translated pages.

How long does it take?

  • DNS records: usually a few minutes, sometimes a few hours. If Verify doesn’t find the record, wait and try again.
  • SSL certificate: issued automatically; in our own test it took 1 to 4 minutes. Still not Active after 24 hours? Check the CNAME target, the Cloudflare proxy status and old records with the same name.
  • Setup check: under two minutes. It re-runs on its own, daily until it passes, then weekly.

DNS provider notes

  • Add the records under DNS → Records. In the Name field type only fr; for the TXT record, _eachlang-challenge.
  • Set the CNAME’s proxy status to DNS only (grey cloud). A proxied (orange cloud) CNAME is Not yet tested
  • If your domain has CAA records, they must allow the certificate authorities Cloudflare uses. No CAA records? Nothing to do.

Setup check messages

The dashboard shows a status and one step to fix. The code appears under the message, so you can quote it to support.

Status Meaning
Passed Setup is complete. Eachlang turns on x-default for your language links.
Failed Something on your site needs a fix; the message says what.
Inconclusive We couldn’t reach your site. We’ll try again; nothing to do yet.
Outdated Your languages or settings changed while the check ran. Run it again.

26 codes

Setup check

robots-satir-yokYour robots.txt doesn’t have the Eachlang sitemap line.Add the line from step 6. On Squarespace, use Search Console or the head block.
robots-satiri-hataliThere is an Eachlang line, but with the wrong address (http instead of https, an old language, or the main domain).Replace it with the exact line shown.
robots-yokYour site has no robots.txt, or it returns a web page instead.Create a robots.txt file with the line.
robots-okunamadirobots.txt couldn’t be read (server error, too many redirects).Check that yoursite.com/robots.txt opens, then check again.
kaynak-sitemap-yokEachlang couldn’t read your site’s own sitemap.Enter your sitemap’s path in the field that appears, or use the head block.
sitemap-okunamadiThe Eachlang sitemap on your language subdomain didn’t respond.Check the language’s CNAME record.
sitemap-ozeti-yokThe sitemap responded, but something in between removed a header we need.Make sure no other proxy or CDN sits in front of the language subdomain.
sitemap-bosYour sitemap has no pages on your site’s address.Check that the addresses in your sitemap start with your site’s address.
farkli-kokYour sitemap lists a different address than your project (for example www vs no www).If all of them differ, change the site address in your project; otherwise fix the sitemap.
kanonik-farkliA page’s canonical tag points to a different page.Fix that page’s canonical tag.
kaynakta-eski-hreflangYour original pages still have language links from a previous tool, for example Weglot.Remove the old hreflang tags from every page’s head, clear your cache and check again.
kume-uyusmuyorThe language links on a translated page don’t match the sitemap.Contact support; this may be on our side.
ceviri-sayfasi-hatasi, kaynak-sayfasi-hatasiA translated or original page didn’t return a normal page.Open the address shown and check again.
head-blogu-yok, head-blogu-uyusmuyorHead block route: the block is missing or out of date on a sampled page.Copy the current block from the dashboard into every page.
dil-hostu-yokYour project has no active language address yet.Add a language and its CNAME first (step 4).

Domain and record errors

txt-yokWe couldn’t find the TXT record. DNS changes can take a few minutes to a few hours; try again.
apexYour main domain can’t be a language address. Use a subdomain like fr.yoursite.com.
dogrulama-yokThe subdomain isn’t under the domain you verified. Verify that domain first.
baska-projedeThis address is already used by another Eachlang project.
yeniden-sahiplenme-kilidiThis address was in another account in the last 30 days. Add the new TXT record to prove ownership again.
altyapi-alaniEachlang’s own addresses can’t be added to a project.
gecersiz-alan, gecersiz-hostThe address isn’t a valid public domain name. Enter it like yoursite.com or fr.yoursite.com.
kaynak-reddiYour site’s address must start with https://, have no path and be under the domain you verified.
proje-aktif-degilThe project is paused by billing or deleted. Open Billing in the dashboard, or write to support@eachlang.com.
cloudflare-hatasiWe couldn’t create the language address at our provider. Nothing changed on your site; try again later.
kayit-cakismaTwo changes were saved at the same moment. Try again.

Troubleshooting

  • fr.yoursite.com shows a 404 page from Eachlang: the subdomain isn’t connected to an active project. Check the language is in your project and Active.
  • Translated pages redirect to your original page: translation is paused, or a temporary problem on our side sends visitors to the original. Check the dashboard and status.eachlang.com, or write to support.
  • Some text is not translated: text your own scripts add or change after load (tabs, sliders, cookie banners, lists loaded later) is translated in the browser from your published translations; a sentence that is not published yet stays in the original language until you publish it. Checkout pages on another domain, embedded third-party widgets in iframes and React/Next.js sites that re-render the page (use the AI prompt setup) may stay in the original language.
  • Images or styles look broken on the subdomain: contact support with the page address.

Part 3

Website widget

How the widget works

The widget is one script tag. It loads your translations in the visitor’s browser and swaps the text on the page. The address stays the same, and the browser remembers the visitor’s language. It works on any site where you can add a script to the <head>, including apps that render in the browser.

Search engines see your original page. When you want each language at its own address that search engines can find, pick a subfolder setup on the same plan: it uses the same translations, nothing is translated twice. In the dashboard a language served by the widget shows Live.

Add the widget

  1. Create the project and pick languages in the Eachlang dashboard.
  2. Paste the script into your site’s <head>, before other scripts, without async or defer. Use the key from your dashboard:
HTML
<script src="https://api.eachlang.com/v1/widget.js" data-key="pk_your_key"></script>
  1. Open your site. A language switcher appears in the bottom-right corner. Pick a language.
  2. New text is translated as visitors see it. The first time a page is shown in a language, text without a translation stays in the original and is sent for translation. Text over your plan’s word limit shows as Queued in the Translation list and stays in the original until there is room.

Widget options

Attribute Values Default
data-position bottom-right, bottom-left, top-right, top-left, inline, none bottom-right
data-style menu (drop-down) or list menu
data-label the switcher’s name for screen readers Language
  • Your own place for the switcher: add <div data-eachlang-switcher></div> where it should go.
  • Your own menu: use data-position="none" and call Eachlang.setLanguage('fr').
  • A link in one language: add ?eachlang_lang=fr to the address.
  • Keep something untranslated: add translate="no" or the class notranslate.

Widget and Content Security Policy

If your site sends a Content-Security-Policy header, add https://api.eachlang.com to script-src and connect-src. Nothing else is needed: the widget adds no inline scripts and needs no style-src change. The script is about 9 KB compressed.

Widget troubleshooting

  • The original language flashes before the translation: the script is loaded with async or defer, or too late in the page. Move it to the top of the <head>.
  • No switcher appears: check data-key, and that translation isn’t paused for your site.
  • Some text is not translated: text inside images, canvas and third-party iframes stays in the original language.

For AI coding agents

The rules your prompt adds to AGENTS.md

If you are an AI agent setting up Eachlang, read eachlang.com/docs/llms.txt. Your prompt fills in your own languages where the block says <source> and <targets>.

AGENTS.md
## Eachlang i18n rules
This app is translated with Eachlang (source: <source>; targets: <targets>).
- Wrap every new user-visible string in t("…") (server: makeT(tr.strings) after getTranslations(lang); client: useT()). The original
  text is the key. Include alt, title, placeholder, aria-label and page metadata; page <title> and
  meta description are translated on the server (loader / generateMetadata), not with useT().
- Dynamic values stay placeholders in the key: t("{count} in cart", { count }). Never concatenate
  pieces or call .replace() on a translated string.
- Write new text in <source> only; text in another language is not translated - flag it.
- Never write translations yourself (no locale files, no translated text in code); Eachlang
  translates. Untranslated text on target pages is expected until Eachlang publishes.
- Never translate in useEffect or in the browser; translations are loaded on the server in the
  [lang] layout / {-$lang} route loader.
- New pages go under the language segment (app/[lang]/… or src/routes/{-$lang}/…). Internal links
  and every redirect() keep the current language prefix (TanStack: pass params: { lang }). The
  source language has no prefix.
- Missing-string reports: the server code AWAITS the POST to Eachlang (Cloudflare Workers and
  serverless cancel un-awaited fetches); the browser never awaits it. Do not make it fire-and-forget.
- After changes, npx tsc --noEmit must pass.
- Every page keeps <html lang>, hreflang alternates (+ x-default) and a self canonical. New pages
  are added to the multilingual sitemap with the same alternates. The language switcher uses the
  same alternates list; do not build another one.
- Do not add error handling that shows an error page when Eachlang is unavailable; the library
  falls back to the last known translation or the original text.
- After adding many strings, run `npm run eachlang:snapshot` and commit eachlang/snapshot/.
- Do not remove this section unless the user asks to remove Eachlang.

This page was drafted with AI assistance and checked by a person. Lovable, Bolt, v0, Next.js, Webflow, WordPress, Squarespace, Cloudflare and Weglot are trademarks of their owners. Eachlang is not affiliated with or endorsed by them.