After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789833 - Strings in glib-networking need plural forms
Strings in glib-networking need plural forms
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-11-02 17:41 UTC by Piotr Drąg
Modified: 2017-11-03 18:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnutls: Use ngettext where required (2.56 KB, patch)
2017-11-02 19:24 UTC, Michael Catanzaro
none Details | Review
gnutls: Use ngettext where required (2.57 KB, patch)
2017-11-02 23:41 UTC, Michael Catanzaro
committed Details | Review

Description Piotr Drąg 2017-11-02 17:41:04 UTC
These two new strings need plural forms support (https://wiki.gnome.org/TranslationProject/DevGuidelines/Plurals):


tls/gnutls/gtlsconnection-gnutls.c:995
"Message is too large for DTLS connection; maximum is %u bytes"

tls/gnutls/gtlsconnection-gnutls.c:2420
"Message of size %lu bytes is too large for DTLS connection, maximum is %u bytes"


The second one probably needs to be split into two, as numbers may differ.
Comment 1 Michael Catanzaro 2017-11-02 19:24:04 UTC
Created attachment 362852 [details] [review]
gnutls: Use ngettext where required

This looks pretty odd in English, as we know the MTU and message size
will never be 0 in these error messages, and so the string will never be
singular. But all the world is not English.
Comment 2 Michael Catanzaro 2017-11-02 19:24:44 UTC
I have not tested it, so please sanity-check it. I think it's right.
Comment 3 Philip Withnall 2017-11-02 22:09:36 UTC
Review of attachment 362852 [details] [review]:

::: tls/gnutls/gtlsconnection-gnutls.c
@@ +995,2 @@
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_MESSAGE_TOO_LARGE,
+                   ngettext("Message is too large for DTLS connection; maximum is %u byte",

Nitpick: Missing space before `(`. Same below too.
Comment 4 Michael Catanzaro 2017-11-02 23:41:04 UTC
Created attachment 362857 [details] [review]
gnutls: Use ngettext where required

This looks pretty odd in English, as we know the MTU and message size
will never be 0 in these error messages, and so the string will never be
singular. But all the world is not English.
Comment 5 Philip Withnall 2017-11-03 11:40:19 UTC
Review of attachment 362857 [details] [review]:

Looks good to push with this fix.

::: tls/gnutls/gtlsconnection-gnutls.c
@@ +2422,3 @@
+      message = g_strdup_printf("%s %s",
+                                ngettext ("Message of size %lu byte is too large for DTLS connection",
+                                          "Message of size %lu bytes is too large for DTLS connection", mtu),

Ah, also the number passed to this ngettext() call should be total_message_size rather than mtu.
Comment 6 Michael Catanzaro 2017-11-03 18:24:35 UTC
Yup... code review is good.
Comment 7 Michael Catanzaro 2017-11-03 18:26:44 UTC
Attachment 362857 [details] pushed as 57f8d06 - gnutls: Use ngettext where required