Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a5a843

Browse files
committed
Refactor common gettext triggers
Put gettext trigger words that are common to the backend and backend modules into a makefile variable to include everywhere, to avoid error-prone repetitions.
1 parent e8e2fba commit 7a5a843

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

src/backend/nls.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
CATALOG_NAME = postgres
33
AVAIL_LANGUAGES = de es fr ja pt_BR tr zh_CN zh_TW
44
GETTEXT_FILES = + gettext-files
5-
GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log \
6-
errdetail_plural:1,2 errhint errcontext \
5+
GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) \
76
GUC_check_errmsg GUC_check_errdetail GUC_check_errhint \
87
write_stderr yyerror parser_yyerror
98

src/nls-global.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ endif
4343
GETTEXT_TRIGGERS += _
4444

4545

46+
# common settings that apply to backend and all backend modules
47+
BACKEND_COMMON_GETTEXT_TRIGGERS = \
48+
errmsg errmsg_plural:1,2 \
49+
errdetail errdetail_log errdetail_plural:1,2 \
50+
errhint \
51+
errcontext
52+
53+
4654
all-po: $(MO_FILES)
4755

4856
%.mo: %.po

src/pl/plperl/nls.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
CATALOG_NAME = plperl
33
AVAIL_LANGUAGES = de es fr it ja pt_BR ro tr zh_CN zh_TW
44
GETTEXT_FILES = plperl.c SPI.c
5-
GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log errdetail_plural:1,2 errhint errcontext
5+
GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS)

src/pl/plpgsql/src/nls.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
CATALOG_NAME = plpgsql
33
AVAIL_LANGUAGES = de es fr it ja ko pt_BR ro zh_CN zh_TW
44
GETTEXT_FILES = pl_comp.c pl_exec.c pl_gram.c pl_funcs.c pl_handler.c pl_scanner.c
5-
GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log errdetail_plural:1,2 errhint errcontext yyerror plpgsql_yyerror
5+
GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) yyerror plpgsql_yyerror

src/pl/plpython/nls.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
CATALOG_NAME = plpython
33
AVAIL_LANGUAGES = de es fr it ja pt_BR ro tr zh_CN zh_TW
44
GETTEXT_FILES = plpython.c
5-
GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log errdetail_plural:1,2 errhint errcontext PLy_elog:2 PLy_exception_set:2 PLy_exception_set_plural:2,3
5+
GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) PLy_elog:2 PLy_exception_set:2 PLy_exception_set_plural:2,3

src/pl/tcl/nls.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
CATALOG_NAME = pltcl
33
AVAIL_LANGUAGES = de es fr it ja pt_BR ro tr zh_CN zh_TW
44
GETTEXT_FILES = pltcl.c
5-
GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log errdetail_plural:1,2 errhint errcontext
5+
GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS)

0 commit comments

Comments
 (0)