mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-09 12:04:09 +00:00
The startup prompt, the Check for Updates result card and the messages the Updater puts in the prompt were English whatever the app's interface language (storytold/wordcraft#5257). `StartupPrompt`, `CheckResultDialog` and `Updater` get `with_translator(Translate)`: a `fn(&str, &[(&str, &str)]) -> String` that gets the English text (the key, as in the craft-i18n catalogs) and its `{name}` values, so translations may reorder them and an app on craft-i18n passes `craft_i18n::fmt(i18n.t(lang, text), args)`. It is called when the card draws, so a language change shows on the next frame. Buttons are looked up in title case and drawn in capitals, so the apps' existing button rows serve. Without a translator nothing changes.