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: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/578>
This commit is contained in:
Maximiliano Sandoval 2026-01-23 14:52:05 +01:00 • committed by Marge Bot
parent 536b106f84
commit d922a033ec

View file

@ -191,13 +191,8 @@ mod imp {
let mut new_path = path.clone(); let mut new_path = path.clone();
let mut new_filename = basename.to_os_string(); let mut new_filename = basename.to_os_string();
if i == 1 { // Translators: Filename suffix, {} is replaced by a number
// Translators: Filename suffix new_filename.push(ngettext(" (Edited)", " (Edited {})", i));
new_filename.push(gettext(" (Edited)"));
} else {
// Translators: Filename suffix, {} is replaced by a number
new_filename.push(ngettext(" (Edited)", " (Edited {})", i));
}
if let Some(ext) = path.extension() { if let Some(ext) = path.extension() {
new_filename.push("."); new_filename.push(".");