Bruno Haible [Fri, 25 Jan 2019 19:44:11 +0000 (20:44 +0100)]
doc: Mention --color=test in the description of the --color option.
Reported by Nathaniel M. Beaver <nathanielmbeaver@gmail.com>
in <https://savannah.gnu.org/bugs/?55573>.
* gettext-tools/doc/gettext.texi (Colorizing): Mention that the --color and
--style options are applicable to many programs.
(The --color option): Mention the 'test' value.
Bruno Haible [Mon, 21 Jan 2019 01:58:06 +0000 (02:58 +0100)]
msginit: Update for current shape of Translation Project.
Reported by Karl Ove Hufthammer <karl@huftis.org>
in <https://lists.gnu.org/archive/html/bug-gettext/2019-01/msg00014.html>.
* gettext-tools/projects/TP/teams.html: Fetched from teams.url.
* gettext-tools/projects/TP/team-address: Update sed expressions for current
structure of teams page.
Bruno Haible [Sun, 25 Nov 2018 01:11:21 +0000 (02:11 +0100)]
build: Fix #line statements in bison-generated files.
* gettext-tools/src/Makefile.am (po-gram-gen.c, cldr-plural.c): Override the
Automake .y.c rule.
(po-gram-gen.h, cldr-plural.h): Remove separate target.
(po-gram-gen2.h): Generate in the source directory.
Bruno Haible [Sun, 25 Nov 2018 01:10:44 +0000 (02:10 +0100)]
libasprintf: On mingw, really use our vasprintf function, not mingw_vasprintf.
mingw now has a definition of 'vasprintf' in <stdio.h> that redirects to
mingw_vasprintf, which does not support argument reordering (i.e.
HAVE_POSIX_PRINTF is not defined). Make sure to avoid this function and use
the one defined in our lib-asprintf.c instead.
* gettext-runtime/libasprintf/lib-asprintf.h (asprintf): Define as macro
redirecting to libasprintf_asprintf.
(vasprintf): Define as macro redirecting to libasprintf_vasprintf.
* gettext-runtime/libasprintf/lib-asprintf.c: Define also libasprintf_asprintf
and libasprintf_vasprintf.
* gettext-runtime/libasprintf/autosprintf.cc: Include lib-asprintf.h last.
Bruno Haible [Sun, 25 Nov 2018 01:08:20 +0000 (02:08 +0100)]
build: Remove generated files from version control.
This creates a bootstrapping issue, but it can be mitigated:
If a user wants to build GNU gettext on a platform which does not have the
GNU gettext programs installed, they first need to build and install a tarball
of GNU gettext; then only they can build GNU gettext from the git repository.
Pavel Raiskup [Wed, 21 Nov 2018 08:53:53 +0000 (09:53 +0100)]
format-kde-kuit: really use fallback markup
* gettext-tools/src/format-kde-kuit.c (format_parse): Use markup.h
methods when FORMAT_KDE_KUIT_USE_FALLBACK_MARKUP is defined. Also
free buffer if there's no support for XML.
Bruno Haible [Sat, 17 Nov 2018 22:04:17 +0000 (23:04 +0100)]
Make 'make distcheck' work in a VPATH build.
* Makefile.am (distcheck-hook): Compare files in $(srcdir).
* gettext-tools/examples/po/xsmallpot.sh: Put the resulting POT file in the
source dir, not in the build dir.
* gettext-tools/examples/po/Makefile.am (update-po): Execute sub-make in the
build dir, not in the source dir.
(SMALLPOFILES_FOR_lang): Prefix file names with $(srcdir).
(hello-*/po/*.po): Likewise. Execute mmsmallpo.sh in $(srcdir).
Bruno Haible [Sun, 11 Nov 2018 12:48:56 +0000 (13:48 +0100)]
gettextize: Require automake >= 1.9.
* gettext-tools/misc/gettextize.in: Signal an error if 'aclocal' from
automake >= 1.9 is not found. Stop installing intldir.m4, intl.m4 and its
dependencies.
* gettext-tools/doc/gettext.texi (mkinstalldirs, aclocal): State the requirement
to have automake >= 1.9.
* gettext-tools/m4/Makefile.am (aclocal_DATA): Don't install codeset.m4,
extern-inline.m4, fcntl-o.m4, glibc2.m4, glibc21.m4, intdiv0.m4, intl.m4,
intl-thread-locale.m4, intldir.m4, intmax.m4, inttypes_h.m4, inttypes-pri.m4,
lcmessage.m4, lock.m4, longlong.m4, printf-posix.m4, size_max.m4, stdint_h.m4,
threadlib.m4, uintmax_t.m4, visibility.m4, wchar_t.m4, wint_t.m4, xsize.m4.
* PACKAGING: Remove the *.m4 files that are no longer installed.
Bruno Haible [Sun, 11 Nov 2018 12:48:44 +0000 (13:48 +0100)]
gettextize: Remove --intl option.
* gettext-tools/misc/gettextize.in (func_usage): Don't mention --intl option.
Signal an error if the --intl option is specified.
Simplify main code accordingly.
* gettext-tools/doc/gettextize.texi: Remove --intl option description.
* gettext-tools/doc/gettext.texi (Prerequisites): Remove mention of intl/
directory.
(configure.ac): Suggest to use AM_GNU_GETTEXT([external]) always. Remove mention
of intl/ directory.
(config.guess): Suggest them always.
(aclocal): Shrink the list of .m4 files.
(acconfig): Remove subsection.
(config.h.in): Remove mention of intl/ directory.
(Makefile, src/Makefile, lib/gettext.h): Likewise.
(AM_GNU_GETTEXT): First argument must be 'external'. Remove third argument.
(AM_GNU_GETTEXT_INTL_SUBDIR): Remove subsection.
(Language Implementors): Remove mention of intl/ directory. Mention that
Solaris 11 gettext works like GNU gettext.
(Maintainers for other Languages): Remove mention of intl/ directory.
* gettext-tools/doc/autopoint.texi: Update explanation of name.
* NEWS: Mention the change.
Bruno Haible [Sun, 4 Nov 2018 22:28:58 +0000 (23:28 +0100)]
xgettext: Delay calls to from_current_source_encoding, part 2.
* gettext-tools/src/xg-arglist-parser.h: Include xg-mixed-string.h.
(struct partial_call): Change type of fields msgctxt, msgid, msgid_plural to
'mixed_string_ty *'.
(arglist_parser_remember, arglist_parser_remember_msgctxt): Take a
'mixed_string_ty *' argument instead of a 'char *' argument.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_clone): Update
accordingly.
(arglist_parser_remember, arglist_parser_remember_msgctxt): Take a
'mixed_string_ty *' argument.
(arglist_parser_done): Convert the mixed_string to UTF-8 encoded 'char *' here.
This is where from_current_source_encoding gets invoked now: immediately before
invoking remember_a_message, that is, only when we really need to know the
--from-source encoding.
* gettext-tools/src/x-c.c (extract_parenthesized): Pass the mixed_string to
arglist_parser_remember. Don't set xgettext_current_source_encoding around
arglist_parser_done calls.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-lisp.c: Include xg-mixed-string.h.
(read_object): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-elisp.c: Likewise.
* gettext-tools/src/x-librep.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-awk.c: Include xg-mixed-string.h.
(extract_parenthesized): Convert the string to a mixed_string_ty before passing
it to arglist_parser_remember.
* gettext-tools/src/x-lua.c: Include xg-mixed-string.h.
(extract_balanced): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-php.c: Include xg-mixed-string.h.
(extract_balanced): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-sh.c: Include xg-mixed-string.h.
(read_command): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-tcl.c: Include xg-mixed-string.h.
(read_command): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-perl.c (extract_balanced): Convert the string to a
mixed_string_ty before passing it to arglist_parser_remember. Don't set
xgettext_current_source_encoding around arglist_parser_done calls.
Bruno Haible [Sun, 4 Nov 2018 19:23:31 +0000 (20:23 +0100)]
xgettext: Delay calls to from_current_source_encoding, part 1.
* xg-mixed-string.h (enum segment_type, struct mixed_string_segment,
struct mixed_string, mixed_string_ty): New types.
(mixed_string_alloc_simple, mixed_string_alloc_utf8, mixed_string_clone,
mixed_string_contents, mixed_string_free, mixed_string_contents_free1,
mixed_string_concat, mixed_string_concat_free1): New declarations.
(struct mixed_string_buffer): Change internal representation to use segments.
(mixed_string_buffer_result): Change return type to 'mixed_string_ty *'.
* xg-mixed-string.c: Include flexmember.h, msgl-ascii.h, po-charset.h.
(segment_alloc, segment_clone, mixed_string_alloc_simple,
mixed_string_alloc_utf8, mixed_string_clone, mixed_string_contents,
mixed_string_free, mixed_string_contents_free1, mixed_string_concat,
mixed_string_concat_free1): New functions.
(mixed_string_buffer_init, mixed_string_buffer_is_empty): Change to match new
internal representation.
(mixed_string_buffer_grow_curr_buffer): New function.
(mixed_string_buffer_grow_utf8_buffer): Remove function.
(mixed_string_buffer_append_to_utf8_buffer): Update accordingly.
(mixed_string_buffer_flush_curr_buffer): Remove function.
(mixed_string_buffer_add_segment, mixed_string_buffer_flush_curr): New
functions.
(mixed_string_buffer_append_char, mixed_string_buffer_append_unicode,
mixed_string_buffer_destroy, mixed_string_buffer_result): Change to match new
internal representation.
* x-c.c (struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get, phase6_get, phase8a_get): For tokens of type
token_type_string_literal, use a mixed_string.
(phase8_get): Use mixed_string_concat_free1.
(struct xgettext_token_ty): New field 'mixed_string'.
(x_c_lex, extract_parenthesized): For tokens of type
xgettext_token_type_string_literal, use a mixed_string.
* x-csharp.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase6_get): For tokens of type token_type_string_literal, use a mixed_string.
(phase7_get): Use mixed_string_concat_free1.
(extract_parenthesized): For tokens of type token_type_string_literal, use a
mixed_string.
* x-java.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string_literal, use a mixed_string.
(phase6_get): Use mixed_string_concat_free1.
(extract_parenthesized): For tokens of type token_type_string_literal, use a
mixed_string.
* x-javascript.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string, use a mixed_string.
(x_javascript_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string, use a mixed_string.
* x-python.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string, use a mixed_string.
(x_python_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string, use a mixed_string.
* x-rst.c (extract_rsj): Update.
* x-vala.c (struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase3_get): For tokens of type token_type_string_literal, use a mixed_string.
For tokens of type token_type_string_template, fix a memory leak.
(x_vala_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string_literal, use a
mixed_string.
Bruno Haible [Sun, 4 Nov 2018 19:20:30 +0000 (20:20 +0100)]
xgettext: Change the Java extractor to make use of mixed_string_buffer.
* gettext-tools/src/xg-mixed-string.h: Include <stdbool.h>.
(mixed_string_buffer_init, mixed_string_buffer_is_empty,
mixed_string_buffer_destroy, mixed_string_buffer_result): New declarations.
* gettext-tools/src/xg-mixed-string.c: Include xg-pos.h.
(mixed_string_buffer_init): New function.
(mixed_string_buffer_alloc): Invoke it.
(mixed_string_buffer_is_empty): New function, based on comment_at_start in
x-java.c.
(mixed_string_buffer_append_lone_surrogate): New function, based on
string_buffer_append_lone_surrogate in x-java.c.
(mixed_string_buffer_flush_utf16_surr, mixed_string_buffer_append_unicode): Use
it.
(mixed_string_buffer_destroy, mixed_string_buffer_result): New functions.
(mixed_string_buffer_done): Invoke mixed_string_buffer_result.
* gettext-tools/src/x-java.c: Include xg-mixed-string.h.
(struct string_buffer): Remove type.
(init_string_buffer, string_buffer_append_byte,
string_buffer_append_unicode_grow, string_buffer_append_unicode,
string_buffer_append_lone_surrogate, string_buffer_flush_utf16_surr,
string_buffer_flush_curr_buffer): Remove functions.
(mixed_string_buffer_append): Renamed from string_buffer_append. Use
mixed_string_buffer.
(string_buffer_result, free_string_buffer): Remove functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.
(accumulate_escaped, phase5_get): Likewise.
Bruno Haible [Sun, 4 Nov 2018 19:09:47 +0000 (20:09 +0100)]
xgettext: Fix result for concatenation of strings with escape sequences.
Reported by Morten Welinder <mwelinder@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2015-12/msg00017.html>
and <https://savannah.gnu.org/bugs/?46756>.
Revert commits from
2014-05-07 xgettext: Provide a way to interpret string literals lazily
2014-05-07 c: Interpret string literals lazily
2014-05-09 vala: Interpret string literals lazily
2014-12-02 c: Support C++11 string literals
and subsequent fixes of these.