diff mbox series

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

Message ID 20190418063442.GA21066@tucnak
State New
Headers show
Series i18n fix for gimple-ssa-sprintf.c (PR translation/79183) | expand

Commit Message

Jakub Jelinek April 18, 2019, 6:34 a.m. UTC
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.


	Jakub

Comments

Richard Biener April 18, 2019, 7:41 a.m. UTC | #1
On Thu, 18 Apr 2019, Jakub Jelinek wrote:

> 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?

OK.

Richard.

> 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
>
diff mbox series

Patch

--- 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",