| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| |
| include $(srcdir)/nls.mk |
|
|
| AVAIL_LANGUAGES := $(shell cat $(srcdir)/po/LINGUAS) |
|
|
| |
| |
| ifdef WANTED_LANGUAGES |
| LANGUAGES = $(filter $(WANTED_LANGUAGES), $(AVAIL_LANGUAGES)) |
| else |
| LANGUAGES = $(AVAIL_LANGUAGES) |
| endif |
|
|
| PO_FILES = $(addprefix po/, $(addsuffix .po, $(LANGUAGES))) |
| ALL_PO_FILES = $(addprefix po/, $(addsuffix .po, $(AVAIL_LANGUAGES))) |
| MO_FILES = $(addprefix po/, $(addsuffix .mo, $(LANGUAGES))) |
|
|
| ifdef XGETTEXT |
| XGETTEXT += -ctranslator --copyright-holder='PostgreSQL Global Development Group' --msgid-bugs-address=pgsql-bugs@lists.postgresql.org --no-wrap --sort-by-file --package-name='$(CATALOG_NAME) (PostgreSQL)' --package-version='$(MAJORVERSION)' |
| endif |
|
|
| ifdef MSGMERGE |
| MSGMERGE += --no-wrap --previous --sort-by-file |
| endif |
|
|
| |
| GETTEXT_TRIGGERS += _ |
| GETTEXT_FLAGS += _:1:pass-c-format |
|
|
|
|
| |
| BACKEND_COMMON_GETTEXT_TRIGGERS = \ |
| $(FRONTEND_COMMON_GETTEXT_TRIGGERS) \ |
| errmsg errmsg_plural:1,2 \ |
| errdetail errdetail_log errdetail_plural:1,2 \ |
| errhint errhint_plural:1,2 \ |
| errcontext \ |
| XactLockTableWait:4 \ |
| MultiXactIdWait:6 \ |
| ConditionalMultiXactIdWait:6 |
| BACKEND_COMMON_GETTEXT_FLAGS = \ |
| $(FRONTEND_COMMON_GETTEXT_FLAGS) \ |
| errmsg:1:c-format errmsg_plural:1:c-format errmsg_plural:2:c-format \ |
| errdetail:1:c-format errdetail_log:1:c-format errdetail_plural:1:c-format errdetail_plural:2:c-format \ |
| errhint:1:c-format errhint_plural:1:c-format errhint_plural:2:c-format \ |
| errcontext:1:c-format |
|
|
| FRONTEND_COMMON_GETTEXT_FILES = $(top_srcdir)/src/common/logging.c |
|
|
| FRONTEND_COMMON_GETTEXT_TRIGGERS = \ |
| pg_log_error pg_log_error_detail pg_log_error_hint \ |
| pg_log_warning pg_log_warning_detail pg_log_warning_hint \ |
| pg_log_info pg_log_info_detail pg_log_info_hint \ |
| pg_fatal pg_log_generic:3 pg_log_generic_v:3 |
|
|
| FRONTEND_COMMON_GETTEXT_FLAGS = \ |
| pg_log_error:1:c-format pg_log_error_detail:1:c-format pg_log_error_hint:1:c-format \ |
| pg_log_warning:1:c-format pg_log_warning_detail:1:c-format pg_log_warning_hint:1:c-format \ |
| pg_log_info:1:c-format pg_log_info_detail:1:c-format pg_log_info_hint:1:c-format \ |
| pg_fatal:1:c-format pg_log_generic:3:c-format pg_log_generic_v:3:c-format |
|
|
|
|
| all-po: $(MO_FILES) |
|
|
| %.mo: %.po |
| $(MSGFMT) $(MSGFMT_FLAGS) -o $@ $< |
|
|
| ifeq ($(word 1,$(GETTEXT_FILES)),+) |
| po/$(CATALOG_NAME).pot: $(word 2, $(GETTEXT_FILES)) $(MAKEFILE_LIST) |
| ifdef XGETTEXT |
| $(XGETTEXT) -D $(srcdir) -D . -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) -f $< |
| else |
| @echo "You don't have 'xgettext'."; exit 1 |
| endif |
| else |
| po/$(CATALOG_NAME).pot: $(GETTEXT_FILES) $(MAKEFILE_LIST) |
| |
| |
| ifdef XGETTEXT |
| $(XGETTEXT) -D $(srcdir) -D . -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) $(GETTEXT_FILES) |
| else |
| @echo "You don't have 'xgettext'."; exit 1 |
| endif |
| endif |
| @$(MKDIR_P) $(dir $@) |
| sed -e '1,18 { s/SOME DESCRIPTIVE TITLE./LANGUAGE message translation file for $(CATALOG_NAME)/;s/PACKAGE/PostgreSQL/g;s/VERSION/$(MAJORVERSION)/g;s/YEAR/'`date +%Y`'/g; }' messages.po >$@ |
| rm messages.po |
|
|
|
|
| |
| install-po: all-po installdirs-po |
| ifneq (,$(LANGUAGES)) |
| for lang in $(LANGUAGES); do \ |
| $(INSTALL_DATA) po/$$lang.mo '$(DESTDIR)$(localedir)'/$$lang/LC_MESSAGES/$(CATALOG_NAME)$(SO_MAJOR_VERSION)-$(MAJORVERSION).mo || exit 1; \ |
| done |
| endif |
|
|
| installdirs-po: |
| $(if $(LANGUAGES),$(MKDIR_P) $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES),:) |
|
|
| uninstall-po: |
| $(if $(LANGUAGES),rm -f $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES/$(CATALOG_NAME)$(SO_MAJOR_VERSION)-$(MAJORVERSION).mo),:) |
|
|
|
|
| clean-po: |
| $(if $(MO_FILES),rm -f $(MO_FILES)) |
| @$(if $(wildcard po/*.po.new),rm -f po/*.po.new) |
| rm -f po/$(CATALOG_NAME).pot |
|
|
|
|
| init-po: po/$(CATALOG_NAME).pot |
|
|
|
|
| |
| |
| ifneq (,$(filter update-po %.po.new,$(MAKECMDGOALS))) |
| ALL_LANGUAGES := $(shell find $(top_srcdir) -name '*.po' -print | sed 's,^.*/\([^/]*\).po$$,\1,' | LC_ALL=C sort -u) |
| all_compendia := $(shell find $(top_srcdir) -name '*.po' -print | LC_ALL=C sort) |
| else |
| ALL_LANGUAGES = $(AVAIL_LANGUAGES) |
| all_compendia = FORCE |
| FORCE: |
| endif |
|
|
| ifdef WANTED_LANGUAGES |
| ALL_LANGUAGES := $(filter $(WANTED_LANGUAGES), $(ALL_LANGUAGES)) |
| endif |
|
|
| update-po: $(ALL_LANGUAGES:%=po/%.po.new) |
|
|
| $(AVAIL_LANGUAGES:%=po/%.po.new): po/%.po.new: po/%.po po/$(CATALOG_NAME).pot $(all_compendia) |
| $(MSGMERGE) --lang=$* $(word 1, $^) $(word 2,$^) -o $@ $(addprefix --compendium=,$(filter %/$*.po,$(wordlist 3,$(words $^),$^))) |
|
|
| |
| |
| |
| |
| po/%.po.new: po/$(CATALOG_NAME).pot $(all_compendia) |
| $(MSGMERGE) --lang=$* $(word 1,$^) $(word 1,$^) -o $@ $(addprefix --compendium=,$(filter %/$*.po,$(wordlist 2,$(words $^),$^))) |
|
|
|
|
| all: all-po |
| install: install-po |
| installdirs: installdirs-po |
| uninstall: uninstall-po |
| clean distclean: clean-po |
|
|
| .PHONY: all-po install-po installdirs-po uninstall-po clean-po \ |
| init-po update-po |
|
|