diff options
Diffstat (limited to 'po')
-rw-r--r-- | po/ChangeLog | 26 | ||||
-rw-r--r-- | po/Makefile.in.in | 107 | ||||
-rw-r--r-- | po/Makevars | 8 | ||||
-rw-r--r-- | po/Rules-quot | 42 | ||||
-rw-r--r-- | po/boldquot.sed | 10 | ||||
-rw-r--r-- | po/en@boldquot.header | 25 | ||||
-rw-r--r-- | po/en@quot.header | 22 | ||||
-rw-r--r-- | po/insert-header.sin | 23 | ||||
-rw-r--r-- | po/quot.sed | 6 |
9 files changed, 223 insertions, 46 deletions
diff --git a/po/ChangeLog b/po/ChangeLog index 71dc4c8..b1b518f 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,29 @@ +2001-11-25 Bruno Haible <bruno@clisp.org> + + * Makevars: New file. + * quot.sed: New file. + * boldquot.sed: New file. + * en@quot.header: New file. + * en@boldquot.header: New file. + * insert-header.sin: Mew file. + * Rules-quot: New file. + * Makefile.in.in: Use $(DOMAIN) instead of $(PACKAGE) almost + everywhere. + (subdir, top_builddir): Move to Makevars. + (MSGINIT): New variable. + (MSGCONV): New variable. + (MSGEXEC): New variable. + (UPDATEPOFILES): New variable. + (DUMMYPOFILES): New variable. + (DISTFILES.common): New variable. + (DISTFILES): Use it. + (.SUFFIXES): Add .nop, .po-update. + (install-data): Install all of $(DISTFILES.common). + (uninstall-data): Uninstall all of $(DISTFILES.common). + (update-po): Split into a Makefile rule for each PO file update. + (.nop.po-update): New rule, extracted from update-po. + ($(DUMMYPOFILES)): New trivial rules. + 2001-11-15 Bruno Haible <haible@clisp.cons.org> * sv.po: Update from Jan Djärv <Jan.Djarv@mbox200.swipnet.se>. diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 60c55b3..a2f547b 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -1,4 +1,4 @@ -# Makefile for program source directory in GNU NLS utilities package. +# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu> # # This file can be copied and used freely without restrictions. It can @@ -11,10 +11,6 @@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - SHELL = /bin/sh @SET_MAKE@ @@ -38,18 +34,28 @@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGEXEC = msgexec POFILES = @POFILES@ GMOFILES = @GMOFILES@ -DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \ -$(POFILES) $(GMOFILES) +UPDATEPOFILES = @UPDATEPOFILES@ +DUMMYPOFILES = @DUMMYPOFILES@ +DISTFILES.common = Makefile.in.in Makevars \ +$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) +DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ +# Makevars gets inserted here. (Don't remove this line!) + .SUFFIXES: -.SUFFIXES: .po .gmo .mo +.SUFFIXES: .po .gmo .mo .nop .po-update .po.mo: $(MSGFMT) -c -o $@ $< @@ -66,23 +72,23 @@ all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: -# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot', +# Note: Target 'all' must not depend on target '$(srcdir)/$(DOMAIN).pot', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. -$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in - $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ +$(srcdir)/$(DOMAIN).pot: $(POTFILES) $(srcdir)/POTFILES.in + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: --keyword=_ --keyword=N_ \ --files-from=$(srcdir)/POTFILES.in \ - && test ! -f $(PACKAGE).po \ - || ( rm -f $(srcdir)/$(PACKAGE).pot \ - && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) + && test ! -f $(DOMAIN).po \ + || ( rm -f $(srcdir)/$(DOMAIN).pot \ + && mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot ) $(POFILES): force @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(PACKAGE).pot"; \ - cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(PACKAGE).pot + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot install: install-exec install-data @@ -90,8 +96,10 @@ install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ - $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ + for file in $(DISTFILES.common); do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ else \ : ; \ fi @@ -105,12 +113,12 @@ install-data-yes: all dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then \ - $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ - echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \ + $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$cat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ else \ - $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ + $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $(srcdir)/$$cat as" \ - "$(DESTDIR)$$dir/$(PACKAGE).mo"; \ + "$(DESTDIR)$$dir/$(DOMAIN).mo"; \ fi; \ done @@ -142,7 +150,9 @@ uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext"; then \ - rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ + for file in $(DISTFILES.common); do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ else \ : ; \ fi @@ -152,7 +162,7 @@ uninstall-data-yes: for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ - rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo; \ done check: all @@ -160,7 +170,7 @@ check: all dvi info tags TAGS ID: mostlyclean: - rm -f core core.* $(PACKAGE).po *.new.po + rm -f core core.* $(DOMAIN).po *.new.po rm -fr *.o clean: mostlyclean @@ -191,32 +201,37 @@ dist2: $(DISTFILES) done update-po: Makefile - $(MAKE) $(PACKAGE).pot + $(MAKE) $(DOMAIN).pot + $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ - catalogs='$(GMOFILES)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ - echo "$$lang:"; \ - if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \ - if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ - rm -f $$tmpdir/$$lang.new.po; \ - else - if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ - :; \ - else \ - echo "msgmerge for $$cat failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ - exit 1; \ - fi; \ - fi; \ - else \ - echo "msgmerge for $$cat failed!" 1>&2; \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ fi; \ - done - $(MAKE) update-gmo + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: diff --git a/po/Makevars b/po/Makevars new file mode 100644 index 0000000..f831426 --- /dev/null +++ b/po/Makevars @@ -0,0 +1,8 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. diff --git a/po/Rules-quot b/po/Rules-quot new file mode 100644 index 0000000..b0cbb7e --- /dev/null +++ b/po/Rules-quot @@ -0,0 +1,42 @@ +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGEXEC) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff --git a/po/boldquot.sed b/po/boldquot.sed new file mode 100644 index 0000000..4b937aa --- /dev/null +++ b/po/boldquot.sed @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“[1m/g +s/”/[0m”/g +s/‘/‘[1m/g +s/’/[0m’/g diff --git a/po/en@boldquot.header b/po/en@boldquot.header new file mode 100644 index 0000000..fedb6a0 --- /dev/null +++ b/po/en@boldquot.header @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff --git a/po/en@quot.header b/po/en@quot.header new file mode 100644 index 0000000..a9647fc --- /dev/null +++ b/po/en@quot.header @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff --git a/po/insert-header.sin b/po/insert-header.sin new file mode 100644 index 0000000..b26de01 --- /dev/null +++ b/po/insert-header.sin @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/po/quot.sed b/po/quot.sed new file mode 100644 index 0000000..0122c46 --- /dev/null +++ b/po/quot.sed @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g |