Localize hardcoded engine strings (auto-translation progress, vimeo macro fallback) #93

Closed
opened 2026-07-20 19:44:03 +00:00 by hugo · 1 comment
Owner

Source: Audit section 3. Project rule (AGENTS.md): "no untranslated string constants".

Known offenders:

  • crates/bds-core/src/engine/auto_translation.rs (~line 103/111): progress message "Scanning published posts" hardcoded English.
  • crates/bds-core/src/render/macros.rs render_vimeo (~line 272): empty_block(..., "Missing Vimeo video id.") hardcoded, while render_youtube uses render_translation(context, "render.gallery.empty") correctly.

Task: Sweep bds-core engine + render for user-visible hardcoded English (progress messages passed to task manager, macro fallbacks, toast texts) — grep for " literals flowing into on_progress/toast/empty_block. Route render-side strings through the render gettext domain (locales/render/.ftl, content language) and UI-side progress through the UI localization (locales/ui/.ftl) — note the two localization areas can both apply per AGENTS.md. Add the missing keys for all 5 languages (en/de/fr/it/es).

Acceptance: No user-visible untranslated constants in the touched paths; keys present in all locale files; existing i18n lint/tests (if any) pass.

**Source:** Audit section 3. Project rule (AGENTS.md): "no untranslated string constants". **Known offenders:** - `crates/bds-core/src/engine/auto_translation.rs` (~line 103/111): progress message "Scanning published posts" hardcoded English. - `crates/bds-core/src/render/macros.rs` `render_vimeo` (~line 272): `empty_block(..., "Missing Vimeo video id.")` hardcoded, while `render_youtube` uses `render_translation(context, "render.gallery.empty")` correctly. **Task:** Sweep bds-core engine + render for user-visible hardcoded English (progress messages passed to task manager, macro fallbacks, toast texts) — grep for `"` literals flowing into on_progress/toast/empty_block. Route render-side strings through the render gettext domain (locales/render/*.ftl, content language) and UI-side progress through the UI localization (locales/ui/*.ftl) — note the two localization areas can both apply per AGENTS.md. Add the missing keys for all 5 languages (en/de/fr/it/es). **Acceptance:** No user-visible untranslated constants in the touched paths; keys present in all locale files; existing i18n lint/tests (if any) pass.
hugo added the bug label 2026-07-20 19:44:03 +00:00
Author
Owner

Implemented in 9087096. Replaced hardcoded auto-translation and rebuild progress sentences with typed semantic progress events, localized at the UI/CLI boundary. Added all progress keys in English, German, French, Italian, and Spanish; removed the obsolete generic translation-progress key; and expanded missing-ID YouTube/Vimeo render tests across all five content languages. Neutral review confirmed current bDS2 also renders missing-ID video macros through localized templates, and the Allium split between UI locale and content/render locale is preserved. Verified with cargo test --workspace, cargo build --workspace, strict workspace Clippy, cargo fmt --check, and cargo machete.

Implemented in 9087096. Replaced hardcoded auto-translation and rebuild progress sentences with typed semantic progress events, localized at the UI/CLI boundary. Added all progress keys in English, German, French, Italian, and Spanish; removed the obsolete generic translation-progress key; and expanded missing-ID YouTube/Vimeo render tests across all five content languages. Neutral review confirmed current bDS2 also renders missing-ID video macros through localized templates, and the Allium split between UI locale and content/render locale is preserved. Verified with cargo test --workspace, cargo build --workspace, strict workspace Clippy, cargo fmt --check, and cargo machete.
hugo closed this issue 2026-07-22 17:09:53 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hugo/RuDS#93