GNOME Bugzilla – Bug 628855
Bad strings in folder merge dialog
Last modified: 2010-09-11 22:39:11 UTC
The way to build the secondary message for merge folder dialog[1] is really really bad from a localization point of view. /* Translators: the first string in this printf * is the "An older/A newer/Another" string defined some lines before. */ secondary_text = g_strdup_printf ( _("%s folder with the same name already exists in \"%s\".\n" "Merging will ask for confirmation before " "replacing any files in the folder that " "conflict with the files being copied."), time_str, dest_dir_name); Could we change it ASAP, providind 4 different translatable strings: 1. "An older older with the same name already exists in \"%s\".\n" 2. "An newer folder with the same name already exists in \"%s\".\n" 3. "Another folder with the same name already exists in \"%s\".\n" 4. "Merging will ask for confirmation before replacing any files in the folder that conflict with the files being copied." Same, of course, for the similar message related to files: secondary_text = g_strdup_printf ( _("%s file with the same name already exists in \"%s\".\n" "Replacing it will overwrite its content."), time_str, dest_dir_name); Plus, * dialog title "File conflict"[1] -- it should be "File Conflict", HIG * mnemonics for buttons -- "Merge"[2] "Reset" [3] and "Replace"[4] should have a _ * mnemonic for checkbox -- "Apply this ..." [5] About dialog title, isn't better something like "Confirm File Replacement" ? See also http://mail.gnome.org/archives/nautilus-list/2010-September/msg00000.html and http://mail.gnome.org/archives/gnome-i18n/2010-September/msg00044.html
(Please set appropraite keywords - Thanks!)
For completeness, I also include a follow-up mail by Luca (the remainder of this report is a quote): If we are going to change those strings, could we please consider also: * dialog title "File conflict"[1] -- it should be "File Conflict", HIG * mnemonics for buttons -- "Merge"[2] "Reset" [3] and "Replace"[4] should have a _ * mnemonic for checkbox -- "Apply this ..." [5] About dialog title, isn't better something like "Confirm File Replacement" ? [1] http://git.gnome.org/browse/nautilus/tree/libnautilus-private/nautilus-file-conflict-dialog.c?h=gnome-2-32#n629 [2] http://git.gnome.org/browse/nautilus/tree/libnautilus-private/nautilus-file-conflict-dialog.c?h=gnome-2-32#n311 [3] http://git.gnome.org/browse/nautilus/tree/libnautilus-private/nautilus-file-conflict-dialog.c?h=gnome-2-32#n553 [4] http://git.gnome.org/browse/nautilus/tree/libnautilus-private/nautilus-file-conflict-dialog.c?h=gnome-2-32#n521 [5] http://git.gnome.org/browse/nautilus/tree/libnautilus-private/nautilus-file-conflict-dialog.c?h=gnome-2-32#n533
Fwiw, the get_str_for_mtimes() function seems to be used only once, so while this approach is not correct i18n-wise, translating "a newer" and "an older" as if they were followed by the word "folder" will result in correct strings in many languages. Yet, this should be solved properly.
(In reply to comment #3) > Fwiw, the get_str_for_mtimes() function seems to be used only once, so while > this approach is not correct i18n-wise, translating "a newer" and "an older" as > if they were followed by the word "folder" will result in correct strings in > many languages. I take that back. It is also used for with "file" after it, which makes it impossible to translate correctly in many languages.
Created attachment 169893 [details] [review] Untested patch suggesting a more i18n friendly approach
"by the explanation about merging above.": I'm not sure that the order of the appearance of strings in a po file can be determined.
In practice they do, unless the strings are used more than once in the application, which is not the case here.
Wouter, proposed patch seems i18n-friendly and good for me. Speaking just for Italian language, please note that you have An older folder --> Una cartella più vecchia A newer folder --> Una cartella più nuova So, starting from "An older" "A newer" "%s folder" you could translate them as "più vecchia" "più nuova" "Una cartella %s" and you'll have correct strings (while not correct translations, strictly speaking). But including Another folder --> Un'altra cartella breaks anything. So, original code was really elegant, but i18n prefers copy and paste :D
Review of attachment 169893 [details] [review]: Wouter, thanks for the patch! It looks good except for these two minor comments below. I need to ask gnome-i18n list for an approval request to merge this, right? ::: libnautilus-private/nautilus-file-conflict-dialog.c @@ +103,3 @@ gboolean source_is_dir, dest_is_dir, should_show_type; NautilusFileConflictDialogDetails *details; + char *primary_text, *secondary_text, *secondary_text_extra; secondary_text_extra should be const gchar * @@ +148,3 @@ + "the folder that conflict with the files being copied."); + + if (src_mtime > dest_mtime) Nautilus' code style uses braces for if statements also when it's only one line.
Cosimo, thanks for the feedback. I hardly speak any C though, so my completely untested patch was merely intended as a suggestion. (I also stated this in the patch description.) Happy to see that it's almost ready as-is. :) That said, I currently don't have any Gnome development environment set up at all, so it would take me many hours to actually test my changes, given that I need to compile half of Gnome from scratch in that case. If you could take it from here, that would be really appreciated. Please let me know if I can be of any help.
(In reply to comment #8) > An older folder --> Una cartella più vecchia > A newer folder --> Una cartella più nuova In Dutch these strings are impossible to translate, since "a newer folder" would become "een nieuwere map", and "a newer file" would become "een nieuwer bestand", i.e. "nieuwere" versus "nieuwer" depending on the noun it refers to.
(In reply to comment #9) > I need to ask gnome-i18n list for an approval request to merge this, right? This issue has already come up on the gnome-i18n list: http://mail.gnome.org/archives/gnome-i18n/2010-September/msg00044.html As a coordination team member, I hereby give you my +1 for fixing this.
Created attachment 169972 [details] [review] patch This is an updated patch. I also made it a bit smarter than yours, so that things as '\n%s' do not get included in the translatable strings. I also formally asked i18n for a string freeze break for this patch.
Thanks, Cosimo! > + secondary_text = g_strdup_printf ("%s\n%s", message, message_extra); I intentionally added two newlines, i.e. "%s\n\n%s", because the result would look ugly otherwise (line break at a strange place, depending on the language).
(In reply to comment #16) > I intentionally added two newlines, i.e. "%s\n\n%s", because the result would > look ugly otherwise (line break at a strange place, depending on the language). Hmm, that could be included in the translation for the languages for which it's problematic, no? I committed my patch to master and gnome-2-32. Closing this as FIXED.
It's either a) no newlines at all two create a single paragraph, or b) two newlines to create a new paragraph. Right now there is a newline "somewhere randoml in the middle", which doesn't make sense in any language. Apart from that, thanks for looking into this.