git clone https://github.com/Intense-Visions/harness-engineering
T=$(mktemp -d) && git clone --depth=1 https://github.com/Intense-Visions/harness-engineering "$T" && mkdir -p ~/.claude/skills && cp -r "$T/agents/skills/claude-code/harness-i18n" ~/.claude/skills/intense-visions-harness-engineering-harness-i18n && rm -rf "$T"
agents/skills/claude-code/harness-i18n/SKILL.mdHarness i18n
Internationalization compliance verification. Detect hardcoded strings, missing translations, locale-sensitive formatting, RTL issues, and concatenation anti-patterns across web, mobile, and backend codebases.
When to Use
- Auditing new or existing codebases for i18n compliance
- Before PR merge to catch i18n regressions
- When
oron_pr
triggers fire and changes touch user-facing stringson_commit - When translation files change (missing keys, untranslated values)
- After adding a new target locale to verify coverage
- When
triggers fire to validate i18n considerationson_review - NOT for setting up translation infrastructure (use harness-i18n-workflow)
- NOT for injecting i18n into brainstorming/planning (use harness-i18n-process)
- NOT for performing translations (use TMS tools or MCP integrations)
- NOT for non-user-facing code (internal logging, debug messages, developer tooling)
Process
Phase 1: DETECT -- Identify i18n Context
-
Read harness configuration. Check
forharness.config.json
block:i18n
-- master toggle (if false or missing, run in discovery mode: detect but do not enforce)i18n.enabled
-- enforcement level (i18n.strictness
,strict
,standard
)permissive
-- BCP 47 code of source language (default:i18n.sourceLocale
)en
-- array of BCP 47 codes for target languagesi18n.targetLocales
--i18n.framework
or specific framework nameauto
-- which platforms to scan (i18n.platforms
,web
,mobile
)backend
-- coverage thresholds and requirementsi18n.coverage
-
Auto-detect project platform(s). Scan project root for:
- Web:
with React/Vue/Svelte/Next/Nuxt deps,package.json
/.tsx
/.jsx
/.vue
files.svelte - Mobile iOS:
,*.xcodeproj
,Podfile
,Package.swift
files.swift - Mobile Android:
/build.gradle
,build.gradle.kts
,AndroidManifest.xml
/.kt
files.java - Mobile Flutter:
withpubspec.yaml
dependency,flutter
files.dart - Backend:
with Express/Fastify/NestJS,package.json
/requirements.txt
,pyproject.toml
,go.mod
/pom.xmlbuild.gradle
- Web:
-
Auto-detect i18n framework. Read framework detection profiles from
. For each profile, check:agents/skills/shared/i18n-knowledge/frameworks/
-- dependencies and devDependencies indetection.package_json_keyspackage.json
-- presence of framework config filesdetection.config_files
-- translation file patternsdetection.file_patterns- Match the first profile that satisfies detection criteria. If none match, record "no i18n framework detected."
-
Locate existing translation files. Search for:
- JSON files in
,locales/
,src/locales/
,public/locales/assets/translations/
and.strings
files (iOS).stringsdict
(Android)res/values*/strings.xml
files (Flutter).arb- PO/POT files (gettext)
- If
is configured, use those paths instead.i18n.translationPaths
- JSON files in
-
Load locale profiles. For each locale in
(or detected from translation files), read the locale profile fromi18n.targetLocales
. This provides: plural rules, text direction, expansion factor, script characteristics, common pitfalls.agents/skills/shared/i18n-knowledge/locales/{locale}.yaml -
Load industry profile. If
is configured, readi18n.industry
for industry-specific rules.agents/skills/shared/i18n-knowledge/industries/{industry}.yaml -
Report detection results before proceeding:
i18n Detection Report ===================== Config: Found (i18n.enabled: true, strictness: standard) Platform(s): web, backend Framework: i18next (detected from package.json) Translation files: public/locales/{en,es,fr}/*.json (3 locales, 4 namespaces) Source locale: en Target locales: es, fr Industry profile: fintech (loaded)
Phase 2: SCAN -- Detect i18n Violations
-
Determine scan scope. Based on detected platforms, select file patterns:
- Web:
and**/*.{tsx,jsx,vue,svelte,html}
(for template literals in rendering code)**/*.{ts,js} - Mobile iOS:
**/*.swift - Mobile Android:
,**/*.{kt,java}**/res/values*/*.xml - Mobile Flutter:
**/*.dart - Backend:
(filtered to HTTP handlers, templates, email services)**/*.{ts,js,py,go,java} - Exclude:
,node_modules
,build
,dist
,.next
,vendor
, test files (unless explicitly included)Pods
- Web:
-
Scan for hardcoded user-facing strings. For each platform, apply these detection rules:
Web (React/Vue/Svelte/vanilla):
String literals in JSX text content (text nodes between tags)I18N-001
String literals in i18n-sensitive props:I18N-002
,title
,placeholder
,alt
,aria-labelaria-description
Template literals with user-facing text in JSX or template expressionsI18N-003- Exclude: CSS class names, data attributes, event names,
prop,key
,id
,data-testid
,className
,style
,type
,role
,htmlFor
, numeric literals, boolean props, import/require pathsref
Mobile iOS (SwiftUI/UIKit):
String literals inI18N-011
,Text()
,Label()
,Alert()
,.navigationTitle()
labels.toolbar
String literals inI18N-012
,UILabel.text
,UIButton.setTitle
messagesUIAlertController- Exclude: SF Symbol names, asset names, notification names, UserDefaults keys
Mobile Android (Compose/Views):
String literals inI18N-021
,Text()
,TextField()
contentButton()
String literals inI18N-022
,setText()
,setTitle()Toast.makeText()- Exclude: Log tags, intent actions, preference keys, layout identifiers
Mobile Flutter:
String literals inI18N-031
,Text()
,TextSpan()
,AppBar(title:)SnackBar(content:)- Exclude: route names, asset paths, key values
Backend:
String literals in HTTP response bodies (I18N-041
,res.json({ message: '...' })
)res.send('...')
String literals in email template content (detected via email service imports)I18N-042
String literals in notification payloadsI18N-043- Exclude: log messages (unless returned to users), internal error codes, header names, route paths
-
Scan for locale-sensitive formatting.
I18N-101
without explicit locale argumentnew Date().toLocaleDateString()I18N-102
,Number.toFixed()
without locale argument.toLocaleString()
Hardcoded currency symbols (I18N-103
,$
, etc.) in string templatesEUR
Hardcoded decimal separators (I18N-104
for decimal,.
for thousands),I18N-105
ornew Intl.DateTimeFormat()
without locale parameter (using implicit browser locale is often a bug)new Intl.NumberFormat()
-
Scan for missing
/lang
attributes.dir
MissingI18N-201
attribute onlang
element<html>
MissingI18N-202
attribute ondir
element (required when any target locale is RTL)<html>
MissingI18N-203
on user-generated content containers (detected via heuristic: elements rendering user input, comments, messages)dir="auto"
HardcodedI18N-204
/left
in CSS or style props instead of logical properties (right
/start
,end
/inline-start
) -- only flagged when RTL locales are in target listinline-end
-
Scan for string concatenation.
String concatenation to build user-facing messages (I18N-301
,"Hello, " + name
used as complete messages)`Welcome ${name}`
ArrayI18N-302
to build sentences or messages.join()
Conditional text assembly (I18N-303
-- hardcoded plural logic)isPlural ? "items" : "item"- Provide framework-specific alternative in the finding (e.g., for i18next:
)t('greeting', { name })
-
Scan translation files for completeness.
Missing keys: keys present in source locale file but absent in target locale fileI18N-401
Untranslated values: values in target locale file identical to source locale (suggesting copy-paste, not translation)I18N-402
Missing plural forms: for each locale, check that all required CLDR plural categories are present. Load plural rules from locale profile (e.g., Arabic requires: zero, one, two, few, many, other).I18N-403
Empty translation values (key exists but value is empty string)I18N-404
Orphan keys: keys in translation files not referenced in source code (requires cross-referencing with source scan)I18N-405
-
Record all findings. Each finding includes:
- File path
- Line number (approximate, from Grep output)
- Violation code (e.g.,
)I18N-001 - Category:
,strings
,formatting
,attributes
,concatenationtranslations - Element or pattern that triggered the finding
- Raw evidence (the matching line of code)
Phase 3: REPORT -- Generate i18n Report
-
Assign severity based on
:i18n.strictness
mode: all violations arestrict
severityerror
mode: hardcoded strings and missing translations arestandard
; formatting and concatenation areerror
; orphan keys and info patterns arewarninfo
mode: missing translations and hardcoded strings arepermissive
; everything else iswarninfo- Discovery mode (unconfigured): all findings are
info
-
Generate summary header:
i18n Report =========== Scanned: 87 source files, 12 translation files Findings: 24 total (8 error, 12 warn, 4 info) Strictness: standard Framework: i18next Platforms: web, backend Locales: en (source), es, fr (targets) -
List findings grouped by category. Each finding follows this format:
I18N-001 [error] Hardcoded string in JSX text content File: src/components/Header.tsx Line: 12 Element: <h1>Welcome to our platform</h1> Category: strings Fix: Wrap in translation: <h1>{t('header.welcome')}</h1>I18N-401 [error] Missing translation key File: public/locales/es/common.json Key: checkout.summary.totalLabel Source: "Total" (en) Category: translations Fix: Add key to es/common.json with Spanish translation -
Provide category summaries with counts and severity breakdown:
Category Breakdown ------------------ Strings: 12 findings (6 error, 4 warn, 2 info) Translations: 6 findings (4 error, 2 warn) Formatting: 3 findings (0 error, 3 warn) Attributes: 2 findings (1 error, 1 warn) Concatenation: 1 finding (0 error, 1 warn) -
Provide translation coverage summary (if translation files exist):
Translation Coverage -------------------- Locale Keys Translated Coverage Missing Plurals en 142 142 100% 0 es 142 128 90.1% 2 fr 142 135 95.1% 0 -
If graph is available (
exists): map findings to components/routes for contextual coverage. Report per-component translation coverage..harness/graph/ -
If graph is unavailable: report per-file key-level coverage. Group findings by source file.
-
List actionable next steps:
- Errors that can be auto-fixed (Phase 4)
- Errors that require human judgment (choosing translation keys, writing translations)
- Warnings to address in next iteration
- Coverage gaps to escalate to translation workflow (harness-i18n-workflow)
Phase 4: FIX -- Apply Automated Remediation (Optional)
This phase is optional. It applies fixes only for mechanical issues -- violations with a single, unambiguous correct fix. Translation content, key naming, and locale-specific formatting choices are never auto-fixed.
-
Fixable violations:
/I18N-001
: Wrap string literals in framework translation call. Detect framework from Phase 1:I18N-002- i18next:
(generate key from string content, dot-notation){t('generated.key')} - react-intl:
<FormattedMessage id="generated.key" defaultMessage="original text" /> - vue-i18n:
{{ $t('generated.key') }} - No framework:
(generic, user picks framework later){t('generated.key')}
- i18next:
: AddI18N-201
tolang="{sourceLocale}"
element<html>
: AddI18N-202
(ordir="ltr"
if RTL locales are targets) todir="auto"
element<html>
: AddI18N-203
to user-content containersdir="auto"
: Flag empty translation values for review (not auto-fillable)I18N-404
-
Apply each fix as a minimal, targeted edit. Use the Edit tool. Do not refactor surrounding code. Do not change formatting. The fix should be the smallest possible change that resolves the violation.
-
Show before/after diff for each fix. Present the exact change to the user. This is a hard gate -- no fix is applied without showing the diff first.
-
Interactive confirmation per fix category. Group fixes by category (string wrapping, attribute addition) and ask for approval per category, not per individual fix:
Fix Category: String Wrapping (12 fixes) ----------------------------------------- Wrap 12 hardcoded strings in t() calls across 5 files. Generated keys follow dot-notation: component.element.description Apply these fixes? [y/n] -
Generate extraction output. For each wrapped string, output the key-value pair that needs to be added to the source locale translation file:
{ "header.welcome": "Welcome to our platform", "checkout.totalLabel": "Total", "auth.loginButton": "Sign in" } -
Re-scan after fixes. Run the scan phase again on fixed files to confirm violations are resolved. Report:
- Fixes applied: N
- Violations resolved: N
- Keys extracted: N (add to source locale file)
- Remaining violations (require human judgment): M
-
Do NOT fix:
- Translation content (requires human translators or TMS)
- Key naming beyond generated defaults (requires project context)
- Locale-sensitive formatting (requires knowing the correct Intl API usage for each case)
- Plural form additions (requires CLDR knowledge + framework-specific syntax)
- Any fix that would change the runtime behavior of the application
Harness Integration
-- i18n findings surface whenharness validate
is true andi18n.enabled
isi18n.strictness
orstrict
. Running validate after a scan reflects the current i18n state.standard
-- The i18n scan is chained into integrity checks whenharness-integrity
. Findings are included in the unified integrity report.i18n.enabled: true
-- Translation coverage is checked againstharness-release-readiness
. Per-locale coverage is reported.i18n.coverage.minimumPercent
-- When both i18n and accessibility skills are enabled,harness-accessibility
/lang
attribute checks are handled by the i18n skill. The accessibility skill defers I18N-201/202/203 to avoid duplicate findings.dir
-- After scanning, coverage gaps and extracted keys can be passed to the workflow skill for scaffolding and translation file updates.harness-i18n-workflow- Knowledge base at
-- Framework profiles, locale profiles, industry profiles, and anti-pattern catalogs are consumed during detect and scan phases.agents/skills/shared/i18n-knowledge/
Success Criteria
- All scanned source files have findings categorized by violation code and severity
- Hardcoded user-facing strings detected with correct platform-specific rules (web, mobile, backend)
- Missing translation keys and untranslated values identified with file paths and key names
- Locale-sensitive formatting issues (dates, numbers, currencies) flagged with specific file and line references
- RTL and
/lang
attribute violations detected when target locales include RTL languagesdir - String concatenation and hardcoded plural logic identified as anti-patterns
- Report generated with violation codes, categories, severity, and actionable remediation
- Automated fixes applied only for mechanical issues (string wrapping, attribute addition) with interactive confirmation
- Translation coverage reported per-locale against configured thresholds
reflects i18n findings at the configured strictness levelharness validate
Examples
Example: Scanning a React + i18next Project
Context: A React web app using i18next with English source, targeting Spanish and French. The
harness.config.json has:
{ "version": 1, "i18n": { "enabled": true, "strictness": "standard", "sourceLocale": "en", "targetLocales": ["es", "fr"], "framework": "auto", "platforms": ["web"] } }
Phase 1: DETECT
i18n Detection Report ===================== Config: Found (i18n.enabled: true, strictness: standard) Platform(s): web Framework: i18next (detected from package.json: "i18next", "react-i18next") Translation files: public/locales/{en,es,fr}/common.json (3 locales, 1 namespace) Source locale: en Target locales: es, fr Industry profile: none configured
Phase 2: SCAN
Source file with violations:
// src/components/CheckoutSummary.tsx export function CheckoutSummary({ items, total }) { return ( <div> <h2>Order Summary</h2> <p> You have {items.length} {items.length === 1 ? 'item' : 'items'} in your cart. </p> <span title="Total price">Total: ${total.toFixed(2)}</span> </div> ); }
Findings:
I18N-001 [error] Hardcoded string in JSX text content File: src/components/CheckoutSummary.tsx Line: 5 Element: <h2>Order Summary</h2> Category: strings Fix: Wrap in translation: <h2>{t('checkout.orderSummary')}</h2> I18N-002 [error] Hardcoded string in i18n-sensitive prop File: src/components/CheckoutSummary.tsx Line: 9 Element: title="Total price" Category: strings Fix: Wrap in translation: title={t('checkout.totalPriceTitle')} I18N-303 [warn] Conditional text assembly (hardcoded plural logic) File: src/components/CheckoutSummary.tsx Line: 7 Element: items.length === 1 ? "item" : "items" Category: concatenation Fix: Use i18next plural: t('checkout.itemCount', { count: items.length }) I18N-103 [warn] Hardcoded currency symbol File: src/components/CheckoutSummary.tsx Line: 10 Element: $${total.toFixed(2)} Category: formatting Fix: Use Intl.NumberFormat: new Intl.NumberFormat(locale, { style: 'currency', currency }).format(total) I18N-102 [warn] Number.toFixed() without locale-aware formatting File: src/components/CheckoutSummary.tsx Line: 10 Element: total.toFixed(2) Category: formatting Fix: Use Intl.NumberFormat for locale-aware decimal formatting
Translation file issue:
I18N-401 [error] Missing translation key File: public/locales/es/common.json Key: checkout.confirmButton Source: "Confirm Order" (en) Category: translations Fix: Add key to es/common.json with Spanish translation I18N-402 [warn] Untranslated value (identical to source) File: public/locales/fr/common.json Key: auth.welcomeMessage Source: "Welcome back" (en) Value: "Welcome back" (fr -- same as source, likely untranslated) Category: translations Fix: Translate value to French or mark as intentionally identical
Phase 3: REPORT
i18n Report =========== Scanned: 23 source files, 6 translation files Findings: 7 total (3 error, 3 warn, 1 info) Strictness: standard Framework: i18next Platforms: web Locales: en (source), es, fr (targets) Category Breakdown ------------------ Strings: 2 findings (2 error, 0 warn) Translations: 2 findings (1 error, 1 warn) Formatting: 2 findings (0 error, 2 warn) Concatenation: 1 finding (0 error, 1 warn) Translation Coverage -------------------- Locale Keys Translated Coverage Missing Plurals en 42 42 100% 0 es 42 41 97.6% 0 fr 42 42 100% 0 (note: fr has 1 untranslated value not counted as missing)
Phase 4: FIX
Fix Category: String Wrapping (2 fixes) ----------------------------------------- Wrap 2 hardcoded strings in t() calls in CheckoutSummary.tsx. Generated keys: checkout.orderSummary, checkout.totalPriceTitle Apply these fixes? [y/n]
After applying fixes:
- <h2>Order Summary</h2> + <h2>{t('checkout.orderSummary')}</h2> - <span title="Total price"> + <span title={t('checkout.totalPriceTitle')}>
Keys extracted for source locale file:
{ "checkout.orderSummary": "Order Summary", "checkout.totalPriceTitle": "Total price" }
Remaining violations (require human judgment): 5
- I18N-303: Plural logic -- requires choosing i18next plural key structure
- I18N-103: Currency symbol -- requires knowing the correct currency code per locale
- I18N-102: Number formatting -- requires choosing Intl.NumberFormat options
- I18N-401: Missing key in es -- requires Spanish translation
- I18N-402: Untranslated value in fr -- requires French translation
Rationalizations to Reject
| Rationalization | Reality |
|---|---|
| "This string is the app's brand name — it's technically hardcoded but obviously shouldn't be translated. I'll skip flagging it." | Brand names require explicit suppression via comment, not silent omission from the scan. Skipping without suppression means future scans have inconsistent results and the team has no record of the deliberate decision. |
| "The framework isn't in the knowledge base, but I can tell from context it's using i18next patterns — I'll apply i18next rules directly." | Unrecognized frameworks must fall back to generic detection rules, not assumed framework rules. Applying i18next-specific fix patterns to an unknown framework produces incorrect wrapping that breaks at runtime. Log the gap and use generic rules. |
"The project has — I'll still flag errors for hardcoded strings since the team should know about them." | Respecting is a gate. The team made a configuration decision. In that state, run in discovery mode (info severity only). Escalating to errors overrides the team's explicit choice. |
| "I18N-402 untranslated values are just warnings — I'll skip reporting them to keep the report shorter." | Untranslated values (target identical to source) are a distinct violation category with their own code. They indicate copy-paste during file creation without actual translation. Omitting them produces a misleadingly optimistic coverage report. |
| "The plural rules for this locale look complex — I'll just check for 'one' and 'other' forms like English and move on." | Plural rules are locale-specific and must be loaded from the locale profile. Arabic requires six categories; Polish requires four. Checking only English plural categories produces false-passing results for languages that require more forms. |
Gates
These are hard stops. Violating any gate means the process has broken down.
- No scan results without completing the detect phase first. Framework and platform detection must run before scanning begins.
- No fix applied without showing the before/after diff. Every fix must be presented to the user with the exact code change before being written to disk.
- No severity downgrade below what
specifies. If the project is ini18n.strictness
mode, a hardcoded string is an error. The scanner does not get to decide it is a warning.strict - No translation content generated by the fix phase. The fix phase wraps strings and adds attributes. It does not write translations. Translation content is the domain of humans or TMS tools.
- No false-positive suppression without explicit user confirmation. If a string is intentionally not translated (e.g., brand name), the user must mark it with a suppression comment (
) before it is excluded from future scans.// i18n-ignore
Escalation
- When a project has more than 100 hardcoded strings: suggest running harness-i18n-workflow for bulk extraction and scaffolding rather than fixing one by one.
- When no i18n framework is detected: recommend one based on the project platform (i18next for React/Node, vue-i18n for Vue, flutter intl for Flutter, etc.). Reference the framework profiles in the knowledge base.
- When translation coverage is below 50%: suggest a phased approach -- prioritize user-facing flows (checkout, onboarding, error messages) before attempting full coverage.
- When target locales include RTL languages (ar, he) and the project has no RTL support: flag this as a high-priority architectural concern. RTL support often requires layout changes beyond simple attribute additions.
- When the project uses a framework not in the knowledge base: fall back to generic detection rules. Log: "Framework {name} not in knowledge base -- using generic string detection. Consider contributing a framework profile."