OSDN Git Service

Refactor common gettext triggers
authorPeter Eisentraut <peter_e@gmx.net>
Sun, 26 Jun 2011 20:50:21 +0000 (23:50 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Sun, 26 Jun 2011 21:04:15 +0000 (00:04 +0300)
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.

src/backend/nls.mk
src/nls-global.mk
src/pl/plperl/nls.mk
src/pl/plpgsql/src/nls.mk
src/pl/plpython/nls.mk
src/pl/tcl/nls.mk

index 8d83c41..7672d67 100644 (file)
@@ -2,8 +2,7 @@
 CATALOG_NAME     = postgres
 AVAIL_LANGUAGES  = de es fr ja pt_BR tr zh_CN zh_TW
 GETTEXT_FILES    = + gettext-files
-GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log \
-    errdetail_plural:1,2 errhint errcontext \
+GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) \
     GUC_check_errmsg GUC_check_errdetail GUC_check_errhint \
     write_stderr yyerror parser_yyerror
 
index 784e69a..dda3e29 100644 (file)
@@ -43,6 +43,14 @@ endif
 GETTEXT_TRIGGERS += _
 
 
+# common settings that apply to backend and all backend modules
+BACKEND_COMMON_GETTEXT_TRIGGERS = \
+    errmsg errmsg_plural:1,2 \
+    errdetail errdetail_log errdetail_plural:1,2 \
+    errhint \
+    errcontext
+
+
 all-po: $(MO_FILES)
 
 %.mo: %.po
index 589795c..57846d1 100644 (file)
@@ -2,4 +2,4 @@
 CATALOG_NAME     = plperl
 AVAIL_LANGUAGES  = de es fr it ja pt_BR ro tr zh_CN zh_TW
 GETTEXT_FILES    = plperl.c SPI.c
-GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log errdetail_plural:1,2 errhint errcontext
+GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS)
index c21dbe0..98f25ea 100644 (file)
@@ -2,4 +2,4 @@
 CATALOG_NAME     = plpgsql
 AVAIL_LANGUAGES  = de es fr it ja ko pt_BR ro zh_CN zh_TW
 GETTEXT_FILES    = pl_comp.c pl_exec.c pl_gram.c pl_funcs.c pl_handler.c pl_scanner.c
-GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log errdetail_plural:1,2 errhint errcontext yyerror plpgsql_yyerror
+GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) yyerror plpgsql_yyerror
index dcdf619..0fdd234 100644 (file)
@@ -2,4 +2,4 @@
 CATALOG_NAME     = plpython
 AVAIL_LANGUAGES  = de es fr it ja pt_BR ro tr zh_CN zh_TW
 GETTEXT_FILES    = plpython.c
-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
+GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) PLy_elog:2 PLy_exception_set:2 PLy_exception_set_plural:2,3
index 941a758..be95c15 100644 (file)
@@ -2,4 +2,4 @@
 CATALOG_NAME     = pltcl
 AVAIL_LANGUAGES  = de es fr it ja pt_BR ro tr zh_CN zh_TW
 GETTEXT_FILES    = pltcl.c
-GETTEXT_TRIGGERS = errmsg errmsg_plural:1,2 errdetail errdetail_log errdetail_plural:1,2 errhint errcontext
+GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS)