/es. Its copy is held in a typed dictionary keyed by locale, so a second locale is a set of translated entries plus routing, not a rewrite of every page. This page records how the copy is held today, how the Spanish locale is routed, and the language rules for the translation. The app flow (/mainnet, /testnet and their pages) is out of scope.
How the copy is held
apps/web/lib/i18n/locale.tsdeclares the locales (enandes),SITE_LOCALE(the English default), and for each locale the<html lang>value, the tag dates and numbers are formatted with, theog:localevalue and thehreflangvalue.SITE_LOCALEis a build-time constant. Nothing reads a header or a cookie to choose the locale, so every page underapp/(marketing)andapp/(marketing-es)stays prerendered and keeps its per-page hash policy (apps/web/scripts/marketing-csp.mjs).apps/web/lib/i18n/messages/holds one module per surface (nav,footer,not-found,landing,faq,security,how-it-works,hero,stats,registry,playground,content,blog,site,common), each aRecord<Locale, Copy>. A client component imports only its own section, so the browser never downloads the whole dictionary.- A post’s title and description come from the post, and a video’s title and description from the video, each in its own language. The planned article titles on
/contentare titles of posts to come, so they stay with the post list inlib/site/content-status.ts. The page around them (headings, labels, and the units of a reading time or a video’s length) is dictionary copy. - A sentence built from data is a function of that data, never a frozen string. The status registry (
lib/site/status.ts) keeps each feature’s id, status and link; its title, noun and summary come from the dictionary, and the sentences that list testnet-only features or live protocol exits are dictionary functions called with the registry’s names. The FAQ answers are a function of the registry facts, the trust statements (lib/site/trust.ts) and the base reserve (lib/site/reserve.ts), built per locale byfaqItems()(components/marketing/Faq.tsx), and the FAQ structured data reads the same answers. - A sentence with a link or other markup inside it is a function that takes the element, so a translation can move the link within its sentence.
apps/web/lib/i18n/format.tsformats every date and number on these pages with the locale’s tag. It also picks a noun’s plural form (plural,pluralForm) and joins lists (formatList) by the locale’s rules.- Messages the landing’s components share with the app flow are reason codes:
addressProblem()(lib/utils/validation.ts) andEstimateError.reason(lib/api/estimate-client.ts). Each component reads the sentence for its locale from theaddressandherosections; the app keeps the English. Nothing in this scope callstoLocaleString,toLocaleDateStringorIntldirectly. - The lint rule in
apps/web/eslint.config.mjs(DICTIONARY_COPY) fails on text in markup, on a literal in a user-facing attribute or rendered as a child, on a literal page title or description, and on a three-word literal anywhere else in those files. Class names, URLs, roles, import paths, directives, error messages and comparisons pass. The asset codeXLMis the one word allowed in markup.
Routing
Options
The App Router has no configuration-based locale routing: thei18n option in next.config belongs to the Pages Router, and the App Router guide routes locales with an app/[lang] segment, a Proxy redirect and generateStaticParams (Next.js internationalization guide, updated 2026-11-06, checked 2026-11-16). That leaves two ways to add Spanish.
A dynamic [locale] segment. Every marketing route moves under app/(marketing)/[locale]. English then either gains a prefix, or keeps its URLs through a Proxy rewrite:
- An
/en/prefix changes every canonical URL, every sitemap entry and every backlink, and needs a redirect for each old path. - A rewrite from
/faqto/en/faqmeans the Proxy runs on every marketing path. Today the Proxy matcher inapps/web/proxy.tslists the marketing paths literally so that it skips them: a CDN hit on a prerendered page costs no function call, and the page’s only policy is the hash header the build writes. A rewrite gives that up. - The hash policy is keyed by the requested path.
marketing-csp.mjsreads the prerendered paths from Next’s manifest (/en/faq), while the header has to match the path the browser asked for (/faq), so the script would need a rewrite map. Its group check (/(marketing)/) and plain-path check hold, but the prerender gate would report/[locale]/faqroutes and their params instead of one route per path. - The
web vercel build (adapter)CI job would have to prove that each header route matches the rewritten path, which no test covers today. - Choosing the locale from
Accept-Languagereads a header, which makes the Proxy or the page dynamic.
app/(marketing). Spanish lives under app/(marketing-es)/es/, a route group with its own root layout that passes locale="es" to the shared root document, so <html lang> is right without reading a request. Each Spanish page is a thin module that renders the same page component with the Spanish dictionary and builds its metadata with pageMetadata for that locale.
- Every page stays static, and the prerender gate, the per-path hash policy and the adapter job work unchanged in mechanism.
- The Proxy matcher gains the literal
es/...paths, with the test inapps/web/tests/unit/proxy-matcher.test.tsextended to them, andmarketing-csp.mjsaccepts both groups. - Moving between the two root layouts reloads the page, which is acceptable for a language switch.
- There is no automatic redirect by browser language. A visitor switches with a link in the header and footer, and search engines find the Spanish pages through
hreflang.
What is in place
app/(marketing-es)/layout.tsxis the Spanish root layout:RootDocument,MarketingShelland the root metadata, each givenlocale="es". The navigation and footer read their copy for the locale they are given.SPANISH_PAGESinapps/web/lib/site/pages.tslists the English pages that have a Spanish version, each with atranslatedflag. That one list drives everything else:- an untranslated Spanish page is marked
noindexand left out of the sitemap; a translated one is indexed and listed in the sitemap with its English page’s rank; - the language switch (
components/marketing/LanguageSwitch.tsx) links a page to its other version only when that entry is translated, in both directions, so no link leads to English text underlang="es-419"; - the
hreflangset,og:locale:alternateand the sitemap alternates are declared only for a translated pair, so no indexed page names anoindexpage as its alternate.
- an untranslated Spanish page is marked
spanishPages()inapps/web/lib/site/spanish-pages.tsadds a translated entry for each post undercontent/blog/es, so a translated post has no entry to keep by hand. It reads the posts from disk, so it runs on the server:MarketingShellpasses its list to the navigation and footer, and the post pages and the sitemap pass it topageMetadata()andlanguageAlternates().- Today the list holds the landing page, the FAQ, the security page, how it works and the blog index, all translated:
/esrenderscomponents/marketing/LandingPage.tsx,/es/faqrenderscomponents/marketing/FaqPage.tsx,/es/securityrenderscomponents/marketing/SecurityPage.tsx/es/how-it-worksrenderscomponents/marketing/HowItWorksPage.tsxand/es/blogrenderscomponents/blog/BlogIndexPage.tsxin Spanish, each is indexed and listed in the sitemap, and the switch links each English page with its/esversion. The security page’s trust statements and server keys come fromtrustStatements()andserverKeys()(lib/site/trust.ts) for the page’s locale, the same data the English page reads. Links from a Spanish page lead to the Spanish version of a page only once it is translated (localeHref()), and to the English page until then. - A translated post is
content/blog/es/<slug>.mdx, under its English post’s slug, and is served at/es/blog/<slug>byapp/(marketing-es)/es/blog/[slug]/page.tsx, which renderscomponents/blog/PostPage.tsxlike the English route. The pairing is the file name: a translation without a published English post fails the build. The English blog, its feed,/contentand the English share images read onlycontent/blog. A translated post:- has its own front matter, validated like an English post’s, with
publishedAtthe day the translation was published; - links to the Spanish version of a page or post that has one and to the English page otherwise, and to the Spanish entry points (
tests/unit/blog-content.test.ts); - keeps its English post’s headings, lists, tables, code, reserve components, external links and app links (the same test), so a claim cannot be dropped or added without the test naming it;
- states the base reserve through
<BaseReserve />and<BaseReserveCheckedOn />, which format it for the post’s locale; - has its own share image, drawn from its Spanish title at
/es/blog/<slug>/share.png; - is listed on
/es/blogand related to other Spanish posts only. There is no Spanish feed: the feed carries the project’s updates, which are not translated, and only the English blog pages advertise it.
- has its own front matter, validated like an English post’s, with
- An unknown
/es/blog/<slug>is a routing miss, as an unknown/blog/<slug>is: each post route prerenders its slugs and takes no other (dynamicParams = false), so the request answers 404 with the full Spanish 404 page. - The landing page embeds the FAQ. Its questions show in a locale only while
/faqhas a translated entry there (isTranslated()), so a Spanish landing never carries English answers. - The Proxy matcher skips
es(and its RSC payloads) literally, andtests/unit/proxy-matcher.test.tswalks both route groups, so a Spanish page without its matcher line fails the test.marketing-csp.mjsrequires both groups to be prerendered, hashes each Spanish page like an English one, and checks that/es/nopeand/es/blog/nopekeep the nonce policy. - An unknown path gets the 404 from
app/global-not-found.tsxin the language of its path. The Proxy already runs on every unknown path for the nonce, and it also writesx-lumenwipe-locale(localeOfPath():esfor/esand every path under it, matched case-sensitively as the routes are,enfor anything else) on every request it forwards, overwriting any value the client sent. The 404 reads it withheaders(), accepts only a value inLOCALESand falls back to English. It was already rendered per request, so this adds no dynamic route and no route under(marketing-es). /with/es,/faqwith/es/faq,/securitywith/es/security,/how-it-workswith/es/how-it-works,/blogwith/es/blogand each translated post with its English post declare theirhreflangset andog:locale:alternate, and their sitemap entries list both URLs. Translating another page and setting its flag turns all three on for that pair.
hreflang, canonical and Open Graph
pageMetadata()(apps/web/lib/site/pages.ts) keeps a self-referencing canonical per locale:/faqis canonical for English and/es/faqfor Spanish. A Spanish page never points its canonical at the English page.pageMetadata()declaresalternates.languagesonly for a translated pair (languageAlternates()):ento the English URL,esto the Spanish URL, andx-defaultto the English URL. Google ignores a pair that does not point at each other, and each version must list itself as well as the others (Google Search Central, localized versions, checked 2026-11-16). This extends the canonical and share image work of #527 rather than replacing it.- The sitemap lists the same set under both URLs of each translated pair (
sitemapPages()). - Every page shares a card in its own language.
shareImage()(apps/web/components/seo/ShareImage.tsx) draws both locales from the same brand source:siteShareCard(locale)takes its copy fromSITE[locale].metadata.shareCardand the example plan fromreserveExample(locale), andpostShareCard(post, locale)takes the blog label and category fromBLOG[locale]. The Spanish site card is served at/es/opengraph-imagebyapp/es/opengraph-image.tsx, outside the route group as the English one is atapp/opengraph-image.tsx(inside a route group Next serves a metadata image under a hashed path), and each Spanish post’s card at/es/blog/<slug>/share.png, both prerendered like the English ones.shareImageFor(locale)andpostShareImage(slug, title, locale)give their URL and alt text, whichpageMetadata()androotMetadata()use forog:imageandtwitter:image. The bundlednext/ogfont (Geist) covers the Spanish accents,ñ,¿and¡. og:localeisen_USores_LA, and each page of a translated pair lists the other asog:locale:alternate.- The structured data carries
inLanguage, the<html lang>tag of the language the page is written in (enores-419), on its page-level nodes:WebSite,WebApplication,FAQPage,BlogandArticle. Its names and labels (the breadcrumb, the blog’s name, the live protocol exits in the feature list) come from the dictionary.
Locale tags
Language
- Neutral Latin American Spanish. No regional vocabulary, no voseo, no vosotros, and no idiom that reads as one country’s. Amounts keep the formatting of
es-419from the format helper. - Tú, not usted. The wallets and exchanges our readers already use address them as tú, and usted reads distant on a page that asks them to sign.
- Protocol terms stay in English, because they are what wallets, explorers and the Stellar docs show. On a page’s first use, the term is followed by a gloss in parentheses; after that it stands alone.
Product names (LumenWipe, Stellar, Soroban, the protocol names), asset codes (XLM) and code identifiers are never translated.
apps/web/tests/unit/spanish-dictionary.test.ts walks every section a translated page reads and fails on a missing entry, or one that reads the same as the English, unless it holds only the names and protocol terms it lists. A translated section is added to its SECTIONS.
Rollout
Two pull requests under #534 do the extraction: the dictionary, the helpers, the guard, the navigation, footer, 404, landing and FAQ first, then security and how it works. Translation is a separate epic, with these issues in order:- [web] Move the copy of the stats, registry, playground and content pages and the blog index into the locale dictionary. The same extraction for the pages #534 leaves out, with the guard extended to them.
- [web] Serve a Spanish locale under
/es. The(marketing-es)route group and its root layout, the locale tags, a language switcher, the Proxy matcher entries and their test,marketing-csp.mjscoverage of the second group, and the sitemap alternates. No page is translated yet: the group starts with the landing page in English behindnoindex. - [web] Add
hreflang, Open Graph and structured data alternates for localized pages.alternates.languageswithx-defaultinpageMetadata(),og:locale:alternate,inLanguage, and the remaining English strings inlib/site/structured-data.ts. - [web] Translate the navigation, footer, 404 and landing page into Spanish.
- [web] Translate the FAQ and its structured data into Spanish.
- [web] Translate the security and how it works pages into Spanish.
- [web] Translate the five merge-blocker articles into Spanish. Extra signers, open offers, trustlines, data entries and claimable balances, each with its own canonical and
hreflangpair. - [web] Give Spanish pages Spanish share images.
translated: true on the SPANISH_PAGES entries it ships, which removes their noindex, adds them to the sitemap and shows the language switch on both versions, and adds the sitemap alternates with the first one.