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:
parent
536b106f84
commit
d922a033ec
1 changed files with 2 additions and 7 deletions
|
|
@ -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(".");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue