From a4d5f001880d057e8692cfad49abf4a87096a88c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 19 Nov 2025 10:13:28 +0100 Subject: [PATCH] Create English message catalog for testing --- src/Makefile.global.in | 2 +- src/nls-global.mk | 11 ++++++++++- src/test/regress/pg_regress.c | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 0aa389bc710..63b25cd8db6 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -439,7 +439,7 @@ ifeq ($(MAKELEVEL),0) $(MAKE) -C '$(top_builddir)' DESTDIR='$(abs_top_builddir)'/tmp_install install >'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1 $(MAKE) -j1 $(if $(CHECKPREP_TOP),-C $(CHECKPREP_TOP),) checkprep >>'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1 - $(with_temp_install) initdb --auth trust --no-sync --no-instructions --lc-messages=C --no-clean '$(abs_top_builddir)'/tmp_install/initdb-template >>'$(abs_top_builddir)'/tmp_install/log/initdb-template.log 2>&1 + $(with_temp_install) initdb --auth trust --no-sync --no-instructions --lc-messages=en_US.UTF-8 --no-clean '$(abs_top_builddir)'/tmp_install/initdb-template >>'$(abs_top_builddir)'/tmp_install/log/initdb-template.log 2>&1 endif endif endif diff --git a/src/nls-global.mk b/src/nls-global.mk index 73a6db10a1d..481a50af701 100644 --- a/src/nls-global.mk +++ b/src/nls-global.mk @@ -34,7 +34,7 @@ AVAIL_LANGUAGES := $(shell cat $(srcdir)/po/LINGUAS) # If user specified the languages he wants in --enable-nls=LANGUAGES, # filter out the rest. Else use all available ones. ifdef WANTED_LANGUAGES -LANGUAGES = $(filter $(WANTED_LANGUAGES), $(AVAIL_LANGUAGES)) +LANGUAGES = $(filter $(WANTED_LANGUAGES), $(AVAIL_LANGUAGES) en) else LANGUAGES = $(AVAIL_LANGUAGES) endif @@ -51,6 +51,11 @@ ifdef MSGMERGE MSGMERGE += --no-wrap --previous --sort-by-file endif +MSGEN = msgen +ifdef MSGEN +MSGEN += --no-wrap --sort-by-file +endif + # _ is defined in c.h, so it's global GETTEXT_TRIGGERS += _ GETTEXT_FLAGS += _:1:pass-c-format @@ -90,6 +95,10 @@ FRONTEND_COMMON_GETTEXT_FLAGS = \ all-po: $(MO_FILES) +po/en.po: po/$(CATALOG_NAME).pot + $(MSGEN) --lang=en -o $@.tmp $< + sed -e '/Plural-Forms:/s/INTEGER/2/' -e '/Plural-Forms:/s/EXPRESSION/(n != 1)/' $@.tmp > $@ + %.mo: %.po $(MSGFMT) $(MSGFMT_FLAGS) -o $@ $< diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index efc41fca2ba..0d32bc44335 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -768,8 +768,9 @@ initialize_environment(void) * is actually called.) */ unsetenv("LANGUAGE"); + setenv("LANGUAGE", "en", 1); unsetenv("LC_ALL"); - setenv("LC_MESSAGES", "C", 1); + setenv("LC_MESSAGES", "en_US.UTF-8", 1); /* * Set encoding as requested -- 2.51.0