/pf-code-review:pf-i18n-auditfrom pf-code-review
Audits PatternFly React code for i18n readiness: hardcoded strings, concatenation anti-patterns, locale-dependent formatting, and RTL-unsafe CSS. Use when reviewing code for global deployment.
Ships in pf-code-review. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Audit PatternFly React components for internationalization readiness. All Red Hat products ship globally — OpenShift, HCC, and Ansible all require comprehensive i18n. This skill finds hardcoded strings, unsafe formatting, and RTL layout issues before they become translation bugs.
If PatternFly documentation tools are available, use them to verify component text props and layout behavior before flagging. Without documentation available, rely on the anti-pattern rules and tables in this skill.
The user provides a directory, file path, or set of components to audit. Default to the current working directory. Limit scope to .tsx, .jsx, .ts, and .css/.scss files.
Flag string literals rendered in UI components that should be externalized for translation.
Flag these:
Title, Content, Alert title, EmptyState titleText, Label, Badge, Tooltip content, Button children, FormGroup label, HelperText<h1>, <p>, <span>, <label>, <th>, <td>`Welcome, ${name}`Do not flag (developer-facing strings):
console.error, console.warndata-testid valuesFlag string construction patterns that break in languages with different word order.
| Pattern | Problem | Fix |
|---|---|---|
"Hello " + name + "!" | Word order varies by language | Use ICU MessageFormat: t('greeting', { name }) |
`${count} items found` | Pluralization rules differ (Arabic has 6 forms) | Use plural-aware formatter: t('items_found', { count }) |
"Created on " + date | Date position varies by locale | Use a single translation key with placeholder |
label + ": " + value | Colon, spacing, and order vary | Use a single key: t('label_value', { label, value }) |
Flag direct use of locale-sensitive APIs without i18n formatters.
| What | Anti-pattern | i18n-safe alternative |
|---|---|---|
| Dates | new Date().toLocaleDateString() without locale arg, .toISOString() for display, manual MM/DD/YYYY formatting | Intl.DateTimeFormat or library (date-fns with locale) |
| Numbers | .toFixed(2) for currency, manual comma insertion, Number.toString() for display | Intl.NumberFormat with currency/unit options |
| Currency | "$" + amount, hardcoded currency symbol | Intl.NumberFormat with style: 'currency' |
| Lists | items.join(", ") | Intl.ListFormat |
| Relative time | "5 minutes ago", manual time-ago strings | Intl.RelativeTimeFormat |
Flag CSS that uses physical (LTR-biased) properties instead of logical equivalents. PF design tokens handle RTL internally — only flag custom CSS.
| Physical (flag) | Logical (correct) |
|---|---|
margin-left / margin-right | margin-inline-start / margin-inline-end |
padding-left / padding-right | padding-inline-start / padding-inline-end |
text-align: left / right | text-align: start / end |
float: left / right | float: inline-start / inline-end |
left / right (positioning) | inset-inline-start / inset-inline-end |
border-left / border-right | border-inline-start / border-inline-end |
Do not flag:
margin-top, padding-bottom) — these are unaffected by RTLvar(--pf-t--global--spacer--md)) — tokens handle RTL internallytransform: translateX() when used for animations, not layout positioningCheck for signs that the project has no i18n setup:
i18next, react-intl, react-i18next, or equivalent in package.json*.json in locales/, translations/, i18n/)t(), formatMessage(), or <Trans> usage anywhere in the codebaseIf no i18n infrastructure exists, report it as a top-level finding rather than flagging every individual string.
Intl.* APIs are acceptable alternatives to full i18n libraries for formatting## i18n Audit: [directory or component]
### Infrastructure
[i18n framework detected / not detected — with setup recommendation if missing]
### Hardcoded Strings
| File | Line | String | Context | Recommendation |
|------|------|--------|---------|---------------|
| UserList.tsx | 23 | "No users found" | EmptyState titleText | Externalize to translation key |
### Concatenation Anti-patterns
| File | Line | Pattern | Fix |
|------|------|---------|-----|
| Dashboard.tsx | 45 | `` `${count} items` `` | Use plural-aware: `t('item_count', { count })` |
### Locale-dependent Formatting
| File | Line | API | Fix |
|------|------|-----|-----|
| OrderTable.tsx | 67 | `"$" + price` | `Intl.NumberFormat` with `style: 'currency'` |
### RTL-unsafe CSS
| File | Line | Property | Fix |
|------|------|----------|-----|
| sidebar.scss | 12 | `padding-left: 16px` | `padding-inline-start: 16px` |
### Summary
Strings: [N] hardcoded | Concatenation: [N] anti-patterns | Formatting: [N] issues | RTL: [N] unsafe
Do not fabricate file paths or line numbers — read the actual source files before reporting.
eval/cases/all-i18n-ready/I18nReady.tsx (opens in a new tab)eval/cases/all-i18n-ready/annotations.yaml (opens in a new tab)eval/cases/all-i18n-ready/input.yaml (opens in a new tab)eval/cases/concatenation-antipattern/Dashboard.tsx (opens in a new tab)eval/cases/concatenation-antipattern/annotations.yaml (opens in a new tab)eval/cases/concatenation-antipattern/input.yaml (opens in a new tab)eval/cases/hardcoded-strings/UserList.tsx (opens in a new tab)eval/cases/hardcoded-strings/annotations.yaml (opens in a new tab)eval/cases/hardcoded-strings/input.yaml (opens in a new tab)eval/cases/rtl-unsafe-css/annotations.yaml (opens in a new tab)eval/cases/rtl-unsafe-css/input.yaml (opens in a new tab)eval/cases/rtl-unsafe-css/sidebar.scss (opens in a new tab)eval/eval.yaml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
patternfly, internationalization, i18n-audit, react, globalization
npx claudepluginhub rh-uxd/ai-helpers --plugin pf-code-review5 skills in this plugin
/pf-adversarial-reviewReview PatternFly React components for unhandled edge cases and missing defensive code. Use when auditing components for production readiness or stress-testing before a release./pf-reviewRun all PatternFly compliance checks on a project — imports, components, colors, legacy CSS, and security. Use when auditing PF code, before merging PRs, or for comprehensive compliance review./pf-security-scanScan PatternFly React code for security anti-patterns — XSS via dangerouslySetInnerHTML, unsanitized user input in tooltips/labels, and insecure href patterns. Use when reviewing PF code for security vulnerabilities or auditing user-controlled content in PF components./pf-state-auditAudit PatternFly React components for missing UI states — loading, error, empty, and unauthorized. Use when reviewing data-dependent components or auditing a page for production readiness.Other plugins' skills for the same job