Select's default placeholder, the clear, close, remove and unpin tooltips, the completion menu's empty line and the size sample showed English under zh-CN. A source test now fails on any fixed English literal in them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
45 lines
1.5 KiB
Rust
45 lines
1.5 KiB
Rust
//! Components Ely ships say nothing in fixed English.
|
|
|
|
/// Sources of components the Ely apps draw.
|
|
const SHIPPED: &[(&str, &str)] = &[
|
|
("editor/find.rs", include_str!("../../editor/find.rs")),
|
|
("editor/hints.rs", include_str!("../../editor/hints.rs")),
|
|
("forms/input.rs", include_str!("../../forms/input.rs")),
|
|
("forms/select.rs", include_str!("../../forms/select.rs")),
|
|
(
|
|
"tables/builders.rs",
|
|
include_str!("../../tables/builders.rs"),
|
|
),
|
|
(
|
|
"navigation/editor_tabs.rs",
|
|
include_str!("../../navigation/editor_tabs.rs"),
|
|
),
|
|
(
|
|
"settings/appearance.rs",
|
|
include_str!("../../settings/appearance.rs"),
|
|
),
|
|
];
|
|
|
|
#[test]
|
|
fn shipped_components_show_no_fixed_english() {
|
|
let shown = [".tooltip(\"", ".child(\"", "SharedString::from(\""];
|
|
let mut found = Vec::new();
|
|
for (path, source) in SHIPPED {
|
|
let code = source.split("#[cfg(test)]").next().unwrap_or(source);
|
|
for (no, line) in code.lines().enumerate() {
|
|
for call in shown {
|
|
let Some(at) = line.find(call) else { continue };
|
|
let rest = &line[at + call.len()..];
|
|
if rest.starts_with(|ch: char| ch.is_ascii_alphabetic()) {
|
|
found.push(format!("{path}:{}: {}", no + 1, line.trim()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
assert!(
|
|
found.is_empty(),
|
|
"English outside the catalog:\n{}",
|
|
found.join("\n")
|
|
);
|
|
}
|