I localized my website to make it more useful to people in different languages—and easier for search engines and AI systems to find and understand. The goal is better discoverability through SEO and GEO, not a promise of higher rankings or citations.
Why I localized it
People search and ask questions in their own languages. Offering clear, relevant pages in those languages gives search engines more useful content to surface and gives generative AI systems better context when answering questions. Localization helps the right audience find my work instead of limiting it to English-language searches.
How I did it
I treated localization as part of the site structure, not just a translation pass. The examples below are simplified excerpts from the setup I use with Next.js.
1. Give each language a predictable URL
English is the default language and stays at the root. The other languages get a prefix, so the same page has a stable URL in each locale. Keeping the supported locales in one list also gives routing and language links a shared source of truth.
export const locales = ['en', 'de', 'es', 'fr', 'ja', 'pt'] as const;
export type Locale = (typeof locales)[number];
export const defaultLocale: Locale = 'en';
export function localizedPath(locale: Locale, pathname = '') {
const path = pathname === '/' ? '' : pathname;
return locale === defaultLocale ? path || '/' : `/${locale}${path}`;
}2. Keep translated content in dictionaries
Each locale has its own dictionary for page titles, descriptions, navigation, and article copy. Components read from the active dictionary instead of embedding user-facing text, so translated pages stay aligned with the same layout.
// src/locales/de.ts
pageTitles: {
'blog/how-and-why-i-localized-my-website':
'Warum und wie ich meine Website lokalisiert habe',
}
// In the page component
const title = t.pageTitles[articleKey];3. Tell crawlers which version is which
For each localized page, I set its own canonical URL and list the equivalent language URLs with hreflang alternates. I also include these routes in the sitemap. This makes the relationships between translations explicit; it does not guarantee rankings or AI citations.
const pathname = `/${articleKey}`;
const url = localizedUrl(locale, pathname);
return {
alternates: {
canonical: url,
languages: getLanguageAlternates(pathname),
},
};The same pattern applies beyond blog posts: localized navigation and page copy make the experience useful to visitors, while consistent URLs and metadata make each version easier to identify. I still need to keep translations accurate and useful—technical SEO can help discovery, but it cannot replace good content.