Docs / Get started
Set up Eachlang
There are two ways to set up Eachlang, and the dashboard suggests one based on how your site is built.
For sites built with Lovable or Next.js (App Router). You paste one prompt into your AI coding agent; it adds translation support to your app’s code.
yoursite.com/aboutyoursite.com/fr/aboutPart 1DNS (CNAME)Only if your site already uses language subdomains, for example from Weglot. One TXT record to prove you own the domain, then one CNAME per language.
yoursite.com/aboutfr.yoursite.com/aboutPart 2Not 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?
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:
- install the Eachlang package and add your public key (
pk_…); - keep your original language at the root (
/aboutstays/about) and add target languages under/fr/about,/de/about; the path itself is not translated; - load translations on the server, so the page your visitor gets is already translated;
- wrap every visible text in
t("…"), using the original text as the key; - add
<html lang>,hreflanglinks (withx-default) and a self-referencing canonical to every page; - add a language switcher and save an offline copy of the translations in your repo;
- add an “Eachlang i18n rules” section to
AGENTS.md, so later prompts keep usingt("…").
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:
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
- 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.
- 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.
- 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. - 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.
- 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.
- Set the two environment variables if the agent asks you to:
EACHLANG_PUBLIC_KEY= yourpk_…key, andEACHLANG_API_BASE=https://api.eachlang.com. Both are read on the server only, so they have noNEXT_PUBLIC_orVITE_prefix. Not yet tested on Lovable with aVITE_prefix. - Publish your app, then open
yoursite.com/fr/. The dashboard shows “First request received” once your app has called the API. - 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.
- 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.tsand icons stay at theapp/root. - On Next.js 16 the routing file is
proxy.ts; on 15 or earlier it ismiddleware.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
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.
Check, in this order:
- The text is not wrapped in
t("…"). Ask the agent to wrap it, attributes too. - The text is new and not translated yet. Reload a little later.
- Your app caches pages. New translations arrive within about a minute, plus your host’s cache.
- Your plan’s word limit was reached. New texts wait; existing translations are not affected and nothing extra is charged.
- It is a brand name, code, a URL or content your users wrote. These are deliberately not translated.
Translation is paused for this project. Check the yellow bar in the dashboard and click Resume. Pause and Resume take effect within about a minute plus your host’s cache.
The language isn’t in your project, or the agent didn’t move the pages under the language segment. Check the language list in the dashboard, then ask the agent to re-check step 3 of the prompt.
Check that the environment variables are named exactly EACHLANG_PUBLIC_KEY and EACHLANG_API_BASE. A wrong key never breaks your site: it shows the last translation or the original text and does not redirect.
Undo that change with the restore point from step 4, remove any saved rule from the project’s knowledge, and paste the prompt again.
A failed build, a redirect loop or changed original pages come from the code the agent wrote, so Pause won’t fix it. Restore the version from step 4, or use the removal prompt in Pause, roll back or remove. Then tell us what happened.
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
- Create the project and pick languages in the Eachlang dashboard, check the preview and start your trial; no card is needed for setup.
- Choose “DNS”.
- 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.
- Add one CNAME per language: name
fr, targetedge.eachlang.com. The language is ready when both its address and SSL certificate show Active - Open
https://fr.yoursite.comonce the status is Active. -
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.
- 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.
- 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.
- GoDaddy, Namecheap, your registrar or host: open the DNS settings and add a CNAME with host
frand a TXT with host_eachlang-challenge. - See
fr.yoursite.com.yoursite.comafter saving? Your provider wanted only the part before your domain; remove the extra part. - A record with the same name already exists, for example an old
frCNAME from another translation tool? Edit it instead of adding a second one. Moving from Weglot? Read the rollback guide first.
Not yet tested
These steps are based on Squarespace’s documentation and have not been tested with Eachlang on a real Squarespace site.
- DNS records: Domains → your domain → DNS settings.
- robots.txt can’t be edited: use Search Console, or the head block via Settings → Developer Tools → Code Injection → Header (Core, Plus or Advanced plan).
- Checkout, member areas and customer accounts: expect them to stay in your original language until we confirm otherwise.
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
Domain and record errors
No code matches. Quote the exact code to support@eachlang.com and we’ll look.
Troubleshooting
fr.yoursite.comshows 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
- Create the project and pick languages in the Eachlang dashboard.
- Paste the script into your site’s
<head>, before other scripts, withoutasyncordefer. Use the key from your dashboard:
<script src="https://api.eachlang.com/v1/widget.js" data-key="pk_your_key"></script>
- Open your site. A language switcher appears in the bottom-right corner. Pick a language.
- 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 callEachlang.setLanguage('fr'). - A link in one language: add
?eachlang_lang=frto the address. - Keep something untranslated: add
translate="no"or the classnotranslate.
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
asyncordefer, 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>.
## 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.