GNOME Bugzilla – Bug 759491
Plural form for string "%s / %s available"
Last modified: 2015-12-15 20:00:16 UTC
Can be created plural form for this string? #: ../src/gtk/gtkplacesviewrow.c:110 #, c-format msgid "%s / %s available" Many languages have different form for translation of word "available", that is dependent on amount in first variable "%s" DEV wiki: https://wiki.gnome.org/TranslationProject/DevGuidelines/Plurals
-> gtk+
Created attachment 317429 [details] [review] gtkplacesviewrow: plural form for available space We were not supporting plural form of the available space, which is a problem in some languages. However in this case is kind of a difficult matter, since we use a formatted string from glib with g_format_size. To fix it, use the same behavior as g_format_size to decide when it should be used a plural form or not.
Review of attachment 317429 [details] [review]: ::: gtk/gtkplacesviewrow.c @@ +126,3 @@ + plural_form = free_space < 1000 ? free_space : free_space % 1000 + 1000; + /* Translators: respectively, free and total space of the drive. The plural form + * should be based on the free space available, which is the first string. */ I think it would be instructive to give an example of what the formatted string might look like for translators. Pet peeve of mine: move the closing */ to the next line and make the stars line up
Created attachment 317432 [details] [review] gtkplacesviewrow: plural form for available space We were not supporting plural form of the available space, which is a problem in some languages. However in this case is kind of a difficult matter, since we use a formatted string from glib with g_format_size. To fix it, use the same behavior as g_format_size to decide when it should be used a plural form or not.
Review of attachment 317432 [details] [review]: fine to push with those fixes ::: gtk/gtkplacesviewrow.c @@ +125,3 @@ + /* read g_format_size code in glib for further understanding */ + plural_form = free_space < 1000 ? free_space : free_space % 1000 + 1000; + /* Translators: respectively, free and total space of the drive. The plural form I would put a newline before the comment here, just to keep the plural_from assignment from being lost between the two comments. @@ +129,3 @@ + * i.e. 1 GB / 24 GB available. + */ + label = g_strdup_printf (ngettext("%s / %s available", "%s / %s available", plural_form), Put a space before (
Attachment 317432 [details] pushed as 8858c3a - gtkplacesviewrow: plural form for available space