Site: the Android button's texts reach the page; platform links show the download heading
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run

The page script gets only the texts listed in CLIENT_KEYS; the Android ones were missing,
so a phone saw "btn_android". A test now checks every text the script uses. A link to a
platform (Android, Linux…) scrolls to the start of the download section instead of the
panel under its tabs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-22 22:20:26 +03:00
parent ba00887cc2
commit 356384b13e
2 changed files with 22 additions and 1 deletions

View file

@ -74,6 +74,11 @@ const CLIENT_KEYS: &[&str] = &[
"copied",
"lb_count",
"meta_title",
"btn_android",
"and_full_title",
"and_requires",
"and_alpha",
"next_android",
];
pub struct Site {
@ -388,4 +393,18 @@ mod tests {
assert_eq!(date("2026-10-19T06:54:58Z", "es"), "19 de octubre de 2026");
assert_eq!(date("bad", "en"), "");
}
/// Every text the page script asks for is sent to it: a key left out shows as
/// itself ("btn_android") on the page.
#[test]
fn the_script_gets_every_text_it_uses() {
let script = include_str!("../../static/js/site.js");
let en: HashMap<String, String> =
serde_json::from_str(include_str!("../../site/i18n/en.json")).expect("en.json");
let quoted = script.split('"').skip(1).step_by(2);
let missing: Vec<&str> = quoted
.filter(|k| en.contains_key(*k) && !CLIENT_KEYS.contains(k))
.collect();
assert!(missing.is_empty(), "not in CLIENT_KEYS: {missing:?}");
}
}