Skip to Content
ReferenceLocalization

Localization

All visitor-facing interface copy lives in src/config/localization/locales/en.locale.ts and is read through i18next. This page records the conventions, what was audited, and what is deliberately left outside the locale file.

Reading copy

WhereUse
Server components, generateMetadata, config modules, plain helpers, and most client codeimport { t } from "@/config/localization"
Rich text (markup inside a sentence)<Trans i18nKey="..." components={{ tag: <Element /> }} /> from react-i18next
Existing useTranslation / <Text t="..."> call sitesUnchanged; they read the same resources

t comes from a standalone i18next instance (translate.ts) that does not import react-i18next, so it is safe in the server layer and gives the server and the client identical strings. The React instance (i18n.ts, loaded by ClientLayout and the Storybook preview) is only needed for <Trans> and useTranslation.

Keys are type-checked: i18next.d.ts types t against EnLocale, so an unknown key or a missing interpolation value fails pnpm type-check.

Writing keys

  • Group by route or feature (page.skill.*, footer.*, resumeDownload.*), never by the English text.
  • Shared pieces that several routes reuse sit at the top level (nav, level, role, error, site).
  • Interpolate with {{name}}. Never join translated fragments; add a whole-sentence key instead (see page.landing.skills.index.resultCount).
  • Plurals use _one / _other and a count option (page.landing.skills.eyebrow).
  • Rich text uses a custom tag name in the string. Avoid HTML void names such as link, br, img: the parser closes them immediately.
  • Lists use arrays read with { returnObjects: true }.

Checks

src/config/localization/localization.test.ts runs with pnpm test:

  • every key referenced as t("..."), i18nKey="..." or t="..." exists in the locale;
  • the locale has no empty values and defines both plural forms together;
  • no .tsx file under src/ has JSX text, or a string literal in a copy-bearing prop (aria-label, placeholder, alt, title, label, text, subtitle, backLabel, description, aria-* text), outside tests, stories, styles and email templates.

If the last check flags a string that is not copy (a technical value), put the value in a named constant instead of loosening the check.

Audit

Migrated to the locale: site facts (name, job title, tagline, location, description, title format), navigation labels, error and global-error pages, footer, theme toggle (name and live-region announcement), hero (title, accessible title, scroll indicator), landing About / Impact / Experience headings and subtitles, skills index (search, sort, group, result count, empty state), experience highlights UI and derived strings, timeline labels, About / Resume / Skill / Experience route headings, metadata titles and descriptions, adjacent-page navigation labels, resume download dialog, and the About summary and body.

Intentionally not localized

ItemWhy
siteConfig.url, hrefs, slugs, ids, data-*, class names, event namesTechnical constants
RESUME_FILE_NAME, API routesFile names and URLs
Technology and product names in tags and skill names (Rails, GraphQL, GSAP, New Relic)Proper nouns
Social link labels (GitHub, LinkedIn)Proper nouns
"en_US" Open Graph locale, lang="en"Describe the one supported locale; change with the first added locale
Numerals as words (countWord) and the month formatEnglish helpers; replace with Intl / per-locale keys when a second locale is added
Analytics event names and error textNot shown to visitors

Structured content (src/content/)

These files are portfolio records, not interface copy. They stay as typed data so ids and programmatic matching keep working. When a second locale is added, move the human-readable fields below into a per-locale content model and keep identifiers and matching terms stable.

FileLocalizeKeep stable
experience.tstitle, company (display), description, highlights, sectionsslug, period dates, website, companyShort as a matching key
skills.tsdescription, group, stackLabels, stackShortLabelskey, stack, type, proficiency, icon, name (product names)
gallery.tsalt, captionsource, photographer credit
resume.tsprogram, date displayemail, website, github, school
about.tsaboutSections titles and bodiesThe summary and body are already in the locale (content.about.*)

experienceHighlights.ts holds the matching terms (rolesMentioning([...])) that tie highlight cards to roles. They are matched against the English role text, so translate them together with experience.ts.