Добавить постоянную локализацию RU и EN

This commit is contained in:
2026-08-18 16:25:46 +03:00
parent 00323d7916
commit dcb16ef4d0
7 changed files with 721 additions and 58 deletions
+59
View File
@@ -0,0 +1,59 @@
# Stage 3 RU/EN localization QA
Date: 2026-08-18
Scope: persistent, explicit English/Russian language selection for the Canvas UI.
## Delivered contract
- English is the default for missing, null, or unknown stored language codes.
- The Settings screen exposes a dedicated English/Russian switch without moving the
existing control-size, opacity, vibration, or Back touch targets.
- The selected language is stored separately from progress and control preferences
and is restored when `MainActivity` is recreated.
- `GameStrings` owns all player-facing copy: level select, settings, HUD, respawn,
pause, completion, buttons, statistics, ten level titles and hints.
- Result-flow and onboarding copy has typed RU/EN hooks ready for the other Stage 3
slices; new Canvas code does not need language conditionals.
- Long localized hints, card titles, and best-result summaries are fitted to their
existing Canvas bounds. Gameplay geometry and Android `minSdk 23` are unchanged.
- Automation exposes current/set/toggle language and a read-only snapshot of the
localized copy rendered by the current screen.
## TDD evidence
1. RED: the fallback test failed compilation with seven missing `GameLanguage` /
`GameStrings` symbols. GREEN: English default and safe unknown/null fallback.
2. RED: the complete Russian-pack test failed compilation with ten missing copy
methods. GREEN: complete RU pack, ten titles/hints, statistics, plural forms,
result hooks, and onboarding hooks.
3. RED: the persistence device test failed compilation with four missing GameView
language hooks. GREEN: Settings toggle plus a dedicated preference store.
4. RED: the integrated acceptance extension failed compilation with three missing
setter/snapshot hooks. GREEN: explicit language setter and current-screen copy
snapshot.
## Automated checks
| Gate | Result |
| --- | --- |
| `testDebugUnitTest` | GREEN, 22/22 JVM tests |
| `lintDebug` | GREEN |
| `assembleDebug` | GREEN |
| `compileDebugAndroidTestJavaWithJavac` | GREEN, including `GameLanguagePersistenceTest` |
| Canvas raw-copy audit | GREEN; only language-neutral `II` and numeric formats remain in draw calls |
`GameLanguagePersistenceTest` is compiled here but intentionally not executed in
this isolated stream because emulator ownership belongs to final Stage 3 integration.
It performs real Settings taps and verifies Russian visible-copy snapshot, Activity
recreation, progress, control size, opacity, and vibration preservation.
## Integration notes
- `GameView.java` will conflict with accessibility/onboarding/result branches. Keep
their UI behavior and route every new visible string through the existing
`GameStrings` result/onboarding hooks.
- `ControlSettings.java` is not modified; localized preset labels are derived from
its stable package-visible preset indexes.
- `LevelCatalog.java` and level geometry are not modified. Canvas rendering now uses
`GameStrings.levelTitle/levelHint`; the existing English fields remain compatible
with gameplay tests and older callers.