Index: initdb.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/bin/initdb/initdb.c,v
retrieving revision 1.11
diff -c -r1.11 initdb.c
*** initdb.c	17 Nov 2003 20:35:28 -0000	1.11
--- initdb.c	19 Nov 2003 22:59:55 -0000
***************
*** 66,71 ****
--- 66,73 ----
  #endif
  
  
+ #define _(x) gettext((x))
+ 
  /* version string we expect back from postgres */
  #define PG_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n"
  
***************
*** 195,205 ****
  static void setup_schema(void);
  static void vacuum_db(void);
  static void make_template0(void);
! static void usage(void);
  static void trapsig(int);
  static void check_ok(void);
  static char *xstrdup(const char *);
  static void *xmalloc(size_t);
  
  /*
   * macros for running pipes to postgres
--- 197,208 ----
  static void setup_schema(void);
  static void vacuum_db(void);
  static void make_template0(void);
! static void usage(const char *);
  static void trapsig(int);
  static void check_ok(void);
  static char *xstrdup(const char *);
  static void *xmalloc(size_t);
+ static void init_nls(void);
  
  /*
   * macros for running pipes to postgres
***************
*** 247,253 ****
  	result = malloc(size);
  	if (!result)
  	{
! 		fputs("malloc failure - bailing out\n", stderr);
  		exit(1);
  	}
  	return result;
--- 250,256 ----
  	result = malloc(size);
  	if (!result)
  	{
! 		fputs(_("malloc failure - bailing out\n"), stderr);
  		exit(1);
  	}
  	return result;
***************
*** 261,267 ****
  	result = strdup(s);
  	if (!result)
  	{
! 		fputs("strdup failure - bailing out\n", stderr);
  		exit(1);
  	}
  	return result;
--- 264,270 ----
  	result = strdup(s);
  	if (!result)
  	{
! 		fputs(_("strdup failure - bailing out\n"), stderr);
  		exit(1);
  	}
  	return result;
***************
*** 392,398 ****
  
  	if ((infile = fopen(path, "r")) == NULL)
  	{
! 		fprintf(stderr, "could not read %s\n", path);
  		exit_nicely();
  	}
  
--- 395,401 ----
  
  	if ((infile = fopen(path, "r")) == NULL)
  	{
! 		fprintf(stderr, _("could not read %s\n"), path);
  		exit_nicely();
  	}
  
***************
*** 450,456 ****
  	;
  	if ((out_file = fopen(path, PG_BINARY_W)) == NULL)
  	{
! 		fprintf(stderr, "could not write %s\n", path);
  		exit_nicely();
  	}
  	for (line = lines; *line != NULL; line++)
--- 453,459 ----
  	;
  	if ((out_file = fopen(path, PG_BINARY_W)) == NULL)
  	{
! 		fprintf(stderr, _("could not write %s\n"), path);
  		exit_nicely();
  	}
  	for (line = lines; *line != NULL; line++)
***************
*** 481,497 ****
  	}
  	else if (WIFEXITED(exitstatus))
  	{
! 		fprintf(stderr, "child process exited with exit code %d\n",
  				WEXITSTATUS(exitstatus));
  	}
  	else if (WIFSIGNALED(exitstatus))
  	{
! 		fprintf(stderr, "child process was terminated by signal %d\n",
  				WTERMSIG(exitstatus));
  	}
  	else
  	{
! 		fprintf(stderr, "child process exited with unexpected status %d\n",
  				exitstatus);
  	}
  
--- 484,500 ----
  	}
  	else if (WIFEXITED(exitstatus))
  	{
! 		fprintf(stderr, _("child process exited with exit code %d\n"),
  				WEXITSTATUS(exitstatus));
  	}
  	else if (WIFSIGNALED(exitstatus))
  	{
! 		fprintf(stderr, _("child process was terminated by signal %d\n"),
  				WTERMSIG(exitstatus));
  	}
  	else
  	{
! 		fprintf(stderr, _("child process exited with unexpected status %d\n"),
  				exitstatus);
  	}
  
***************
*** 612,635 ****
  static void
  exit_nicely(void)
  {
! 	fprintf(stderr, "%s: failed\n", progname);
  
  	if (!noclean)
  	{
  		if (made_new_pgdata)
  		{
! 			fprintf(stderr, "%s: removing data directory \"%s\"\n",
  					progname, pg_data);
  			if (!rmtree(pg_data, true))
! 				fprintf(stderr, "%s: failed\n", progname);
  		}
  		else if (found_existing_pgdata)
  		{
  			fprintf(stderr,
! 					"%s: removing contents of data directory \"%s\"\n",
  					progname, pg_data);
  			if (!rmtree(pg_data, false))
! 				fprintf(stderr, "%s: failed\n", progname);
  		}
  		/* otherwise died during startup, do nothing! */
  	}
--- 615,638 ----
  static void
  exit_nicely(void)
  {
! 	fprintf(stderr, _("%s: failed\n"), progname);
  
  	if (!noclean)
  	{
  		if (made_new_pgdata)
  		{
! 			fprintf(stderr, _("%s: removing data directory \"%s\"\n"),
  					progname, pg_data);
  			if (!rmtree(pg_data, true))
! 				fprintf(stderr, _("%s: failed\n"), progname);
  		}
  		else if (found_existing_pgdata)
  		{
  			fprintf(stderr,
! 					_("%s: removing contents of data directory \"%s\"\n"),
  					progname, pg_data);
  			if (!rmtree(pg_data, false))
! 				fprintf(stderr, _("%s: failed\n"), progname);
  		}
  		/* otherwise died during startup, do nothing! */
  	}
***************
*** 637,643 ****
  	{
  		if (made_new_pgdata || found_existing_pgdata)
  			fprintf(stderr,
! 					"%s: data directory \"%s\" not removed at user's request\n",
  					progname, pg_data);
  	}
  
--- 640,646 ----
  	{
  		if (made_new_pgdata || found_existing_pgdata)
  			fprintf(stderr,
! 					_("%s: data directory \"%s\" not removed at user's request\n"),
  					progname, pg_data);
  	}
  
***************
*** 663,672 ****
  	if (!geteuid())				/* 0 is root's uid */
  	{
  		fprintf(stderr,
! 				"%s: cannot be run as root\n"
  				"Please log in (using, e.g., \"su\") as the "
  				"(unprivileged) user that will\n"
! 				"own the server process.\n",
  				progname);
  		exit(1);
  	}
--- 666,675 ----
  	if (!geteuid())				/* 0 is root's uid */
  	{
  		fprintf(stderr,
! 				_("%s: cannot be run as root\n"
  				"Please log in (using, e.g., \"su\") as the "
  				"(unprivileged) user that will\n"
! 				"own the server process.\n"),
  				progname);
  		exit(1);
  	}
***************
*** 707,713 ****
  			return xstrdup(result);
  		}
  	}
! 	fprintf(stderr, "%s: \"%s\" is not a valid server encoding name\n",
  			progname, encoding_name ? encoding_name : "(null)");
  	exit(1);
  }
--- 710,716 ----
  			return xstrdup(result);
  		}
  	}
! 	fprintf(stderr, _("%s: \"%s\" is not a valid server encoding name\n"),
  			progname, encoding_name ? encoding_name : "(null)");
  	exit(1);
  }
***************
*** 838,846 ****
  	if (stat(path, &statbuf) != 0 || !S_ISREG(statbuf.st_mode))
  	{
  		fprintf(stderr,
! 				"%s: file \"%s\" not found\n"
  		   "This means you have a corrupted installation or identified\n"
! 				"the wrong directory with the invocation option -L.\n",
  				progname, path);
  		exit(1);
  	}
--- 841,849 ----
  	if (stat(path, &statbuf) != 0 || !S_ISREG(statbuf.st_mode))
  	{
  		fprintf(stderr,
! 				_("%s: file \"%s\" not found\n"
  		   "This means you have a corrupted installation or identified\n"
! 				"the wrong directory with the invocation option -L.\n"),
  				progname, path);
  		exit(1);
  	}
***************
*** 1086,1092 ****
  	int			i,
  				status;
  
! 	printf("selecting default max_connections ... ");
  	fflush(stdout);
  
  	for (i = 0; i < len; i++)
--- 1089,1095 ----
  	int			i,
  				status;
  
! 	printf(_("selecting default max_connections ... "));
  	fflush(stdout);
  
  	for (i = 0; i < len; i++)
***************
*** 1122,1128 ****
  	int			i,
  				status;
  
! 	printf("selecting default shared_buffers ... ");
  	fflush(stdout);
  
  	for (i = 0; i < len; i++)
--- 1125,1131 ----
  	int			i,
  				status;
  
! 	printf(_("selecting default shared_buffers ... "));
  	fflush(stdout);
  
  	for (i = 0; i < len; i++)
***************
*** 1155,1161 ****
  	char		repltok[100];
  	char		path[MAXPGPATH];
  
! 	fputs("creating configuration files ... ", stdout);
  	fflush(stdout);
  
  	/* postgresql.conf */
--- 1158,1164 ----
  	char		repltok[100];
  	char		path[MAXPGPATH];
  
! 	fputs(_("creating configuration files ... "), stdout);
  	fflush(stdout);
  
  	/* postgresql.conf */
***************
*** 1233,1239 ****
  
  	PG_CMD_DECL;
  
! 	printf("creating template1 database in %s/base/1 ... ", pg_data);
  	fflush(stdout);
  
  	if (debug)
--- 1236,1242 ----
  
  	PG_CMD_DECL;
  
! 	printf(_("creating template1 database in %s/base/1 ... "), pg_data);
  	fflush(stdout);
  
  	if (debug)
***************
*** 1249,1257 ****
  	if (strcmp(headerline, *bki_lines) != 0)
  	{
  		fprintf(stderr,
! 				"%s: input file \"%s\" does not belong to PostgreSQL %s\n"
  				"Check your installation or specify the correct path "
! 				"using the option -L.\n",
  				progname, bki_file, PG_VERSION);
  		exit_nicely();
  
--- 1252,1260 ----
  	if (strcmp(headerline, *bki_lines) != 0)
  	{
  		fprintf(stderr,
! 				_("%s: input file \"%s\" does not belong to PostgreSQL %s\n"
  				"Check your installation or specify the correct path "
! 				"using the option -L.\n"),
  				progname, bki_file, PG_VERSION);
  		exit_nicely();
  
***************
*** 1322,1328 ****
  
  	PG_CMD_DECL;
  
! 	fputs("initializing pg_shadow ... ", stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1325,1331 ----
  
  	PG_CMD_DECL;
  
! 	fputs(_("initializing pg_shadow ... "), stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1357,1368 ****
  	pwd2 = simple_prompt("Enter it again: ", 100, false);
  	if (strcmp(pwd1, pwd2) != 0)
  	{
! 		fprintf(stderr, "Passwords didn't match.\n");
  		exit_nicely();
  	}
  	free(pwd2);
  
! 	printf("setting password ... ");
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1360,1371 ----
  	pwd2 = simple_prompt("Enter it again: ", 100, false);
  	if (strcmp(pwd1, pwd2) != 0)
  	{
! 		fprintf(stderr, _("Passwords didn't match.\n"));
  		exit_nicely();
  	}
  	free(pwd2);
  
! 	printf(_("setting password ... "));
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1386,1393 ****
  	if (stat(pwdpath, &statbuf) != 0 || !S_ISREG(statbuf.st_mode))
  	{
  		fprintf(stderr,
! 				"%s: The password file was not generated. "
! 				"Please report this problem.\n",
  				progname);
  		exit_nicely();
  	}
--- 1389,1396 ----
  	if (stat(pwdpath, &statbuf) != 0 || !S_ISREG(statbuf.st_mode))
  	{
  		fprintf(stderr,
! 				_("%s: The password file was not generated. "
! 				"Please report this problem.\n"),
  				progname);
  		exit_nicely();
  	}
***************
*** 1416,1422 ****
  
  	PG_CMD_DECL;
  
! 	fputs("enabling unlimited row size for system tables ... ", stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1419,1425 ----
  
  	PG_CMD_DECL;
  
! 	fputs(_("enabling unlimited row size for system tables ... "), stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1489,1495 ****
  
  	PG_CMD_DECL;
  
! 	fputs("initializing pg_depend ... ", stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1492,1498 ----
  
  	PG_CMD_DECL;
  
! 	fputs(_("initializing pg_depend ... "), stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1517,1523 ****
  
  	char	  **sysviews_setup;
  
! 	fputs("creating system views ... ", stdout);
  	fflush(stdout);
  
  	sysviews_setup = readfile(system_views_file);
--- 1520,1526 ----
  
  	char	  **sysviews_setup;
  
! 	fputs(_("creating system views ... "), stdout);
  	fflush(stdout);
  
  	sysviews_setup = readfile(system_views_file);
***************
*** 1554,1560 ****
  	PG_CMD_DECL_NOLINE;
  	int			fres;
  
! 	fputs("loading pg_description ... ", stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1557,1563 ----
  	PG_CMD_DECL_NOLINE;
  	int			fres;
  
! 	fputs(_("loading pg_description ... "), stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1602,1608 ****
  
  	char	  **conv_lines;
  
! 	fputs("creating conversions ... ", stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1605,1611 ----
  
  	char	  **conv_lines;
  
! 	fputs(_("creating conversions ... "), stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1658,1664 ****
  
  	char	  **priv_lines;
  
! 	fputs("setting privileges on built-in objects ... ", stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1661,1667 ----
  
  	char	  **priv_lines;
  
! 	fputs(_("setting privileges on built-in objects ... "), stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1716,1722 ****
  	char	  **lines;
  	int			fres;
  
! 	fputs("creating information schema ... ", stdout);
  	fflush(stdout);
  
  	lines = readfile(info_schema_file);
--- 1719,1725 ----
  	char	  **lines;
  	int			fres;
  
! 	fputs(_("creating information schema ... "), stdout);
  	fflush(stdout);
  
  	lines = readfile(info_schema_file);
***************
*** 1778,1784 ****
  {
  	PG_CMD_DECL_NOLINE;
  
! 	fputs("vacuuming database template1 ... ", stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1781,1787 ----
  {
  	PG_CMD_DECL_NOLINE;
  
! 	fputs(_("vacuuming database template1 ... "), stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1834,1840 ****
  
  	PG_CMD_DECL;
  
! 	fputs("copying template1 to template0 ... ", stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
--- 1837,1843 ----
  
  	PG_CMD_DECL;
  
! 	fputs(_("copying template1 to template0 ... "), stdout);
  	fflush(stdout);
  
  	snprintf(cmd, sizeof(cmd),
***************
*** 1891,1908 ****
  {
  	if (caught_signal)
  	{
! 		printf("caught signal\n");
  		exit_nicely();
  	}
  	else if (output_failed)
  	{
! 		printf("failed to write to child process\n");
  		exit_nicely();
  	}
  	else
  	{
  		/* all seems well */
! 		printf("ok\n");
  	}
  }
  
--- 1894,1911 ----
  {
  	if (caught_signal)
  	{
! 		printf(_("caught signal\n"));
  		exit_nicely();
  	}
  	else if (output_failed)
  	{
! 		printf(_("failed to write to child process\n"));
  		exit_nicely();
  	}
  	else
  	{
  		/* all seems well */
! 		printf(_("ok\n"));
  	}
  }
  
***************
*** 1932,1938 ****
  
  	/* should we exit here? */
  	if (!ret)
! 		fprintf(stderr, "%s: invalid locale name \"%s\"\n", progname, locale);
  
  	return ret;
  }
--- 1935,1941 ----
  
  	/* should we exit here? */
  	if (!ret)
! 		fprintf(stderr, _("%s: invalid locale name \"%s\"\n"), progname, locale);
  
  	return ret;
  }
***************
*** 1994,2051 ****
  }
  
  /*
-  * help text data
-  *
-  * Note: $CMDNAME is replaced by the right thing in usage()
-  */
- char	   *usage_text[] = {
- 	"$CMDNAME initializes a PostgreSQL database cluster.\n",
- 	"\n",
- 	"Usage:\n",
- 	"  $CMDNAME [OPTION]... [DATADIR]\n",
- 	"\n",
- 	"Options:\n",
- 	" [-D, --pgdata=]DATADIR     location for this database cluster\n",
- 	"  -E, --encoding=ENCODING   set default encoding for new databases\n",
- 	"  --locale=LOCALE           initialize database cluster with given locale\n",
- 	"  --lc-collate, --lc-ctype, --lc-messages=LOCALE\n",
- 	"  --lc-monetary, --lc-numeric, --lc-time=LOCALE\n",
- 	"                            initialize database cluster with given locale\n",
- 	"                            in the respective category (default taken from\n",
- 	"                            environment)\n",
- 	"  --no-locale               equivalent to --locale=C\n",
- 	"  -U, --username=NAME       database superuser name\n",
- 	"  -W, --pwprompt            prompt for a password for the new superuser\n",
- 	"  -?, --help                show this help, then exit\n",
- 	"  -V, --version             output version information, then exit\n",
- 	"\n",
- 	"Less commonly used options: \n",
- 	"  -d, --debug               generate lots of debugging output\n",
- 	"  -s, --show                show internal settings\n",
- 	"  -L DIRECTORY              where to find the input files\n",
- 	"  -n, --noclean             do not clean up after errors\n",
- 	"\n",
- 	"If the data directory is not specified, the environment variable PGDATA\n",
- 	"is used.\n",
- 	"\n",
- 	"Report bugs to <pgsql-bugs@postgresql.org>.\n",
- 	NULL
- };
- 
- 
- /*
   * print help text
   */
  static void
! usage(void)
  {
! 	int			i;
! 	char	  **newtext;
! 
! 	newtext = replace_token(usage_text, "$CMDNAME", progname);
  
! 	for (i = 0; newtext[i]; i++)
! 		fputs(newtext[i], stdout);		/* faster than printf */
  }
  
  
--- 1997,2045 ----
  }
  
  /*
   * print help text
   */
  static void
! usage(const char *progname)
  {
! 	printf(_("%s initializes a PostgreSQL database cluster.\n\n"), progname);
! 	printf(_("Usage:\n"));
! 	printf(_("  %s [OPTION]... [DATADIR]\n"), progname);
! 	printf(_("\nOptions:\n"));
! 	printf(_(" [-D, --pgdata=]DATADIR     location for this database cluster\n"));
! 	printf(_("  -E, --encoding=ENCODING   set default encoding for new databases\n"));
! 	printf(_("  --locale=LOCALE           initialize database cluster with given locale\n"));
! 	printf(_("  --lc-collate, --lc-ctype, --lc-messages=LOCALE\n"));
! 	printf(_("  --lc-monetary, --lc-numeric, --lc-time=LOCALE\n"));
! 	printf(_("                            initialize database cluster with given locale\n"));
! 	printf(_("                            in the respective category (default taken from\n"));
! 	printf(_("                            environment)\n"));
! 	printf(_("  --no-locale               equivalent to --locale=C\n"));
! 	printf(_("  -U, --username=NAME       database superuser name\n"));
! 	printf(_("  -W, --pwprompt            prompt for a password for the new superuser\n"));
! 	printf(_("  -?, --help                show this help, then exit\n"));
! 	printf(_("  -V, --version             output version information, then exit\n"));
! 	printf(_("\nLess commonly used options: \n"));
! 	printf(_("  -d, --debug               generate lots of debugging output\n"));
! 	printf(_("  -s, --show                show internal settings\n"));
! 	printf(_("  -L DIRECTORY              where to find the input files\n"));
! 	printf(_("  -n, --noclean             do not clean up after errors\n"));
! 	printf(_("\nIf the data directory is not specified, the environment variable PGDATA\n"));
! 	printf(_("is used.\n"));
! 	printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
! }
  
! /*
!  * Initialized NLS if enabled.
!  */
! void
! init_nls(void)
! {
! #ifdef ENABLE_NLS
!         setlocale(LC_ALL, "");
!         bindtextdomain("initdb", LOCALEDIR);
!         textdomain("initdb");
! #endif
  }
  
  
***************
*** 2091,2097 ****
  	char	   *exe;			/* location of exe suffix in progname */
  #endif
  
! 	setlocale(LC_ALL, "");
  
  	/* parse argv[0] - detect explicit path if there was one */
  	carg0 = xstrdup(argv[0]);
--- 2085,2091 ----
  	char	   *exe;			/* location of exe suffix in progname */
  #endif
  
! 	init_nls();
  
  	/* parse argv[0] - detect explicit path if there was one */
  	carg0 = xstrdup(argv[0]);
***************
*** 2151,2161 ****
  				break;
  			case 'd':
  				debug = true;
!                 printf("Running in debug mode.\n");
  				break;
  			case 'n':
  				noclean = true;
! 				printf("Running in noclean mode.  Mistakes will not be cleaned up.\n");
  				break;
  			case 'L':
  				datadir = xstrdup(optarg);
--- 2145,2155 ----
  				break;
  			case 'd':
  				debug = true;
!                 printf(_("Running in debug mode.\n"));
  				break;
  			case 'n':
  				noclean = true;
! 				printf(_("Running in noclean mode.  Mistakes will not be cleaned up.\n"));
  				break;
  			case 'L':
  				datadir = xstrdup(optarg);
***************
*** 2195,2201 ****
  				break;
  			default:
  				show_help = true;
! 				printf("Unrecognized option: %c\n", c);
  		}
  
  	}
--- 2189,2195 ----
  				break;
  			default:
  				show_help = true;
! 				printf(_("Unrecognized option: %c\n"), c);
  		}
  
  	}
***************
*** 2213,2225 ****
  	if (show_version)
  	{
  		/* hard coded name here, in case they rename executable */
! 		printf("initdb (PostgreSQL) %s\n", PG_VERSION);
  		exit(0);
  	}
  
  	if (show_help)
  	{
! 		usage();
  		exit(0);
  	}
  
--- 2207,2219 ----
  	if (show_version)
  	{
  		/* hard coded name here, in case they rename executable */
! 		printf(_("initdb (PostgreSQL) %s\n"), PG_VERSION);
  		exit(0);
  	}
  
  	if (show_help)
  	{
! 		usage(progname);
  		exit(0);
  	}
  
***************
*** 2234,2245 ****
  		else
  		{
  			fprintf(stderr,
! 					"%s: no data directory specified\n"
  					"You must identify the directory where the data "
  					"for this database system\n"
  					"will reside.  Do this with either the invocation "
  					"option -D or the\n"
! 					"environment variable PGDATA.\n",
  					progname);
  			exit(1);
  		}
--- 2228,2239 ----
  		else
  		{
  			fprintf(stderr,
! 					_("%s: no data directory specified\n"
  					"You must identify the directory where the data "
  					"for this database system\n"
  					"will reside.  Do this with either the invocation "
  					"option -D or the\n"
! 					"environment variable PGDATA.\n"),
  					progname);
  			exit(1);
  		}
***************
*** 2260,2275 ****
  	if (set_paths() != 0)
  	{
  		fprintf(stderr,
! 				"The program \"postgres\" is needed by %s "
  				"but was not found in \n"
! 				"the directory \"%s\". Check your installation.\n",
  				progname, bindir);
  		exit(1);
  	}
  
  	if ((short_version = get_short_version()) == NULL)
  	{
! 		fprintf(stderr, "%s: could not get valid short version\n", progname);
  		exit(1);
  	}
  
--- 2254,2269 ----
  	if (set_paths() != 0)
  	{
  		fprintf(stderr,
! 				_("The program \"postgres\" is needed by %s "
  				"but was not found in \n"
! 				"the directory \"%s\". Check your installation.\n"),
  				progname, bindir);
  		exit(1);
  	}
  
  	if ((short_version = get_short_version()) == NULL)
  	{
! 		fprintf(stderr, _("%s: could not get valid short version\n"), progname);
  		exit(1);
  	}
  
***************
*** 2295,2306 ****
  	if (show_setting || debug)
  	{
  		fprintf(stderr,
! 				"VERSION=%s\n"
  				"PGDATA=%s\ndatadir=%s\nPGPATH=%s\n"
  				"ENCODING=%s\nENCODINGID=%s\n"
  				"POSTGRES_SUPERUSERNAME=%s\nPOSTGRES_BKI=%s\n"
  				"POSTGRES_DESCR=%s\nPOSTGRESQL_CONF_SAMPLE=%s\n"
! 				"PG_HBA_SAMPLE=%s\nPG_IDENT_SAMPLE=%s\n",
  				PG_VERSION,
  				pg_data, datadir, pgpath,
  				encoding, encodingid,
--- 2289,2300 ----
  	if (show_setting || debug)
  	{
  		fprintf(stderr,
! 				_("VERSION=%s\n"
  				"PGDATA=%s\ndatadir=%s\nPGPATH=%s\n"
  				"ENCODING=%s\nENCODINGID=%s\n"
  				"POSTGRES_SUPERUSERNAME=%s\nPOSTGRES_BKI=%s\n"
  				"POSTGRES_DESCR=%s\nPOSTGRESQL_CONF_SAMPLE=%s\n"
! 				"PG_HBA_SAMPLE=%s\nPG_IDENT_SAMPLE=%s\n"),
  				PG_VERSION,
  				pg_data, datadir, pgpath,
  				encoding, encodingid,
***************
*** 2321,2329 ****
  	check_input(features_file);
  	check_input(system_views_file);
  
! 	printf("The files belonging to this database system will be owned "
  		   "by user \"%s\".\n"
! 		   "This user must also own the server process.\n\n",
  		   effective_user);
  
  	setlocales();
--- 2315,2323 ----
  	check_input(features_file);
  	check_input(system_views_file);
  
! 	printf(_("The files belonging to this database system will be owned "
  		   "by user \"%s\".\n"
! 		   "This user must also own the server process.\n\n"),
  		   effective_user);
  
  	setlocales();
***************
*** 2334,2351 ****
  		strcmp(lc_ctype, lc_monetary) == 0 &&
  		strcmp(lc_ctype, lc_messages) == 0)
  	{
! 		printf("The database cluster will be initialized with locale %s.\n\n",
  			   lc_ctype);
  	}
  	else
  	{
! 		printf("The database cluster will be initialized with locales\n"
  			   "  COLLATE:  %s\n"
  			   "  CTYPE:    %s\n"
  			   "  MESSAGES: %s\n"
  			   "  MONETARY: %s\n"
  			   "  NUMERIC:  %s\n"
! 			   "  TIME:     %s\n\n",
  			   lc_collate,
  			   lc_ctype,
  			   lc_messages,
--- 2328,2345 ----
  		strcmp(lc_ctype, lc_monetary) == 0 &&
  		strcmp(lc_ctype, lc_messages) == 0)
  	{
! 		printf(_("The database cluster will be initialized with locale %s.\n\n"),
  			   lc_ctype);
  	}
  	else
  	{
! 		printf(_("The database cluster will be initialized with locales\n"
  			   "  COLLATE:  %s\n"
  			   "  CTYPE:    %s\n"
  			   "  MESSAGES: %s\n"
  			   "  MONETARY: %s\n"
  			   "  NUMERIC:  %s\n"
! 			   "  TIME:     %s\n\n"),
  			   lc_collate,
  			   lc_ctype,
  			   lc_messages,
***************
*** 2384,2390 ****
  	{
  		case 0:
  			/* PGDATA not there, must create it */
! 			printf("creating directory %s ... ",
  				   pg_data);
  			fflush(stdout);
  
--- 2378,2384 ----
  	{
  		case 0:
  			/* PGDATA not there, must create it */
! 			printf(_("creating directory %s ... "),
  				   pg_data);
  			fflush(stdout);
  
***************
*** 2398,2404 ****
  
  		case 1:
  			/* Present but empty, fix permissions and use it */
! 			printf("fixing permissions on existing directory %s ... ",
  				   pg_data);
  			fflush(stdout);
  
--- 2392,2398 ----
  
  		case 1:
  			/* Present but empty, fix permissions and use it */
! 			printf(_("fixing permissions on existing directory %s ... "),
  				   pg_data);
  			fflush(stdout);
  
***************
*** 2416,2425 ****
  		case 2:
  			/* Present and not empty */
  			fprintf(stderr,
! 					"%s: directory \"%s\" exists but is not empty\n"
  					"If you want to create a new database system, either remove or empty\n"
  					"the directory \"%s\" or run %s\n"
! 					"with an argument other than \"%s\".\n",
  					progname, pg_data, pg_data, progname, pg_data);
  			exit(1);			/* no further message needed */
  
--- 2410,2419 ----
  		case 2:
  			/* Present and not empty */
  			fprintf(stderr,
! 					_("%s: directory \"%s\" exists but is not empty\n"
  					"If you want to create a new database system, either remove or empty\n"
  					"the directory \"%s\" or run %s\n"
! 					"with an argument other than \"%s\".\n"),
  					progname, pg_data, pg_data, progname, pg_data);
  			exit(1);			/* no further message needed */
  
***************
*** 2433,2439 ****
  
  	for (i = 0; i < (sizeof(subdirs) / sizeof(char *)); i++)
  	{
! 		printf("creating directory %s/%s ... ", pg_data, subdirs[i]);
  		fflush(stdout);
  
  		if (!mkdatadir(subdirs[i]))
--- 2427,2433 ----
  
  	for (i = 0; i < (sizeof(subdirs) / sizeof(char *)); i++)
  	{
! 		printf(_("creating directory %s/%s ... "), pg_data, subdirs[i]);
  		fflush(stdout);
  
  		if (!mkdatadir(subdirs[i]))
***************
*** 2491,2500 ****
  
  	make_template0();
  
! 	printf("\nSuccess. You can now start the database server using:\n\n"
  		   "    %s%s%s/postmaster -D %s%s%s\n"
  		   "or\n"
! 		   "    %s%s%s/pg_ctl -D %s%s%s -l logfile start\n\n",
  		 QUOTE_PATH, pgpath, QUOTE_PATH, QUOTE_PATH, pg_data, QUOTE_PATH,
  		QUOTE_PATH, pgpath, QUOTE_PATH, QUOTE_PATH, pg_data, QUOTE_PATH);
  
--- 2485,2494 ----
  
  	make_template0();
  
! 	printf(_("\nSuccess. You can now start the database server using:\n\n"
  		   "    %s%s%s/postmaster -D %s%s%s\n"
  		   "or\n"
! 		   "    %s%s%s/pg_ctl -D %s%s%s -l logfile start\n\n"),
  		 QUOTE_PATH, pgpath, QUOTE_PATH, QUOTE_PATH, pg_data, QUOTE_PATH,
  		QUOTE_PATH, pgpath, QUOTE_PATH, QUOTE_PATH, pg_data, QUOTE_PATH);
  
