Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d37b05e
i18n(ar): translate videos directory
myelinated-wackerow Apr 29, 2026
ff63fd3
i18n(bn): translate videos directory
myelinated-wackerow Apr 29, 2026
643ca23
i18n(cs): translate videos directory
myelinated-wackerow Apr 29, 2026
64905db
i18n(de): translate videos directory
myelinated-wackerow Apr 29, 2026
32c5839
i18n(es): translate videos directory
myelinated-wackerow Apr 29, 2026
ed8cf95
i18n(hi): translate videos directory
myelinated-wackerow Apr 29, 2026
1cfd7c4
i18n(id): translate videos directory
myelinated-wackerow Apr 29, 2026
8a86175
i18n(it): translate videos directory
myelinated-wackerow Apr 29, 2026
6dbf7c4
i18n(ja): translate videos directory
myelinated-wackerow Apr 29, 2026
cb25d4f
i18n(ko): translate videos directory
myelinated-wackerow Apr 29, 2026
68e0a20
i18n(mr): translate videos directory
myelinated-wackerow Apr 29, 2026
2df3ad6
i18n(fr): translate videos directory
myelinated-wackerow Apr 29, 2026
00c7826
i18n: merge dev into intl/pending-dev
wackerow Apr 29, 2026
43069bf
i18n(pl): LLM translation
wackerow Apr 29, 2026
ea0a4a3
i18n(pt-br): LLM translation
wackerow Apr 29, 2026
446d979
i18n(ru): LLM translation
wackerow Apr 29, 2026
9b70d13
i18n(sw): LLM translation
wackerow Apr 29, 2026
9dd15d7
i18n(ta): LLM translation
wackerow Apr 29, 2026
215c64a
i18n(te): LLM translation
wackerow Apr 29, 2026
f5a9586
i18n(tr): LLM translation
wackerow Apr 29, 2026
2fb8c57
i18n(uk): LLM translation
wackerow Apr 29, 2026
90a3970
i18n(ur): LLM translation
wackerow Apr 29, 2026
cb3c288
i18n(vi): LLM translation
wackerow Apr 29, 2026
57b5592
i18n(zh): LLM translation
wackerow Apr 29, 2026
fc607af
i18n(zh-tw): LLM translation
wackerow Apr 29, 2026
6c3fe69
i18n: sanitize translation output
wackerow Apr 29, 2026
858e8e0
i18n: merge tmp-intl/run-0429-0438 into intl/pending-dev
wackerow Apr 29, 2026
eff42fc
patch: update fix-sanitizer-bug reference directories
myelinated-wackerow Apr 29, 2026
aadfda2
fix(intl): videos frontmatter + RTL sanitizer
myelinated-wackerow Apr 29, 2026
5025550
i18n: sanitize translated video frontmatter
myelinated-wackerow Apr 29, 2026
088104d
patch: rm duplicated heading ids
myelinated-wackerow Apr 29, 2026
fe64419
test: update RTL md prompt assertions
myelinated-wackerow Apr 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
44 changes: 22 additions & 22 deletions .claude/commands/fix-sanitizer-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ argument-hint: [--language=CODE] [--issue="description"] [--file=PATH] [--skip-b

# Fix Sanitizer Bug

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.
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.

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

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

### Determine which test file

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

### Write the test FIRST

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

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

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

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

## Phase 4: Implement the Fix

### Write the function in the sanitizer

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

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

Expand Down Expand Up @@ -235,7 +235,7 @@ issues.push(...newWarnings)
### Step 1: Unit tests

```bash
npx playwright test --project=unit tests/unit/sanitizer/
npx playwright test --project=unit tests/unit/intl-pipeline/sanitizer/
```

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

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

## Quick Reference

### Run all sanitizer tests
```bash
npx playwright test --project=unit tests/unit/sanitizer/
npx playwright test --project=unit tests/unit/intl-pipeline/sanitizer/
```

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

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

### Code block awareness pattern
Expand Down
Loading
Loading