Skip to content

Commit 9f430e8

Browse files
authored
Merge pull request #18063 from ethereum/intl/pending-dev
i18n: translation pipeline, /videos
2 parents 7e62737 + fe64419 commit 9f430e8

4,180 files changed

Lines changed: 558455 additions & 39 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/fix-sanitizer-bug.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ argument-hint: [--language=CODE] [--issue="description"] [--file=PATH] [--skip-b
66

77
# Fix Sanitizer Bug
88

9-
Iterative workflow for fixing bugs in the post-import translation sanitizer (`src/scripts/i18n/post_import_sanitize.ts`). Follows a test-first approach: triage the issue, write a failing test, implement the fix, verify across languages.
9+
Iterative workflow for fixing bugs in the post-import translation sanitizer (`src/scripts/intl-pipeline/intl-sanitizer.ts`). Follows a test-first approach: triage the issue, write a failing test, implement the fix, verify across languages.
1010

1111
## Context
1212
- Current branch: !`git branch --show-current`
1313
- Arguments: $ARGUMENTS
14-
- Sanitizer: `src/scripts/i18n/post_import_sanitize.ts`
15-
- Test files: `tests/unit/sanitizer/*.spec.ts`
14+
- Sanitizer: `src/scripts/intl-pipeline/intl-sanitizer.ts`
15+
- Test files: `tests/unit/intl-pipeline/sanitizer/*.spec.ts`
1616
- Research docs: `docs/solutions/integration-issues/`
1717

1818
## Phase 0: Gather Context
@@ -100,9 +100,9 @@ Examples: "Gas" → "Sprit" (gasoline) in German, tone inconsistency
100100

101101
### Determine which test file
102102

103-
- Pure function (no English source needed) → `tests/unit/sanitizer/standalone-fixes.spec.ts`
104-
- Needs English comparison → `tests/unit/sanitizer/english-comparison.spec.ts`
105-
- End-to-end through processMarkdownFile/processJsonFile → `tests/unit/sanitizer/integration.spec.ts`
103+
- Pure function (no English source needed) → `tests/unit/intl-pipeline/sanitizer/standalone-fixes.spec.ts`
104+
- Needs English comparison → `tests/unit/intl-pipeline/sanitizer/english-comparison.spec.ts`
105+
- End-to-end through processMarkdownFile/processJsonFile → `tests/unit/intl-pipeline/sanitizer/integration.spec.ts`
106106

107107
### Write the test FIRST
108108

@@ -141,7 +141,7 @@ Add the new function name to the destructured import from `_testOnly` at the top
141141
### Verify test fails
142142

143143
```bash
144-
npx playwright test --project=unit tests/unit/sanitizer/{FILE}.spec.ts
144+
npx playwright test --project=unit tests/unit/intl-pipeline/sanitizer/{FILE}.spec.ts
145145
```
146146

147147
The new test MUST fail (function doesn't exist yet). Existing tests should still pass.
@@ -165,13 +165,13 @@ test.describe("warnNewIssue", () => {
165165
})
166166
```
167167

168-
Use `tests/unit/sanitizer/warnings.spec.ts` for warn-only functions.
168+
Use `tests/unit/intl-pipeline/sanitizer/warnings.spec.ts` for warn-only functions.
169169

170170
## Phase 4: Implement the Fix
171171

172172
### Write the function in the sanitizer
173173

174-
**File:** `src/scripts/i18n/post_import_sanitize.ts`
174+
**File:** `src/scripts/intl-pipeline/intl-sanitizer.ts`
175175

176176
**For fix functions** — follow the established pattern:
177177

@@ -235,7 +235,7 @@ issues.push(...newWarnings)
235235
### Step 1: Unit tests
236236

237237
```bash
238-
npx playwright test --project=unit tests/unit/sanitizer/
238+
npx playwright test --project=unit tests/unit/intl-pipeline/sanitizer/
239239
```
240240

241241
**All tests must pass** — both the new test and all existing 99+ tests.
@@ -253,11 +253,11 @@ Determine which files to test from the PR context (e.g., `gaming/index.md`). The
253253
```bash
254254
# If TARGET_FILES env var is supported:
255255
TARGET_FILES="public/content/translations/{LANGUAGE}/{PAGE_PATH}" \
256-
npx ts-node -O '{"module":"commonjs"}' ./src/scripts/i18n/post_import_sanitize.ts
256+
npx ts-node -O '{"module":"commonjs"}' ./src/scripts/intl-pipeline/intl-sanitizer.ts
257257

258258
# If not, write a quick inline node script that calls processMarkdownFile directly:
259259
node -e '
260-
const { _testOnly } = require("./src/scripts/i18n/post_import_sanitize");
260+
const { _testOnly } = require("./src/scripts/intl-pipeline/intl-sanitizer");
261261
const fs = require("fs");
262262
const file = "public/content/translations/{LANGUAGE}/{PAGE_PATH}";
263263
const content = fs.readFileSync(file, "utf8");
@@ -303,7 +303,7 @@ Test the same page in 2-3 other languages to check for false positives. **NEVER
303303
# Test the same page path in a few other languages
304304
for lang in es tr ja; do
305305
node -e "
306-
const { _testOnly } = require('./src/scripts/i18n/post_import_sanitize');
306+
const { _testOnly } = require('./src/scripts/intl-pipeline/intl-sanitizer');
307307
const fs = require('fs');
308308
const file = 'public/content/translations/$lang/{PAGE_PATH}';
309309
if (!fs.existsSync(file)) { console.log('$lang: file not found, skipping'); process.exit(0); }
@@ -376,31 +376,31 @@ Display to user:
376376
**Tests:** {N} new tests added, {TOTAL} total passing
377377
**Languages verified:** {LANGUAGES_CHECKED}
378378
**Files changed:**
379-
- src/scripts/i18n/post_import_sanitize.ts (fix + export)
380-
- tests/unit/sanitizer/{FILE}.spec.ts (new tests)
379+
- src/scripts/intl-pipeline/intl-sanitizer.ts (fix + export)
380+
- tests/unit/intl-pipeline/sanitizer/{FILE}.spec.ts (new tests)
381381
- docs/solutions/integration-issues/sanitizer-test-research.md (documentation)
382382
```
383383

384384
## Quick Reference
385385

386386
### Run all sanitizer tests
387387
```bash
388-
npx playwright test --project=unit tests/unit/sanitizer/
388+
npx playwright test --project=unit tests/unit/intl-pipeline/sanitizer/
389389
```
390390

391391
### Run sanitizer against a language
392392
```bash
393-
TARGET_LANGUAGES=ja npx ts-node -O '{"module":"commonjs"}' ./src/scripts/i18n/post_import_sanitize.ts
393+
TARGET_LANGUAGES=ja npx ts-node -O '{"module":"commonjs"}' ./src/scripts/intl-pipeline/intl-sanitizer.ts
394394
```
395395

396396
### Key files
397397
| File | Purpose |
398398
|------|---------|
399-
| `src/scripts/i18n/post_import_sanitize.ts` | Sanitizer source (~2100 lines) |
400-
| `tests/unit/sanitizer/standalone-fixes.spec.ts` | Tests for pure functions |
401-
| `tests/unit/sanitizer/english-comparison.spec.ts` | Tests needing English source |
402-
| `tests/unit/sanitizer/warnings.spec.ts` | Tests for warn-only functions |
403-
| `tests/unit/sanitizer/integration.spec.ts` | End-to-end tests |
399+
| `src/scripts/intl-pipeline/intl-sanitizer.ts` | Sanitizer source (~2100 lines) |
400+
| `tests/unit/intl-pipeline/sanitizer/standalone-fixes.spec.ts` | Tests for pure functions |
401+
| `tests/unit/intl-pipeline/sanitizer/english-comparison.spec.ts` | Tests needing English source |
402+
| `tests/unit/intl-pipeline/sanitizer/warnings.spec.ts` | Tests for warn-only functions |
403+
| `tests/unit/intl-pipeline/sanitizer/integration.spec.ts` | End-to-end tests |
404404
| `docs/solutions/integration-issues/sanitizer-test-research.md` | Pattern catalog |
405405

406406
### Code block awareness pattern

0 commit comments

Comments
 (0)