@@ -25,6 +25,7 @@ main(int argc, char *argv[])
2525{
2626uint64 loop_count ;
2727
28+ set_pglocale_pgservice (argv [0 ],PG_TEXTDOMAIN ("pg_test_timing" ));
2829progname = get_progname (argv [0 ]);
2930
3031handle_args (argc ,argv );
@@ -51,7 +52,7 @@ handle_args(int argc, char *argv[])
5152{
5253if (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 );
5556exit (0 );
5657}
5758if (strcmp (argv [1 ],"--version" )== 0 || strcmp (argv [1 ],"-V" )== 0 )
@@ -71,7 +72,7 @@ handle_args(int argc, char *argv[])
7172break ;
7273
7374default :
74- fprintf (stderr ,"Try \"%s --help\" for more information.\n" ,
75+ fprintf (stderr ,_ ( "Try \"%s --help\" for more information.\n" ) ,
7576progname );
7677exit (1 );
7778break ;
@@ -81,23 +82,26 @@ handle_args(int argc, char *argv[])
8182if (argc > optind )
8283{
8384fprintf (stderr ,
84- "%s: too many command-line arguments (first is \"%s\")\n" ,
85+ _ ( "%s: too many command-line arguments (first is \"%s\")\n" ) ,
8586progname ,argv [optind ]);
86- fprintf (stderr ,"Try \"%s --help\" for more information.\n" ,
87+ fprintf (stderr ,_ ( "Try \"%s --help\" for more information.\n" ) ,
8788progname );
8889exit (1 );
8990}
9091
9192if (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}
9599else
96100{
97101fprintf (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" ) ,
99103progname ,test_duration );
100- fprintf (stderr ,"Try \"%s --help\" for more information.\n" ,
104+ fprintf (stderr ,_ ( "Try \"%s --help\" for more information.\n" ) ,
101105progname );
102106exit (1 );
103107}
@@ -133,8 +137,8 @@ test_timing(int32 duration)
133137/* Did time go backwards? */
134138if (diff < 0 )
135139{
136- printf ( "Detected clock going backwards in time.\n" );
137- printf ( "Time warp: %dmicroseconds \n" ,diff );
140+ fprintf ( stderr , _ ( "Detected clock going backwards in time.\n" ) );
141+ fprintf ( stderr , _ ( "Time warp: %dms \n" ) ,diff );
138142exit (1 );
139143}
140144
@@ -157,7 +161,7 @@ test_timing(int32 duration)
157161
158162INSTR_TIME_SUBTRACT (end_time ,start_time );
159163
160- printf ("Per loop time including overhead: %0.2fnsec \n" ,
164+ printf (_ ( "Per loop time including overhead: %0.2fns \n" ) ,
161165INSTR_TIME_GET_DOUBLE (end_time )* 1e9 /loop_count );
162166
163167return loop_count ;
@@ -173,8 +177,8 @@ output(uint64 loop_count)
173177while (max_bit > 0 && histogram [max_bit ]== 0 )
174178max_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
179183for (i = 0 ;i <=max_bit ;i ++ )
180184{