LR-IMP-DRAGDROP: align the pl Lightroom wording and stop the web drop toasting "Added 0"

Review fixes:
- pl "Finish Lightroom catalog import before adding photos" uses "Lightrooma", as the other pl Lightroom strings do
- the web drop's toast counts imported photos, says "Restored n photos from Recently Deleted" (already translated) when it only restored some, and says nothing when it only found duplicates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nathaniel Ledford
2026-10-22 01:58:50 -04:00
co-authored by Claude Opus 5.5
parent 34cfc9cd3b
commit c1e3f20f5b
3 changed files with 16 additions and 4 deletions
+10 -3
View File
@@ -527,10 +527,17 @@ impl WebApp {
let paths = self.originals.take_pending();
if !paths.is_empty() {
match self.app.run("library.import", json!({"paths": paths})) {
// what the import added, not what was submitted (duplicates and unsupported files add nothing)
// what the import did, not what was submitted: duplicates and unsupported files add nothing,
// and a drop that only finds duplicates says nothing (as the desktop import's toast does
// when it shows where they are)
Ok(report) => {
let added = report["imported"].as_array().map_or(0, Vec::len);
self.app.toast(ctx, lightcraft_ui_egui::i18n::dropped_photos_added(added));
let count = |k: &str| report[k].as_array().map_or(0, Vec::len);
let (added, restored) = (count("imported"), count("restored"));
if added > 0 {
self.app.toast(ctx, lightcraft_ui_egui::i18n::dropped_photos_added(added));
} else if restored > 0 {
self.app.toast(ctx, lightcraft_ui_egui::i18n::dropped_photos_restored(restored));
}
}
Err(e) => {
log::warn!("import: {e}");
+1 -1
View File
@@ -2278,5 +2278,5 @@
"Import dropped files without review": "Importuj upuszczone pliki bez przeglądu",
"An import is running": "Import jest w toku",
"An import is running. Drop photos when it has finished": "Import jest w toku. Upuść zdjęcia, gdy się zakończy",
"Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightroom, zanim dodasz zdjęcia"
"Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightrooma, zanim dodasz zdjęcia"
}
+5
View File
@@ -278,6 +278,11 @@ pub fn dropped_photos_added(n: usize) -> String {
tr_format!("Added {n} photo{}", if n == 1 { "" } else { "s" }, n = n)
}
/// The web build's notice for `n` dropped photos that came back from Recently Deleted.
pub fn dropped_photos_restored(n: usize) -> String {
tr_format!("Restored {} photo{} from Recently Deleted", n, if n == 1 { "" } else { "s" })
}
/// The title and text of the message box shown when the desktop app's window can't start
/// (issue #260), in the UI language: the error and, when there is one, the log file to look in.
pub fn startup_failed_message(error: &str, log_file: Option<&str>) -> (String, String) {