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
| Where | Use |
|---|---|
Server components, generateMetadata, config modules, plain helpers, and most client code | import { t } from "@/config/localization" |
| Rich text (markup inside a sentence) | <Trans i18nKey="..." components={{ tag: <Element /> }} /> from react-i18next |
Existing useTranslation / <Text t="..."> call sites | Unchanged; 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 (seepage.landing.skills.index.resultCount). - Plurals use
_one/_otherand acountoption (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="..."ort="..."exists in the locale; - the locale has no empty values and defines both plural forms together;
- no
.tsxfile undersrc/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
| Item | Why |
|---|---|
siteConfig.url, hrefs, slugs, ids, data-*, class names, event names | Technical constants |
RESUME_FILE_NAME, API routes | File 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 format | English helpers; replace with Intl / per-locale keys when a second locale is added |
| Analytics event names and error text | Not 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.
| File | Localize | Keep stable |
|---|---|---|
experience.ts | title, company (display), description, highlights, sections | slug, period dates, website, companyShort as a matching key |
skills.ts | description, group, stackLabels, stackShortLabels | key, stack, type, proficiency, icon, name (product names) |
gallery.ts | alt, caption | source, photographer credit |
resume.ts | program, date display | email, website, github, school |
about.ts | aboutSections titles and bodies | The 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.