9.1 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 14-translation-polish-testing | 01 | execute | 1 |
|
true |
|
Purpose: Establish automated verification of translation coverage and prepare side-by-side review document for user to audit Polish translations before final polish phase.
Output:
- i18n-coverage.ts script that reports untranslated strings and plural form mismatches
- Vitest configured and running pluralization unit tests
- Side-by-side markdown review file of all 1858 translation keys
<execution_context> @/home/golem/.claude/get-shit-done/workflows/execute-plan.md @/home/golem/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/14-translation-polish-testing/14-CONTEXT.md @.planning/phases/14-translation-polish-testing/14-RESEARCH.md @vue-queststream-app/i18n/i18n.config.ts @vue-queststream-app/package.json Task 1: Install Vitest and create coverage script vue-queststream-app/package.json vue-queststream-app/vitest.config.ts vue-queststream-app/scripts/i18n-coverage.ts 1. Install Vitest as dev dependency: ```bash cd vue-queststream-app && pnpm add -D vitest ```-
Create vitest.config.ts with minimal configuration:
import { defineConfig } from 'vitest/config' export default defineConfig({ test: { include: ['tests/**/*.{test,spec}.ts'], environment: 'node', }, }) -
Add test script to package.json scripts:
"test": "vitest run", "test:watch": "vitest" -
Create scripts/i18n-coverage.ts following RESEARCH.md pattern:
- Load en.json and pl.json using fs.readFileSync
- Define EXCLUSIONS array for intentionally-same strings (QuestStream, XP, PIN, OK, etc.)
- Find keys where EN value === PL value (excluding plurals and exclusions)
- Find plural keys with form count mismatch (EN has 2 forms, PL needs 4)
- Output report with totals and lists
- Exit code 1 if critical issues found (missing in PL, plural mismatch)
- Run with: npx tsx scripts/i18n-coverage.ts
Run
cd vue-queststream-app && npx tsx scripts/i18n-coverage.ts- should output coverage report without error Runcd vue-queststream-app && pnpm test- should find 0 tests initially (vitest configured correctly) Coverage script runs and reports any untranslated strings Vitest is installed and configured package.json has test scripts
-
Create polish-pluralization.test.ts with comprehensive tests:
- Extract the plPluralRule function from i18n.config.ts (copy the logic)
- Test all critical values from RESEARCH.md:
- Zero form (0)
- One form (1, 21, 31, 101)
- Few form (2, 3, 4, 22, 23, 24, 102, 103, 104)
- Many form (0, 5, 10, 11, 12, 13, 14, 15, 19, 20, 25, 100, 105, 111, 112)
- Use describe/it pattern from vitest
- Include test for 3-form strings (where choicesLength < 4)
-
Test structure:
import { describe, it, expect } from 'vitest' // Copy exact pluralization function from i18n.config.ts function plPluralRule(choice: number, choicesLength: number): number { // ... exact implementation } describe('Polish pluralization rules', () => { describe('4-form strings (zero|one|few|many)', () => { const testCases = [ { n: 0, expected: 0, description: 'zero' }, { n: 1, expected: 1, description: 'one' }, // ... all test cases ] testCases.forEach(({ n, expected, description }) => { it(`returns index ${expected} for n=${n} (${description})`, () => { expect(plPluralRule(n, 4)).toBe(expected) }) }) }) describe('3-form fallback strings', () => { it('uses index 2 for "many" when only 3 forms available', () => { expect(plPluralRule(5, 3)).toBe(2) }) }) })
-
Generate 14-TRANSLATION-REVIEW.md with structure:
# Translation Review: QuestStream EN → PL Generated: [date] Total keys: 1858 Potentially untranslated: [count] ## Instructions for Review - Edit Polish values inline where corrections needed - Add context hints where ambiguous - Mark approved translations with ✓ ## Auth & Navigation | English | Polish | Status | |---------|--------|--------| | Login | Zaloguj się | ✓ | | ... | ... | ... | ## Parent Dashboard ... ## Child Dashboard ... ## Pluralization (requires 4 forms) | Key | EN | PL (one|few|many|other) | Status | ... -
Include coverage report summary at the top showing any issues found Check .planning/phases/14-translation-polish-testing/14-TRANSLATION-REVIEW.md exists File should contain all 1858 translation keys in tabular format Plural strings should show expanded forms Review file generated with all translations in side-by-side format Plural strings expanded to show all forms Potentially untranslated strings flagged File ready for user review
-
Run unit tests:
cd vue-queststream-app && pnpm test- All 20+ pluralization tests should pass
-
Check review file:
.planning/phases/14-translation-polish-testing/14-TRANSLATION-REVIEW.md- Should contain 1858 translation entries
- Should be organized by domain
- Plural strings should show all forms
<success_criteria>
- Coverage script identifies untranslated strings (if any)
- Vitest configured and running with 20+ passing tests
- Polish pluralization rules tested comprehensively (0, 1, 2, 5, 11, 21, 22, 100, 101, 105)
- Translation review markdown generated for user audit
- No plural form count mismatches between en.json and pl.json </success_criteria>