Index: nls-global.mk
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/nls-global.mk,v
retrieving revision 1.9
diff -c -r1.9 nls-global.mk
*** nls-global.mk	29 Nov 2003 19:51:39 -0000	1.9
--- nls-global.mk	30 May 2004 01:58:52 -0000
***************
*** 6,14 ****
  # needs to contain a file 'nls.mk' with the following make variable
  # assignments:
  #
! # CATALOG_NAME	        -- name of the message catalog (xxx.po); probably
  #                          name of the program
! # AVAIL_LANGUAGES	-- list of languages that are provided/supported
  # GETTEXT_FILES         -- list of source files that contain message strings
  # GETTEXT_TRIGGERS      -- (optional) list of functions that contain
  #                          translatable strings
--- 6,14 ----
  # needs to contain a file 'nls.mk' with the following make variable
  # assignments:
  #
! # CATALOG_NAME          -- name of the message catalog (xxx.po); probably
  #                          name of the program
! # AVAIL_LANGUAGES       -- list of languages that are provided/supported
  # GETTEXT_FILES         -- list of source files that contain message strings
  # GETTEXT_TRIGGERS      -- (optional) list of functions that contain
  #                          translatable strings
Index: bin/pg_ctl/pg_ctl.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_ctl/pg_ctl.c,v
retrieving revision 1.1
diff -c -r1.1 pg_ctl.c
*** bin/pg_ctl/pg_ctl.c	27 May 2004 03:37:55 -0000	1.1
--- bin/pg_ctl/pg_ctl.c	30 May 2004 01:58:55 -0000
***************
*** 12,17 ****
--- 12,18 ----
  #include "postgres_fe.h"
  #include "libpq-fe.h"
  
+ #include <locale.h>
  #include <signal.h>
  #include <errno.h>
  #include <sys/types.h>
***************
*** 251,257 ****
  		/* advance past whitespace/quoting */
  		while (isspace(*p) || *p == '\'' || *p == '"')
  			p++;
! 		
  		if (strncmp(p, "-p", strlen("-p")) == 0)
  		{
  			p += strlen("-p");
--- 252,258 ----
  		/* advance past whitespace/quoting */
  		while (isspace(*p) || *p == '\'' || *p == '"')
  			p++;
! 
  		if (strncmp(p, "-p", strlen("-p")) == 0)
  		{
  			p += strlen("-p");
***************
*** 367,377 ****
  			optline = optlines[0];
  			len = strcspn(optline, "\r\n");
  			optline[len] = '\0';
! 	
  			if (ctl_command == RESTART_COMMAND)
  			{
  				char	   *arg1;
! 	
  				arg1 = strchr(optline, '\'');
  				if (arg1 == NULL || arg1 == optline)
  					post_opts = "";
--- 368,378 ----
  			optline = optlines[0];
  			len = strcspn(optline, "\r\n");
  			optline[len] = '\0';
! 
  			if (ctl_command == RESTART_COMMAND)
  			{
  				char	   *arg1;
! 
  				arg1 = strchr(optline, '\'');
  				if (arg1 == NULL || arg1 == optline)
  					post_opts = "";
***************
*** 401,407 ****
  			if (ret == -1)
  				fprintf(stderr,
  						_("The program \"postmaster\" is needed by %s "
! 				   "but was not found in the same directory as \"%s\".\n"
  						  "Check your installation.\n"),
  						progname, progname);
  			else
--- 402,408 ----
  			if (ret == -1)
  				fprintf(stderr,
  						_("The program \"postmaster\" is needed by %s "
! 						  "but was not found in the same directory as \"%s\".\n"
  						  "Check your installation.\n"),
  						progname, progname);
  			else
***************
*** 497,510 ****
  			printf(_("waiting for postmaster to shut down..."));
  			fflush(stdout);
  		}
! 	
  		for (cnt = 0; cnt < wait_seconds; cnt++)
  		{
  			if ((pid = get_pgpid()) != 0)
  			{
  				if (!silence_echo)
  				{
! 					printf(".");
  					fflush(stdout);
  				}
  				pg_usleep(1000000); /* 1 sec */
--- 498,511 ----
  			printf(_("waiting for postmaster to shut down..."));
  			fflush(stdout);
  		}
! 
  		for (cnt = 0; cnt < wait_seconds; cnt++)
  		{
  			if ((pid = get_pgpid()) != 0)
  			{
  				if (!silence_echo)
  				{
! 					printf(_("."));
  					fflush(stdout);
  				}
  				pg_usleep(1000000); /* 1 sec */
***************
*** 512,523 ****
  			else
  				break;
  		}
! 	
  		if (pid != 0)				/* pid file still exists */
  		{
  			if (!silence_echo)
  				printf(_(" failed\n"));
! 	
  			fprintf(stderr, _("%s: postmaster does not shut down\n"), progname);
  			exit(1);
  		}
--- 513,524 ----
  			else
  				break;
  		}
! 
  		if (pid != 0)				/* pid file still exists */
  		{
  			if (!silence_echo)
  				printf(_(" failed\n"));
! 
  			fprintf(stderr, _("%s: postmaster does not shut down\n"), progname);
  			exit(1);
  		}
***************
*** 798,803 ****
--- 799,810 ----
  int
  main(int argc, char **argv)
  {
+ #ifdef ENABLE_NLS
+ 	setlocale(LC_ALL, "");
+ 	bindtextdomain(progname, LOCALEDIR);
+ 	textdomain(progname);
+ #endif
+ 
  	static struct option long_options[] = {
  		{"help", no_argument, NULL, '?'},
  		{"version", no_argument, NULL, 'V'},
***************
*** 810,816 ****
  
  	int			option_index;
  	int			c;
! 	
  #ifdef WIN32
  	setvbuf(stderr, NULL, _IONBF, 0);
  #endif
--- 817,823 ----
  
  	int			option_index;
  	int			c;
! 
  #ifdef WIN32
  	setvbuf(stderr, NULL, _IONBF, 0);
  #endif
***************
*** 836,842 ****
  		}
  		else if (strcmp(argv[1], "-V") == 0 || strcmp(argv[1], "--version") == 0)
  		{
! 			printf("%s (PostgreSQL) %s\n", progname, PG_VERSION);
  			exit(0);
  		}
  	}
--- 843,849 ----
  		}
  		else if (strcmp(argv[1], "-V") == 0 || strcmp(argv[1], "--version") == 0)
  		{
! 			printf(_("%s (PostgreSQL) %s\n"), progname, PG_VERSION);
  			exit(0);
  		}
  	}
***************
*** 848,854 ****
  	 *	Our /port version doesn't do that.
  	 */
  	optind = 1;
! 	
  	/* process command-line options */
  	while (optind < argc)
  	{
--- 855,861 ----
  	 *	Our /port version doesn't do that.
  	 */
  	optind = 1;
! 
  	/* process command-line options */
  	while (optind < argc)
  	{
***************
*** 860,866 ****
  				{
  					int			len = strlen(optarg) + 4;
  					char	   *env_var;
! 		
  					pg_data_opts = xmalloc(len);
  					snprintf(pg_data_opts, len, "-D %s", optarg);
  					env_var = xmalloc(len + sizeof("PGDATA="));
--- 867,873 ----
  				{
  					int			len = strlen(optarg) + 4;
  					char	   *env_var;
! 
  					pg_data_opts = xmalloc(len);
  					snprintf(pg_data_opts, len, "-D %s", optarg);
  					env_var = xmalloc(len + sizeof("PGDATA="));
***************
*** 897,903 ****
  					exit(1);
  			}
  		}
! 	
  		/* Process an action */
  		if (optind < argc)
  		{
--- 904,910 ----
  					exit(1);
  			}
  		}
! 
  		/* Process an action */
  		if (optind < argc)
  		{
***************
*** 907,913 ****
  				do_advice();
  				exit(1);
  			}
! 			
  			if (strcmp(argv[optind], "start") == 0)
  				ctl_command = START_COMMAND;
  			else if (strcmp(argv[optind], "stop") == 0)
--- 914,920 ----
  				do_advice();
  				exit(1);
  			}
! 
  			if (strcmp(argv[optind], "start") == 0)
  				ctl_command = START_COMMAND;
  			else if (strcmp(argv[optind], "stop") == 0)
***************
*** 939,945 ****
  			optind++;
  		}
  	}
! 	
  	if (ctl_command == NO_COMMAND)
  	{
  		fprintf(stderr, _("%s: no operation specified\n"), progname);
--- 946,952 ----
  			optind++;
  		}
  	}
! 
  	if (ctl_command == NO_COMMAND)
  	{
  		fprintf(stderr, _("%s: no operation specified\n"), progname);
