Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20aaf64

Browse files
committed
Allow translation of SQL help in psql.
1 parent241cea1 commit20aaf64

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

‎src/bin/psql/create_help.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Copyright (c) 2000-2003, PostgreSQL Global Development Group
77
#
8-
# $Header: /cvsroot/pgsql/src/bin/psql/create_help.pl,v 1.8 2003/08/04 23:59:40 tgl Exp $
8+
# $Header: /cvsroot/pgsql/src/bin/psql/create_help.pl,v 1.9 2003/09/14 22:37:12 petere Exp $
99
#################################################################
1010

1111
#
@@ -51,6 +51,8 @@
5151
#ifndef$define
5252
#define$define
5353
54+
#define N_(x) (x) /* gettext noop */
55+
5456
struct _helpStruct
5557
{
5658
char *cmd; /* the command name */
@@ -110,7 +112,7 @@
110112
$cmdsynopsis =~s/\n/\\n/g;
111113
$cmdsynopsis =~s/\"/\\"/g;
112114

113-
print OUT" {\"$cmdname\",\n\"$cmddesc\",\n\"$cmdsynopsis\" },\n\n";
115+
print OUT" {\"$cmdname\",\nN_(\"$cmddesc\"),\nN_(\"$cmdsynopsis\") },\n\n";
114116
$count++;
115117
}
116118
else {

‎src/bin/psql/help.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.79 2003/09/11 16:22:42 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.80 2003/09/1422:37:13 petere Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -338,9 +338,11 @@ helpSQL(const char *topic, unsigned short int pager)
338338
{
339339
help_found= true;
340340
fprintf(output,_("Command: %s\n"
341-
"Description: %s\n"
342-
"Syntax:\n%s\n\n"),
343-
QL_HELP[i].cmd,QL_HELP[i].help,QL_HELP[i].syntax);
341+
"Description: %s\n"
342+
"Syntax:\n%s\n\n"),
343+
QL_HELP[i].cmd,
344+
gettext(QL_HELP[i].help),
345+
gettext(QL_HELP[i].syntax));
344346
/* If we have an exact match, exit. Fixes \h SELECT */
345347
if (strcasecmp(topic,QL_HELP[i].cmd)==0)
346348
break;

‎src/bin/psql/nls.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# $Header: /cvsroot/pgsql/src/bin/psql/nls.mk,v 1.9 2003/08/24 21:18:52 petere Exp $
1+
# $Header: /cvsroot/pgsql/src/bin/psql/nls.mk,v 1.10 2003/09/14 22:37:13 petere Exp $
22
CATALOG_NAME:= psql
33
AVAIL_LANGUAGES:= cs de es fr hu ru sv zh_CN zh_TW
44
GETTEXT_FILES:= command.c common.c copy.c help.c input.c large_obj.c\
5-
mainloop.c print.c startup.c describe.c
6-
GETTEXT_TRIGGERS:= _ psql_error simple_prompt
5+
mainloop.c print.c startup.c describe.c sql_help.h
6+
GETTEXT_TRIGGERS:= _N_psql_error simple_prompt

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp