# Common rules for Native Language Support (NLS) # # If some subdirectory of the source tree wants to provide NLS, it # needs to contain a file 'nls.mk' with the following make variable # assignments: # # CATALOG_NAME -- name of the message catalog (xxx.po); probably # name of the program # GETTEXT_FILES -- list of source files that contain message strings # GETTEXT_TRIGGERS -- (optional) list of functions that contain # translatable strings # GETTEXT_FLAGS -- (optional) list of gettext --flag arguments to mark # function arguments that contain C format strings # (functions must be listed in TRIGGERS and FLAGS) # # Also, provide a text file 'po/LINGUAS' with a space-separated list # of languages that are provided/supported. # # That's all, the rest is done here, if --enable-nls was specified. # # The only user-visible targets here are 'init-po', to make an initial # "blank" catalog from program sources, and 'update-po', which is to # be called if the messages in the program source have changed, in # order to merge the changes into the existing .po files.
# existence checked by Makefile.global; otherwise we won't get here include $(srcdir)/nls.mk
# 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)) else
LANGUAGES = $(AVAIL_LANGUAGES) endif
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# GETTEXT_FILES
po/$(CATALOG_NAME).pot: $(GETTEXT_FILES) $(MAKEFILE_LIST) # Change to srcdir explicitly, don't rely on $^. That way we get # consistent #: file references in the po files.
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# GETTEXT_FILES
@$(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
# catalog name extensions must match behavior of PG_TEXTDOMAIN() in c.h
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
# For languages not yet available, merge against oneself, to pick # up translations from the compendia. (Merging against /dev/null # doesn't work so well; it inserts the headers from the first-named # compendium.)
po/%.po.new: po/$(CATALOG_NAME).pot $(all_compendia)
$(MSGMERGE) --lang=$* $(word 1,$^) $(word 1,$^) -o $@ $(addprefix --compendium=,$(filter %/$*.po,$(wordlist 2,$(words $^),$^)))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.