Sleep-timer duration strings (durationHoursMinutesSeconds, durationMinutesSeconds, durationMinutesOnly, durationSecondsOnly) contained literal "?" characters instead of the native hour/minute/second abbreviation in 6 locales. Replaced with correct native short-form units per locale, verified byte-exact against a pinned spec table and against the already-correct neighboring hoursLabel/minutesLabel/secondsLabel values in each file.
51 lines
3.2 KiB
Markdown
51 lines
3.2 KiB
Markdown
# Proposal: Repair corrupted sleep-timer duration abbreviations in 6 ARB locales
|
||
|
||
## Intent
|
||
Six non-Latin-script locales ship literal ASCII `?`/`??`/`???` where the native hour/minute/second abbreviation belongs, in the 4 sleep-timer duration keys. Users on ar/bn/hi/ja/ru/zh see `1 ? 30 ? 0 ?` instead of e.g. `1時間 30分 0秒` in the "Timer de sueño" bottom sheet (`_formatearDuracionTimer`, lib/app.dart:492-512). JSON/ICU stay valid, so CI (`flutter analyze`) never catches it — a silent, user-visible quality defect from a prior non-UTF-8-safe edit. Fix now: the corruption is isolated, verified, and cheap to repair correctly.
|
||
|
||
## Scope
|
||
|
||
### In Scope
|
||
- Repair 24 corrupted strings = 4 keys (`durationHoursMinutesSeconds`, `durationMinutesSeconds`, `durationMinutesOnly`, `durationSecondsOnly`) × 6 files: `app_ar.arb`, `app_bn.arb`, `app_hi.arb`, `app_ja.arb`, `app_ru.arb`, `app_zh.arb` (lines 19/27/34/40 each).
|
||
- Replace each `?` with the genuine native short-form unit abbreviation for that locale, keeping ICU placeholders `{hours}`/`{minutes}`/`{seconds}` intact and correctly named.
|
||
- Static validation only: JSON-parse + UTF-8 byte integrity + grep for residual `?`-adjacent-placeholder.
|
||
|
||
### Out of Scope (future-work notes only)
|
||
- No refactor of `lib/l10n/app_localizations_ext.dart` (hand-maintained date map — latent structural risk, not broken; separate hardening task).
|
||
- No new CI/pre-commit ARB lint (recommended but deferred; separate change).
|
||
- No broader i18n rework, no other keys/locales, no re-formatting of the 386 untouched keys per file.
|
||
|
||
## Capabilities
|
||
|
||
### New Capabilities
|
||
None.
|
||
|
||
### Modified Capabilities
|
||
None — data-only content repair; no requirement/behavior change, no generated-code signature change (ICU shape identical).
|
||
|
||
## Approach
|
||
Per-locale, source the correct native abbreviation from the existing verified full labels already present in each file (`hoursLabel`/`minutesLabel`/`secondsLabel`, lines 16-18) plus locale conventions (ja 時間/分/秒, zh 小时/分/秒, ru ч/мин/с, ar/hi/bn native short forms). Edit only the 4 corrupted lines per file via exact-string replacement; preserve surrounding bytes and UTF-8 encoding. Never run flutter/dart tooling (hangs here).
|
||
|
||
## Affected Areas
|
||
| Area | Impact | Description |
|
||
|------|--------|-------------|
|
||
| `lib/l10n/app_{ar,bn,hi,ja,ru,zh}.arb` | Modified | 4 duration lines each repaired |
|
||
|
||
## Risks
|
||
| Risk | Likelihood | Mitigation |
|
||
|------|------------|------------|
|
||
| Wrong/non-native abbreviation glyph | Med | Anchor to in-file labels + verified references; spec pins exact strings |
|
||
| Re-encoding side effects to untouched keys | Low | Exact-string edits; post-edit UTF-8 + JSON diff check |
|
||
| Generated `app_localizations.dart` drift | Low | ICU shape unchanged; content-only |
|
||
|
||
## Rollback Plan
|
||
Single commit touching only 6 ARB files; `git revert` restores prior state with zero cross-dependencies.
|
||
|
||
## Dependencies
|
||
- Native/reference-verified abbreviation set for ar/bn/hi/ja/ru/zh (resolved in sdd-spec).
|
||
|
||
## Success Criteria
|
||
- [ ] Zero literal `?` remaining in the 24 target strings; placeholders intact.
|
||
- [ ] Each locale renders its native h/min/s abbreviation.
|
||
- [ ] All 6 files parse as valid UTF-8 JSON; 386 other keys per file byte-unchanged.
|