From d922a033ec22930573bb7a07d5f303e0471ff6a7 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Fri, 23 Jan 2026 14:52:05 +0100 Subject: [PATCH] edit_window: Remove i==1 branch for ngettext A message catalog can have at most a single string with a given msgid, in this case having a branch with gettext and another with ngettext would result in two strings with " (Edited)" as their msgid. This can be checked via: $ meson compile loupe-pot INFO: autodetecting backend as ninja INFO: calculating backend command to run: /usr/bin/ninja loupe-pot [0/1] Running external command loupe-pot /usr/bin/xgettext: warning: msgid ' (Edited)' is used without plural and with plural. src/widgets/edit_window.rs:197: Here is the occurrence without plural. src/widgets/edit_window.rs:200: Here is the occurrence with plural. Workaround: If the msgid is a sentence, change the wording of the sentence; otherwise, use contexts for disambiguation. Part-of: --- src/widgets/edit_window.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/widgets/edit_window.rs b/src/widgets/edit_window.rs index d1aa901..f04ac07 100644 --- a/src/widgets/edit_window.rs +++ b/src/widgets/edit_window.rs @@ -191,13 +191,8 @@ mod imp { let mut new_path = path.clone(); let mut new_filename = basename.to_os_string(); - if i == 1 { - // Translators: Filename suffix - new_filename.push(gettext(" (Edited)")); - } else { - // Translators: Filename suffix, {} is replaced by a number - new_filename.push(ngettext(" (Edited)", " (Edited {})", i)); - } + // Translators: Filename suffix, {} is replaced by a number + new_filename.push(ngettext(" (Edited)", " (Edited {})", i)); if let Some(ext) = path.extension() { new_filename.push(".");