GNOME Bugzilla – Bug 627387
Unexpected msgstr appears in update dialog. (on dlg-update.c)
Last modified: 2010-08-23 11:35:57 UTC
Over view: When Plural Forms definition in .po file is "Plural-Forms: nplurals=1; plural=0;\n" (e.g. ja.po), unexpected string appears on update dialog after one file in an archive has changed. actual string: "別のアプリケーションが書庫にある %d 個のファイルを変更しました。これらのファイルを更新しないと変更内容が全て破棄されます。" expected string: "別のアプリケーションが書庫にある 1 個のファイルを変更しました。これらのファイルを更新しないと変更内容が全て破棄されます。" - Most nouns in Japanese have no plural form according to Japanese language syntax. So, plural forms definition in ja.po is the above one. - This is a bug on i18n, which should be fixed. application should display expected string in any language which has unique plural forms definition. Steps to Reproduce: 1) Run file-roller with command: "LANG=ja_JP.utf-8 file-roller". 2) Open an archive with file-roller. 3) Change and save one file in the archive. Build Date & Platform: Build gnome-2-30 branch of git reposirory in 2010-08-16 on Ubuntu 10.04 - Though I examined the matter on the above branch of git repository, I guess the bug will occur at master branch too. Additional Information: The bug process which I guess is: 1) Plural Forms of ja.po is "Plural-Forms: nplurals=1; plural=0;\n", and the matter of msgid and msgstr in ja.po is : msgid "" "The file has been modified with an external application. If you don't update " "the version in the archive, all of your changes will be lost." msgid_plural "" "There are %d files that have been modified with an external application. If " "you don't update the files in the archive, all of your changes will be lost." msgstr[0] "" "別のアプリケーションが書庫にある %d 個のファイルを変更しました。これらのファ" "イルを更新しないと変更内容が全て破棄されます。" 2) 'label5' (./data/ui/upadte.ui) has above msgid as translatable string. The string is replaced to the above msgstr[0]. Though the msgstr[0] is string with c-format, it is put as nomal string (with non c-format). 3) At the case 'n_files == 1' (./src/dlg-update.c), the string of 'label5' is directly shown without branching by 'ngettext'. To solve it, could you please apply following change: diff --git a/data/ui/update.ui b/data/ui/update.ui index e072894..3043a2f 100644 --- a/data/ui/update.ui +++ b/data/ui/update.ui @@ -52,10 +52,9 @@ </packing> </child> <child> - <object class="GtkLabel" id="label5"> + <object class="GtkLabel" id="update_file_secondary_text_label"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">The file has been modified with an external application. If you don't update the version in the archive, all of your changes will be lost.</property> <property name="wrap">True</property> </object> <packing> diff --git a/src/dlg-update.c b/src/dlg-update.c index 4f280d3..51f301d 100644 --- a/src/dlg-update.c +++ b/src/dlg-update.c @@ -45,6 +45,7 @@ typedef struct { GtkWidget *update_file_dialog; GtkWidget *update_file_primary_text_label; + GtkWidget *update_file_secondary_text_label; GtkWidget *update_files_dialog; GtkWidget *update_files_primary_text_label; @@ -163,6 +164,15 @@ update_file_list (DialogData *data) g_free (label); g_free (archive_name); g_free (file_name); + + /* secondary text */ + + label = g_strdup_printf (ngettext ("The file has been modified with an external application. If you don't update the version in the archive, all of your changes will be lost.", + "There are %d files that have been modified with an external application. If you don't update the files in the archive, all of your changes will be lost.", + n_files), + n_files); + gtk_label_set_text (GTK_LABEL (data->update_file_secondary_text_label), label); + g_free (label); } else if (n_files > 1) { char *archive_name, *label, *markup; @@ -276,6 +286,7 @@ dlg_update (FrWindow *window) data->update_file_dialog = _gtk_builder_get_widget (data->builder, "update_file_dialog"); data->update_file_primary_text_label = _gtk_builder_get_widget (data->builder, "update_file_primary_text_label"); + data->update_file_secondary_text_label = _gtk_builder_get_widget (data->builder, "update_file_secondary_text_label"); update_file_ok_button = _gtk_builder_get_widget (data->builder, "update_file_ok_button"); update_file_cancel_button = _gtk_builder_get_widget (data->builder, "update_file_cancel_button");
Could you please attach the patch as produced by "git format-patch" ?
I've applied the patch to master now, thanks.