Daiki Ueno [Fri, 2 May 2014 06:58:04 +0000 (15:58 +0900)]
xgettext: Factor out commonly used mixed_string_buffer
* x-python.c (init_mixed_string_buffer)
(mixed_string_buffer_append_byte)
(mixed_string_buffer_append_unicode_grow)
(mixed_string_buffer_append_unicode)
(mixed_string_buffer_flush_utf16_surr)
(mixed_string_buffer_flush_curr_buffer)
(mixed_string_buffer_append, mixed_string_buffer_result)
(free_mixed_string_buffer): Move to...
* xgettext.c: ...here.
(mixed_string_buffer_alloc): Rename from init_mixed_string_buffer.
(mixed_string_buffer_append_to_curr_buffer): Rename from
mixed_string_buffer_append_byte.
(mixed_string_buffer_append_to_utf8_buffer): Rename from
mixed_string_buffer_append_unicode.
(mixed_string_buffer_grow_utf8_buffer): Rename from
mixed_string_buffer_append_unicode_grow.
(mixed_string_buffer_append_char): Split from
mixed_string_buffer_append.
(mixed_string_buffer_append_unicode): Split from
mixed_string_buffer_append.
(mixed_string_buffer_done): New function merging
mixed_string_buffer_result and free_mixed_string_buffer.
* xgettext.h (mixed_string_buffer): New struct moved from
x-python.c; add logical_file_name and line_number fields.
(mixed_string_buffer_alloc): New function declaration.
(mixed_string_buffer_append_char): New function declaration.
(mixed_string_buffer_append_unicode): New function declaration.
(mixed_string_buffer_done): New function declaration.
* x-javascript.c (init_mixed_string_buffer)
(mixed_string_buffer_append_byte)
(mixed_string_buffer_append_unicode_grow)
(mixed_string_buffer_append_unicode)
(mixed_string_buffer_flush_utf16_surr)
(mixed_string_buffer_flush_curr_buffer)
(mixed_string_buffer_append, mixed_string_buffer_result)
(free_mixed_string_buffer): Remove.
Daiki Ueno [Thu, 1 May 2014 23:43:17 +0000 (08:43 +0900)]
Makefile.in.in: Turn {POFILES,DISTFILES}DEPS into yes/no options
Preserve the previous behavior even if a user forgot to update
Makevars, after calling autopoint.
* Makevars (PO_DEPENDS_ON_POT): Rename from POFILESDEPS and turn
it into a yes/no option.
(DIST_DEPENDS_ON_POT): Rename from DISTFILESDEPS and turn it into
a yes/no option.
Daiki Ueno [Thu, 1 May 2014 09:26:33 +0000 (18:26 +0900)]
Makefile.in.in: Add an option to claim the package as GNU/non-GNU
Reporeted by David Shea at:
<https://savannah.gnu.org/bugs/?40520>.
* Makevars (PACKAGE_GNU): New variable.
* Makefile.in.in ($(DOMAIN).pot-update): Don't search for "GNU
packagename" if $(PACKAGE_GNU) is set.
Daiki Ueno [Thu, 1 May 2014 04:39:23 +0000 (13:39 +0900)]
Makefile.in.in: Make dependencies of a PO file and 'dist' customizable
* Makevars (POFILESDEPS): New variable.
(DISTFILESDEPS): New variable.
* Makefile.in.in ($(POFILES)): Depend on $(POFILESDEPS) instead of
$(srcdir)/$(DOMAIN).pot.
(dist distdir): Run $(DISTFILEDEPS) instead of 'update-po'.
Suggested by Andreas Stricker in:
<https://lists.gnu.org/archive/html/bug-gettext/2014-04/msg00020.html>.
* configure.ac (maintainer-update-po): New recursive rule.
* update-po.sh: Remove.
* autogen.sh: Don't mention update-po.sh.
* Makefile.am (maintainer-update-po-local): New rule.
* gettext-runtime/Makefile.am (maintainer-update-po): New rule.
* gettext-runtime/man/Makefile.am (update-man1): Remove; add explicit
dependency on the executable to each .1 rule.
* gettext-tools/man/Makefile.am (update-man1): Remove; add explicit
dependency on the executable to each .1 rule.
* gettext-tools/examples/hello-c-gnome3/hello.gresource.xml: Rename
from org.gnu.gettext.examples.hello.gresource.xml.
* gettext-tools/examples/hello-c-gnome3/hello-gschema.xml: Rename
from org.gnu.gettext.examples.hello.gschema.xml.
* gettext-tools/examples/hello-c-gnome3/po/POTFILES.in: Adjust the
file name change.
* gettext-tools/examples/hello-c-gnome3/po/Makefile.am: Adjust the
file name change.
* gettext-tools/examples/Makefile.am: Adjust the file name change.
* gettext-tools/examples/po/Makefile.am: Adjust the file name change.
* gettext-runtime/intl/plural.y: Don't use removed YYLEX_PARAM and
YYPARSE_PARAM macros; replace deprecated %pure_parser with
'%define api.pure full'; adjust yylex/yyerror arglist.
* gettext-runtime/intl/plural-exp.h (PLURAL_PARSE): Use explicit type
'struct parse_args *arg' for ARG.
autopoint: Unset variables known to interfere with common tools
Reported by Jan Cholasta at:
<https://bugzilla.redhat.com/show_bug.cgi?id=801374>.
* autopoint.in: Unset CDPATH, CLICOLOR_FORCE, and GREP_OPTIONS.
* gettextize.in: Unset CLICOLOR_FORCE and GREP_OPTIONS.
2013-04-28 Peter Rosin <peda@lysator.liu.se>
libtool: break all the way out when a good nm is found
* m4/libtool.m4 (LT_PATH_NM): Break all the way out on a good
match.
Reported by Benjamin Gilbert at:
<https://savannah.gnu.org/bugs/?41203>
With recent libtool, this patch did nothing but fixing the output
message of configure.
* m4/libtool.m4: Remove the special handling of NM detection when
cross-compiling mingw32 on cygwin.
examples: Quote shell variables in hello-java*/configure
When running from xsmallpot.sh, embedded shell-script snippets are
stripped off from configure.ac and some variables are not set.
Make sure to quote them to avoid error.
* hello-java/configure.ac: Quote $BUILDJAVA.
* hello-java-awt/configure.ac: Quote $BUILDJAVAEXE and $BUILDJAVA.
* hello-java-qtjambi/configure.ac: Likewise.
* hello-java-swing/configure.ac: Likewise.
autogen.sh: Use included gettext-tools for bootstrap
To regenerate POT files, autogen.sh had an implicit dependency on
gettext-tools installed on system. This prohibited to use any new
features in our examples. Let autogen.sh use included version of
gettext-tools, by prepending $builddir to the PATH.
examples: Don't error out from configure in hello-c-gnome3
The configure script shouldn't fail even if there is a fatal
error, to allow the toplevel autogen.sh to regenerate POT files.
* hello-c-gnome3/configure.ac: Don't error out, but warn user.
Daiki Ueno [Mon, 24 Mar 2014 09:43:01 +0000 (18:43 +0900)]
Extend --add-location option to suppress line number output
The --add-location option of msgattrib, msgcat, msgcomm, msgconv,
msgen, msgfilter, msggrep, msgmerge, msguniq, and xgettext
commands now takes an optional argument 'never', 'full', or
'file', to control the format of "#: ..." comments.
The default catalog reader changed to always remember file
positions so the line number part can be suppressed in output
phase rather than input phase.
Daiki Ueno [Mon, 10 Mar 2014 09:28:44 +0000 (18:28 +0900)]
php: Recognize single and double quotes around heredoc label
Problem reported by Byrial Jensen in:
<https://lists.gnu.org/archive/html/bug-gettext/2012-04/msg00001.html>.
Based on the patch by Andreas Stricker posted as:
<https://lists.gnu.org/archive/html/bug-gettext/2012-04/msg00002.html>.
Roumen Petrov [Sun, 12 Jan 2014 19:37:30 +0000 (21:37 +0200)]
tests: fix "make check" under VPATH builds
Previously, we generated init.cfg in $builddir, while tests/init.sh
reads its configuration file (init.cfg) from $srcdir. This patch
moves the auto-generated part into a separate file
($builddir/init-env) and read the file from $srcdir/init.cfg.
Daiki Ueno [Thu, 5 Dec 2013 09:47:46 +0000 (18:47 +0900)]
autopoint: Allow user to specify custom autom4te executable
* autopoint.in (func_trace): Allow user to specify autom4te
executable name through $AUTOM4TE envvar.
* gettextize.in (func_trace): Likewise.
Suggested by Eric Blake at
<https://lists.gnu.org/archive/html/bug-gettext/2013-12/msg00006.html>.
Daiki Ueno [Wed, 20 Nov 2013 03:41:20 +0000 (12:41 +0900)]
xgettext: Add E4X support to JavaScript scanner
Reported by Piotr Drąg at: <https://savannah.gnu.org/bugs/?40125>.
* src/xgettext.h (enum lexical_context_ty): New enumeration items
lc_xml_open_tag, lc_xml_close_tag, lc_xml_content.
* src/x-javascript.c (phase5_scan_xml_markup): New
function.
(phase5_get): Handle '<', '>', '/', '=', '{', and '}' specially
to support E4X.
(enum token_type_ty): New enumeration item token_type_equal.
(xml_element_depth): New variable.
(inside_embedded_in_xml): New variable.
(extract_javascript): Initialize those variables.
* tests/Makefile.am (TESTS): Add xgettext-javascript-6.
* tests/xgettext-javascript-6: New file.
Daiki Ueno [Tue, 19 Nov 2013 03:08:10 +0000 (12:08 +0900)]
autopoint: disable m4_include and m4_esyscmd when tracing
* autopoint.in (func_trace): Disable m4_include and m4_esyscmd.
* gettextize.in (func_trace): Likewise.
Reported by Bernhard Voelker in
<https://lists.gnu.org/archive/html/bug-gettext/2013-11/msg00011.html>
and suggested by Eric Blake at <https://savannah.gnu.org/bugs/?40083>.
Daiki Ueno [Thu, 14 Nov 2013 07:10:03 +0000 (16:10 +0900)]
javascript: fix translator comment extraction in C++-style comments
* src/x-javascript.c (phase3_getc): Make sure to call comment_line_end
after parsing C++ style comment line.
Reported by Illimar Tambek at: <http://savannah.gnu.org/bugs/?40572>.
* tests/xgettext-javascript-1: Add a test to extract translator comments
from C++ style comment lines; only extract comments with
TRANSLATORS: tag.
* tests/xgettext-javascript-3: Only extract comments with TRANSLATORS:
tag.