Most i18n tutorials assume a SaaS dashboard going into many languages. Small career schools usually need exactly two languages, a modest number of pages, a blog, and a single enrollment or contact form that absolutely has to work on a cheap phone over a weak connection. The audience is often split: some prospective students search in English, others search in Spanish, and plenty of families switch between the two depending on who in the household is reading.
Think about the kind of site a school like Brilliant Dental Assisting School in Dallas needs. It runs a program with classes in English on one day and in Spanish on another, so the Spanish pages are not a courtesy translation. They are a primary entry point for a real share of visitors. If the Spanish version is slow, half-translated, or invisible to search engines, the school is effectively closed to those people online.
This post walks through the decisions that matter for that kind of two-language site: URL structure, hreflang, translated slugs, structured data, sitemaps, the language switcher, accessible forms, and Core Web Vitals on image-heavy pages. Code samples use a generic Next.js App Router setup, but the concepts carry over to any stack. This is a pattern guide, not a description of any specific school's implementation.
1. Pick a URL strategy and commit to it
You have three common options for language versions:
| Strategy | Example | Notes |
|---|---|---|
| Subdirectory | example.com/es/about | One domain, one set of signals, easy to host |
| Subdomain | es.example.com/about | More infrastructure, separate property in some tools |
| Query parameter | example.com/about?lang=es | Google's multi-regional guidance discourages this |
For a small school, the subdirectory approach is the least painful. English lives at the root, Spanish lives under /es. You can see the pattern live at the Spanish version of the Brilliant Dental Assisting School site, where the root is English and /es holds the Spanish pages.
A few rules make this work long-term:
- The default locale has no prefix.
/aboutis English,/es/about(or a translated slug, more on that below) is Spanish. Do not redirect/to/en. It adds a hop and splits your history. - Never serve different languages at the same URL based on cookies or the
Accept-Languageheader. Crawlers generally do not send the same headers as a user's browser, so they may only ever see one version. Google's documentation explicitly recommends against automatic redirection based on perceived language. - Every page gets one canonical URL per language. The Spanish page canonicalizes to itself, not to the English page. Pointing the Spanish canonical at English tells search engines the Spanish page is a duplicate, and they may drop it.
A minimal App Router layout
app/ [locale]/ layout.tsx page.tsx about/page.tsx courses/[slug]/page.tsx blogs/[slug]/page.tsx sitemap.ts robots.ts middleware.ts i18n/ config.ts dictionaries/en.json dictionaries/es.json slugs.ts Root-without-prefix plus /es is a little awkward in a [locale] segment, because English has no segment. A common trick is to rewrite (not redirect) unprefixed paths internally to /en/... in middleware so your route tree stays uniform:
// middleware.ts import { NextResponse, type NextRequest } from "next/server"; const LOCALES = ["en", "es"] as const; const DEFAULT_LOCALE = "en"; export function middleware(req: NextRequest) { const { pathname } = req.nextUrl; // Skip assets and API routes if (pathname.startsWith("/_next") || pathname.startsWith("/api") || pathname.includes(".")) { return NextResponse.next(); } const first = pathname.split("/")[1]; if (LOCALES.includes(first as (typeof LOCALES)[number])) { // /en/... should not be publicly reachable: send it to the unprefixed URL if (first === DEFAULT_LOCALE) { const url = req.nextUrl.clone(); url.pathname = pathname.replace(/^\/en/, "") || "/"; return NextResponse.redirect(url, 308); } return NextResponse.next(); } // Unprefixed = English. Rewrite internally, URL stays the same. const url = req.nextUrl.clone(); url.pathname = `/${DEFAULT_LOCALE}${pathname}`; return NextResponse.rewrite(url); } Notice what is not here: no sniffing of Accept-Language, no automatic bounce to Spanish. We will handle language suggestion in the UI instead (section 6).
2. Set lang correctly, everywhere
The lang attribute on <html> is not mainly an SEO signal. It is an accessibility and rendering signal. Screen readers use it to pick a pronunciation engine. Browsers use it for hyphenation, quote styles, and spell-check. A Spanish page announced with English phonetics is close to unusable for a blind Spanish speaker.
// app/[locale]/layout.tsx export default function LocaleLayout({ children, params, }: { children: React.ReactNode; params: { locale: "en" | "es" }; }) { return ( <html lang={params.locale}> <body>{children}</body> </html> ); } Two details people miss:
- Mixed-language fragments need their own
lang. On a Spanish page, if you show the English name of a credential or a quoted English term, wrap it:<span lang="en">Chain of infection</span>. The language switcher link labeled "English" on a Spanish page also needslang="en". - Dates, times, and phone formatting should go through
Intlwith the active locale rather than hardcoded strings.new Intl.DateTimeFormat("es-US", { weekday: "long" })gives you "domingo" for free.
3. hreflang: the part everyone gets slightly wrong
hreflang tells search engines "this URL has an equivalent in another language, here it is." It does not boost rankings. It helps the right version show up for the right searcher and avoids the two versions competing.
The rules, from Google's localized versions documentation:
- Each language version must list all versions, including itself.
- Annotations must be reciprocal. If English points to Spanish and Spanish does not point back, the pair can be ignored.
- Use ISO 639-1 language codes (
en,es), optionally with an ISO 3166-1 alpha-2 region (es-US,es-MX).es-LAis not a valid region code, a mistake that shows up on a lot of "Latin American Spanish" sites. - Add
x-defaultfor the fallback page shown when no language matches. - URLs must be absolute.
For a school serving a US city, plain en and es are usually the honest choice. You are not making separate pages for Mexico and Spain. Adding region codes you do not actually target just creates more annotations to keep correct.
Raw HTML
<!-- On https://www.example-school.com/about --> <link rel="canonical" href="https://www.example-school.com/about" /> <link rel="alternate" hreflang="en" href="https://www.example-school.com/about" /> <link rel="alternate" hreflang="es" href="https://www.example-school.com/es/sobre-nosotros" /> <link rel="alternate" hreflang="x-default" href="https://www.example-school.com/about" /> <!-- On https://www.example-school.com/es/sobre-nosotros --> <link rel="canonical" href="https://www.example-school.com/es/sobre-nosotros" /> <link rel="alternate" hreflang="en" href="https://www.example-school.com/about" /> <link rel="alternate" hreflang="es" href="https://www.example-school.com/es/sobre-nosotros" /> <link rel="alternate" hreflang="x-default" href="https://www.example-school.com/about" /> Next.js Metadata API
The Metadata API can emit these from alternates. The trick is to compute them from a single source of truth instead of hand-writing them per page.
// app/[locale]/about/page.tsx import type { Metadata } from "next"; import { alternatesFor } from "@/i18n/slugs"; export async function generateMetadata({ params, }: { params: { locale: "en" | "es" }; }): Promise<Metadata> { return { title: params.locale === "es" ? "Sobre nosotros" : "About us", alternates: alternatesFor("about", params.locale), }; } We will build alternatesFor in the next section.
4. Translate slugs, but keep a route key
Should /es/about be /es/sobre-nosotros? For a Spanish-speaking searcher, a readable Spanish slug is nicer to see in results and easier to share in a WhatsApp message. The cost is that you can no longer derive the Spanish URL by prefixing /es. You need a mapping.
The cleanest approach is a route key: a stable, language-neutral identifier for each page, with per-locale slugs attached.
// i18n/slugs.ts const SITE = "https://www.example-school.com"; type Locale = "en" | "es"; export const ROUTES: Record<string, Record<Locale, string>> = { home: { en: "/", es: "/es" }, about: { en: "/about", es: "/es/sobre-nosotros" }, courses: { en: "/courses", es: "/es/cursos" }, contact: { en: "/contact", es: "/es/contacto" }, }; export function alternatesFor(key: string, locale: Locale) { const r = ROUTES[key]; if (!r) throw new Error(`Unknown route key: ${key}`); return { canonical: `${SITE}${r[locale]}`, languages: { en: `${SITE}${r.en}`, es: `${SITE}${r.es}`, "x-default": `${SITE}${r.en}`, }, }; } For blog posts and course pages, store the route key in your CMS or front matter:
# content/blog/es/terminologia-dental.md --- routeKey: dental-terminology locale: es slug: terminologia-dental-ingles-espanol title: "Terminología dental en inglés y español" --- At build time, group posts by routeKey. If a post exists in only one language, emit no hreflang for it, or only a self-reference. Pointing a Spanish post's hreflang="en" at the English blog index is a classic error: the index is not an equivalent page.
Not every Spanish post needs an English twin, either. hreflang is for true equivalents, not for forcing symmetry.
5. Sitemaps with language alternates
You can declare hreflang in HTML, in HTTP headers, or in the XML sitemap. You only need one method, and for a site with a blog, the sitemap is often the easiest to keep consistent because it is generated in one place.
The format uses the xhtml namespace:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>https://www.example-school.com/about</loc> <xhtml:link rel="alternate" hreflang="en" href="https://www.example-school.com/about"/> <xhtml:link rel="alternate" hreflang="es" href="https://www.example-school.com/es/sobre-nosotros"/> <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example-school.com/about"/> </url> <url> <loc>https://www.example-school.com/es/sobre-nosotros</loc> <xhtml:link rel="alternate" hreflang="en" href="https://www.example-school.com/about"/> <xhtml:link rel="alternate" hreflang="es" href="https://www.example-school.com/es/sobre-nosotros"/> <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example-school.com/about"/> </url> </urlset> Each language URL gets its own <url> entry, and each entry repeats the full set of alternates. In recent Next.js versions, app/sitemap.ts supports an alternates.languages field per entry, so you can reuse the same route table:
// app/sitemap.ts import type { MetadataRoute } from "next"; import { ROUTES } from "@/i18n/slugs"; const SITE = "https://www.example-school.com"; export default function sitemap(): MetadataRoute.Sitemap { return Object.values(ROUTES).flatMap((r) => (["en", "es"] as const).map((locale) => ({ url: `${SITE}${r[locale]}`, lastModified: new Date(), alternates: { languages: { en: `${SITE}${r.en}`, es: `${SITE}${r.es}` }, }, })) ); } Two practical notes. First, set lastModified from real content timestamps, not new Date() on every build, or the field becomes noise. Second, if you emit hreflang in both HTML and the sitemap, they must agree. Conflicting signals are worse than one clean source.
6. A language switcher that respects people
The switcher is where i18n meets UX, and the most common mistakes are small.
Use language names in their own language. "English" and "Español", not "EN/ES" and definitely not flags. Flags represent countries, not languages. A Mexican-American parent in Texas should not have to decide whether they identify with a Spanish or Mexican flag to read a page.
Link to the equivalent page, not the homepage. If someone is reading the Spanish course page and clicks "English", they should land on the English course page. Your route table already knows the mapping. If no equivalent exists, link to the other language's closest parent (blog index, for example) and say so.
Make it a link, not a JavaScript toggle. A real <a href> is crawlable, works without JS, can be opened in a new tab, and is announced correctly by assistive tech.
// components/LanguageSwitcher.tsx import Link from "next/link"; export function LanguageSwitcher({ current, enHref, esHref, }: { current: "en" | "es"; enHref: string; esHref: string; }) { return ( <nav aria-label={current === "es" ? "Idioma" : "Language"}> <ul className="lang-switcher"> <li> <Link href={enHref} hrefLang="en" lang="en" aria-current={current === "en" ? "true" : undefined}> English </Link> </li> <li> <Link href={esHref} hrefLang="es" lang="es" aria-current={current === "es" ? "true" : undefined}> Español </Link> </li> </ul> </nav> ); } Suggest, do not force. If a visitor's browser prefers Spanish but they landed on an English page, show a dismissible banner ("¿Prefiere ver esta página en español?") and remember the dismissal. Do not redirect; they may be bilingual and chose English on purpose. Storing a cookie after someone clicks "Español" is fine for internal links, but never use it to change what a given URL serves.
7. Content parity is a product decision
Machine translation has gotten good enough that it is tempting to auto-generate the Spanish site. For a school, that is risky. Program terms, schedule details, and anything a prospective student will rely on to make a decision need a fluent human review. Spanish speakers in the US also vary in vocabulary; a phrase that reads naturally to someone from Monterrey may sound stiff to someone from El Salvador. Aim for clear, neutral Latin American Spanish unless you know your audience precisely.
Some practical rules:
- Keep official agency names in their official form, with a Spanish explanation next to them.
- Make untranslated UI strings fail loudly in development instead of silently falling back to English.
- Give translators context. "Enroll" as a button label and "enroll" in a paragraph may need different Spanish words.
8. Structured data, per language
Structured data helps search engines understand what an entity is. For a school you will typically describe the organization and its courses. Keep the organization's @id identical across languages so both versions refer to the same entity, and translate only human-readable fields.
Here is an English-page example. Apart from the school name and URL, the values are placeholders.
<script type="application/ld+json"> { "@context": "https://schema.org", "@graph": [ { "@type": "EducationalOrganization", "@id": "https://brilliantdentalassisting.com/#organization", "name": "Brilliant Dental Assisting School", "url": "https://brilliantdentalassisting.com/", "logo": "https://www.example.com/placeholder-logo.png", "address": { "@type": "PostalAddress", "streetAddress": "123 Placeholder St", "addressLocality": "Dallas", "addressRegion": "TX", "postalCode": "00000", "addressCountry": "US" }, "telephone": "+1-000-000-0000" }, { "@type": "Course", "@id": "https://www.example-school.com/courses/example-program#course", "name": "Example Certificate Program", "description": "Placeholder description of the course in English.", "inLanguage": "en", "provider": { "@id": "https://brilliantdentalassisting.com/#organization" } } ] } </script> On the Spanish course page, the Course node gets a Spanish name, description, and "inLanguage": "es", plus its own @id based on the Spanish URL. The provider reference stays the same.
A few cautions:
- Markup must match visible content. If the page does not say it, the JSON-LD should not either.
- Do not encode claims you cannot back up. If you are unsure whether a property means "accredited," "approved," or "licensed," leave it out. Precision in wording matters for schools.
- Rich result eligibility changes. Google retired several structured data features in 2025, including Course Info, and narrowed FAQ rich results back in 2023. Valid markup can still help with entity understanding, but do not build a roadmap around a specific SERP feature. Check the current Search Gallery before you promise anyone a visual result.
9. Accessible forms in two languages
For a school, the contact or interest form is the most important interactive element on the site. It is also where bilingual sites most often break.
<form action="/api/interest" method="post" novalidate> <div> <label for="name">Nombre completo</label> <input id="name" name="name" type="text" autocomplete="name" required aria-describedby="name-error" /> <p id="name-error" class="error" role="alert" hidden>Escribe tu nombre.</p> </div> <div> <label for="phone">Teléfono</label> <input id="phone" name="phone" type="tel" autocomplete="tel" inputmode="tel" required aria-describedby="phone-hint phone-error" /> <p id="phone-hint" class="hint">Te llamaremos o enviaremos un mensaje.</p> <p id="phone-error" class="error" role="alert" hidden>Escribe un número de teléfono válido.</p> </div> <fieldset> <legend>¿En qué idioma prefieres tus clases?</legend> <label><input type="radio" name="class_lang" value="en" /> <span lang="en">English</span></label> <label><input type="radio" name="class_lang" value="es" /> Español</label> </fieldset> <input type="hidden" name="page_locale" value="es" /> <button type="submit">Enviar</button> </form> What matters here:
- Every input has a visible
<label>. Placeholders disappear on focus and are not a substitute. - Error messages are in the page's language. Native browser validation messages follow the browser's language, not your page's, which is one reason to use
novalidateand render your own errors. Connect them witharia-describedby. - Use
autocompletetokens. They save typing on phones and help people with motor or cognitive disabilities. The tokens themselves (name,tel,email) are language-neutral. - Group radio buttons in a
fieldsetwith alegend. Screen readers announce the question along with each option. - Send the page locale with the submission. Whoever follows up should know which language the person was using. Asking class language separately also helps, because a person might browse in English for a relative who prefers Spanish.
- Translate the confirmation and the email that follows. A Spanish form that triggers an English-only autoresponder feels like a bait and switch.
Test with a keyboard only, then with a screen reader. VoiceOver on iOS and TalkBack on Android are both free and are much closer to how many of your visitors browse than a desktop audit.
10. Core Web Vitals on image-heavy pages
School sites lean on photos: classrooms, labs, equipment, people in scrubs. Those photos are often uploaded straight from a phone at full resolution. The usual results are a slow Largest Contentful Paint and layout shift as images load.
Google's Core Web Vitals currently are LCP (loa...