@@ -25,6 +25,7 @@ main(int argc, char *argv[])
2525{
2626 uint64 loop_count ;
2727
28+ set_pglocale_pgservice (argv [0 ], PG_TEXTDOMAIN ("pg_test_timing" ));
2829 progname = get_progname (argv [0 ]);
2930
3031 handle_args (argc , argv );
@@ -51,7 +52,7 @@ handle_args(int argc, char *argv[])
5152 {
5253 if (strcmp (argv [1 ], "--help" ) == 0 || strcmp (argv [1 ], "-?" ) == 0 )
5354 {
54- printf ("Usage: %s [-d DURATION]\n" , progname );
55+ printf (_ ( "Usage: %s [-d DURATION]\n" ) , progname );
5556 exit (0 );
5657 }
5758 if (strcmp (argv [1 ], "--version" ) == 0 || strcmp (argv [1 ], "-V" ) == 0 )
@@ -71,7 +72,7 @@ handle_args(int argc, char *argv[])
7172 break ;
7273
7374 default :
74- fprintf (stderr , "Try \"%s --help\" for more information.\n" ,
75+ fprintf (stderr , _ ( "Try \"%s --help\" for more information.\n" ) ,
7576 progname );
7677 exit (1 );
7778 break ;
@@ -81,23 +82,26 @@ handle_args(int argc, char *argv[])
8182 if (argc > optind )
8283 {
8384 fprintf (stderr ,
84- "%s: too many command-line arguments (first is \"%s\")\n" ,
85+ _ ( "%s: too many command-line arguments (first is \"%s\")\n" ) ,
8586 progname , argv [optind ]);
86- fprintf (stderr , "Try \"%s --help\" for more information.\n" ,
87+ fprintf (stderr , _ ( "Try \"%s --help\" for more information.\n" ) ,
8788 progname );
8889 exit (1 );
8990 }
9091
9192 if (test_duration > 0 )
9293 {
93- printf ("Testing timing overhead for %d seconds.\n" , test_duration );
94+ printf (ngettext ("Testing timing overhead for %d second.\n" ,
95+ "Testing timing overhead for %d seconds.\n" ,
96+ test_duration ),
97+ test_duration );
9498 }
9599 else
96100 {
97101 fprintf (stderr ,
98- "%s: duration must be a positive integer (duration is \"%d\")\n" ,
102+ _ ( "%s: duration must be a positive integer (duration is \"%d\")\n" ) ,
99103 progname , test_duration );
100- fprintf (stderr , "Try \"%s --help\" for more information.\n" ,
104+ fprintf (stderr , _ ( "Try \"%s --help\" for more information.\n" ) ,
101105 progname );
102106 exit (1 );
103107 }
@@ -133,8 +137,8 @@ test_timing(int32 duration)
133137 /* Did time go backwards? */
134138 if (diff < 0 )
135139 {
136- printf ( "Detected clock going backwards in time.\n" );
137- printf ( "Time warp: %d microseconds \n" , diff );
140+ fprintf ( stderr , _ ( "Detected clock going backwards in time.\n" ) );
141+ fprintf ( stderr , _ ( "Time warp: %d ms \n" ) , diff );
138142 exit (1 );
139143 }
140144
@@ -157,7 +161,7 @@ test_timing(int32 duration)
157161
158162 INSTR_TIME_SUBTRACT (end_time , start_time );
159163
160- printf ("Per loop time including overhead: %0.2f nsec \n" ,
164+ printf (_ ( "Per loop time including overhead: %0.2f ns \n" ) ,
161165 INSTR_TIME_GET_DOUBLE (end_time ) * 1e9 / loop_count );
162166
163167 return loop_count ;
@@ -173,8 +177,8 @@ output(uint64 loop_count)
173177 while (max_bit > 0 && histogram [max_bit ] == 0 )
174178 max_bit -- ;
175179
176- printf ("Histogram of timing durations:\n" );
177- printf ("%6s %10s %10s\n" , "< usec" , "% of total" , "count" );
180+ printf (_ ( "Histogram of timing durations:\n" ) );
181+ printf ("%6s %10s %10s\n" , _ ( "< us" ), _ ( "% of total" ), _ ( "count" ) );
178182
179183 for (i = 0 ; i <= max_bit ; i ++ )
180184 {
0 commit comments