[PATCH] i18n fix for gimple-ssa-sprintf.c (PR translation/79183)

Jakub Jelinek jakub@redhat.com
Thu Apr 18 07:41:00 GMT 2019


Hi!

This patch fixes the following messages, so that they are translatable even
to languages that don't use the english
Plural-Forms: nplurals=2; plural=n != 1;
See https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html#Plural-forms
for more details.

Bootstrapped/regtested on x86_64-linux and i686-linux, plus generated
gcc.pot and eyeballed the changes.  Ok for trunk?

2019-04-18  Jakub Jelinek  <jakub@redhat.com>

	PR translation/79183
	* gimple-ssa-sprintf.c (format_directive): Use inform_n instead of
	inform where appropriate.

--- gcc/gimple-ssa-sprintf.c.jj	2019-04-10 09:26:49.476692760 +0200
+++ gcc/gimple-ssa-sprintf.c	2019-04-17 21:37:51.535294586 +0200
@@ -3016,12 +3016,10 @@ format_directive (const sprintf_dom_walk
 	     help the user figure out how big a buffer they need.  */
 
 	  if (min == max)
-	    inform (callloc,
-		    (min == 1
-		     ? G_("%qE output %wu byte into a destination of size %wu")
-		     : G_("%qE output %wu bytes into a destination of size "
-			  "%wu")),
-		    info.func, min, info.objsize);
+	    inform_n (callloc, min,
+		      "%qE output %wu byte into a destination of size %wu",
+		      "%qE output %wu bytes into a destination of size %wu",
+		      info.func, min, info.objsize);
 	  else if (max < HOST_WIDE_INT_MAX)
 	    inform (callloc,
 		    "%qE output between %wu and %wu bytes into "
@@ -3044,11 +3042,9 @@ format_directive (const sprintf_dom_walk
 	     of printf with no destination size just print the computed
 	     result.  */
 	  if (min == max)
-	    inform (callloc,
-		    (min == 1
-		     ? G_("%qE output %wu byte")
-		     : G_("%qE output %wu bytes")),
-		    info.func, min);
+	    inform_n (callloc, min,
+		      "%qE output %wu byte", "%qE output %wu bytes",
+		      info.func, min);
 	  else if (max < HOST_WIDE_INT_MAX)
 	    inform (callloc,
 		    "%qE output between %wu and %wu bytes",

	Jakub



More information about the Gcc-patches mailing list