mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-07 12:12:47 +00:00
The PDF/A panel reports its own checks, not conformance (#6302)
Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com>
This commit is contained in:
@@ -35,7 +35,10 @@ impl PdfCraftApp {
|
||||
self.pdfa_verify();
|
||||
let left = self.pdfa.issues.as_ref().map_or(0, Vec::len);
|
||||
self.notify(if left == 0 {
|
||||
crate::i18n::fmt(tl!("The document now conforms to {level}; save it to keep the changes"), &[("level", level.label())])
|
||||
crate::i18n::fmt(
|
||||
tl!("PdfCraft's checks now find no problems for {level}. This is not a validator result. Save to keep the changes."),
|
||||
&[("level", level.label())],
|
||||
)
|
||||
} else if left == 1 {
|
||||
crate::i18n::fmt(tl!("Fixed what could be fixed; 1 problem remains"), &[])
|
||||
} else {
|
||||
@@ -91,7 +94,10 @@ pub(crate) fn body(ui: &mut egui::Ui, app: &mut PdfCraftApp, t: &Tokens) -> bool
|
||||
ui.label(egui::RichText::new(tl!("Verify to see what the document needs.")).color(t.text_muted));
|
||||
}
|
||||
Some(v) if v.is_empty() => {
|
||||
ui.label(crate::i18n::fmt(tl!("No problems found: the document conforms to {level}."), &[("level", app.pdfa.level.label())]));
|
||||
ui.label(crate::i18n::fmt(
|
||||
tl!("PdfCraft's checks found no problems for {level}. This is not a validator result."),
|
||||
&[("level", app.pdfa.level.label())],
|
||||
));
|
||||
}
|
||||
Some(v) => {
|
||||
for i in v {
|
||||
@@ -129,3 +135,17 @@ pub(crate) fn body(ui: &mut egui::Ui, app: &mut PdfCraftApp, t: &Tokens) -> bool
|
||||
}
|
||||
close
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod wording_tests {
|
||||
/// The Standards panel reports what PdfCraft's own checks found; only a run of an external
|
||||
/// validator can state the stronger thing, and none is recorded here.
|
||||
#[test]
|
||||
fn no_standards_panel_wording_claims_conformance() {
|
||||
let source = include_str!("standards_ui.rs");
|
||||
// Built in pieces so that this file does not match itself.
|
||||
for phrase in [concat!("conform", "s to"), concat!("now ", "conforms")] {
|
||||
assert!(!source.contains(phrase), "a standards message makes a claim only a validator run can make: {phrase}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user