]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
5 years agoxgettext: Add Ruby support.
Bruno Haible [Sun, 26 Apr 2020 22:19:07 +0000 (00:19 +0200)] 
xgettext: Add Ruby support.

* gettext-tools/src/x-ruby.h: New file.
* gettext-tools/src/x-ruby.c: New file.
* gettext-tools/src/xgettext.h (verbose): New declaration.
* gettext-tools/src/xgettext.c: Include x-ruby.h.
(verbose): New declaration.
(flag_table_ruby): New variable.
(long_options): Add '--verbose'.
(main): Update for Ruby. Handle '-v'/'--verbose' option.
(usage): Document the '-L Ruby' and '-v' options.
(xgettext_record_flag, language_to_extractor, extension_to_language): Update for
Ruby.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add x-ruby.h.
(xgettext_SOURCES): Add x-ruby.c.
* gettext-tools/src/FILES: Mention x-ruby.h, x-ruby.c.
* gettext-tools/tests/xgettext-ruby-1: New file.
* gettext-tools/tests/format-ruby-1: New file.
* gettext-tools/tests/format-ruby-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/doc/gettext.texi (Ruby): New section.
* gettext-tools/doc/xgettext.texi: Document the '-L Ruby' and '-v' options.
* HACKING: Document the recommended Ruby packages.
* NEWS: Mention the Ruby support.

5 years agoxgettext: Define alternate parser signature for the Ruby support.
Bruno Haible [Sun, 26 Apr 2020 21:51:23 +0000 (23:51 +0200)] 
xgettext: Define alternate parser signature for the Ruby support.

* gettext-tools/src/xgettext.c (extract_from_stream_func): Renamed from
extractor_func.
(extract_from_file_func): New type.
(struct extractor_ty): Rename field func to extract_from_stream. New field
extract_from_file.
(main): Consider both fields.
(xgettext_find_file): New function.
(extract_from_file): Add alternative code for when the other extraction function
is defined.
(language_to_extractor): In the table, rename field func to extract_from_stream,
and add new field extract_from_file.
* gettext-tools/src/x-*.h (SCANNERS_*): Update.

5 years agoxgettext: Define functions for the Ruby support.
Bruno Haible [Sun, 26 Apr 2020 21:35:16 +0000 (23:35 +0200)] 
xgettext: Define functions for the Ruby support.

* gettext-tools/src/xg-message.h (decide_is_format, intersect_range,
decide_do_wrap, decide_syntax_check): New declarations.
* gettext-tools/src/xg-message.c (decide_is_format, intersect_range,
decide_do_wrap, decide_syntax_check): New functions. extracted from
remember_a_message.
(remember_a_message): Invoke these functions.

5 years agostr-list: Add a remove function.
Bruno Haible [Sun, 26 Apr 2020 21:29:17 +0000 (23:29 +0200)] 
str-list: Add a remove function.

* gettext-tools/src/str-list.h (string_list_remove): New declaration.
* gettext-tools/src/str-list.c (string_list_remove): New function.

5 years agoAdd support for Ruby format strings.
Bruno Haible [Sun, 26 Apr 2020 14:48:46 +0000 (16:48 +0200)] 
Add support for Ruby format strings.

* gettext-tools/src/message.h (enum format_type): Add format_ruby.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_ruby.
(NFORMATS): Increment.
* gettext-tools/src/format.h (formatstring_ruby): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add an entry for
format_ruby.
* gettext-tools/src/format-ruby.c: New file, based on
gettext-tools/src/format-python.c.
* gettext-tools/src/FILES: Mention it.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-ruby.c.
* gettext-tools/doc/gettext.texi (PO Files): Mention ruby-format.
(ruby-format): New section.

5 years agoxgettext: Fix a comment.
Bruno Haible [Sun, 26 Apr 2020 10:10:36 +0000 (12:10 +0200)] 
xgettext: Fix a comment.

* gettext-tools/src/x-po.c: Fix a comment.

5 years agoReduce heap allocation in format string parsers.
Bruno Haible [Sat, 25 Apr 2020 16:53:36 +0000 (18:53 +0200)] 
Reduce heap allocation in format string parsers.

* gettext-tools/src/format-awk.c (struct spec): Remove 'allocated' field.
(format_parse): Use a local variable instead.
* gettext-tools/src/format-boost.c: Likewise.
* gettext-tools/src/format-elisp.c: Likewise.
* gettext-tools/src/format-gcc-internal.c: Likewise.
* gettext-tools/src/format-java-printf.c: Likewise.
* gettext-tools/src/format-javascript.c: Likewise.
* gettext-tools/src/format-kde.c: Likewise.
* gettext-tools/src/format-librep.c: Likewise.
* gettext-tools/src/format-lua.c: Likewise.
* gettext-tools/src/format-perl-brace.c: Likewise.
* gettext-tools/src/format-python.c: Likewise.
* gettext-tools/src/format-sh.c: Likewise.
* gettext-tools/src/format-tcl.c: Likewise.
* gettext-tools/src/format-c-parse.h (struct spec): Remove 'allocated' field.
(format_parse_entrails): Use a local variable instead.
* gettext-tools/src/format-pascal.c (struct spec): Remove 'allocated' field.
(format_parse): Rename a local variable.
* gettext-tools/src/format-perl.c: Likewise.
* gettext-tools/src/format-php.c: Likewise.
* gettext-tools/src/format-gfc-internal.c (format_parse): Rename a local
variable.

5 years agoexamples: Improve code style.
Bruno Haible [Sat, 25 Apr 2020 10:55:57 +0000 (12:55 +0200)] 
examples: Improve code style.

* gettext-tools/examples/hello-*/configure.ac: Improve quoting.

5 years agoUpdate .gitignore after 2020-04-19 change.
Bruno Haible [Sun, 26 Apr 2020 22:21:55 +0000 (00:21 +0200)] 
Update .gitignore after 2020-04-19 change.

5 years agoUpdate after gnulib changed.
Bruno Haible [Sat, 25 Apr 2020 08:06:44 +0000 (10:06 +0200)] 
Update after gnulib changed.

* gettext-runtime/libasprintf/vasnprintf.c: Update from gnulib.

5 years agobuild: Fix a warning (regression from 2020-01-05).
Bruno Haible [Mon, 20 Apr 2020 01:56:48 +0000 (03:56 +0200)] 
build: Fix a warning (regression from 2020-01-05).

* gettext-tools/tests/tstgettext.c (setlocale): Declare after defining as
fake_setlocale.
* gettext-tools/tests/tstngettext.c (setlocale): Likewise.
* gettext-tools/tests/plural-1-prg.c (setlocale): Likewise.
* gettext-tools/tests/format-c-3-prg.c (setlocale): Likewise.
* gettext-tools/tests/format-c-4-prg.c (setlocale): Likewise.

5 years agointl: Support any Unicode characters in the locale dir on native Windows.
Bruno Haible [Sun, 19 Apr 2020 22:46:44 +0000 (00:46 +0200)] 
intl: Support any Unicode characters in the locale dir on native Windows.

Reported at <https://savannah.gnu.org/bugs/?57714>.

* gettext-runtime/intl/libgnuintl.in.h (libintl_wbindtextdomain): New
declaration.
(wbindtextdomain): New redirect.
* gettext-runtime/intl/bindtextdom.c (set_binding_values): Accept a wdirnamep
argument. Set not only binding->dirname but also binding->wdirname.
(BINDTEXTDOMAIN, BIND_TEXTDOMAIN_CODESET): Pass NULL as wdirnamep.
(libintl_wbindtextdomain): New function.
* gettext-runtime/intl/loadinfo.h (struct loaded_l10nfile): Add a wfilename
field.
(_nl_make_l10nflist): On native Windows, accept wdirlist, wdirlist_len
parameters.
* gettext-runtime/intl/loadmsgcat.c (_nl_load_domain): On native Windows, use
_wopen() instead of open() to open a file with a name given as wchar_t[].
* gettext-runtime/intl/l10nflist.c: Include <wchar.h>.
(_nl_make_l10nflist): On native Windows, accept wdirlist, wdirlist_len
parameters. Construct abs_wfilename and use in the search for existing
'struct loaded_l10nfile' and when allocating a fresh 'struct loaded_l10nfile'.
* gettext-runtime/intl/gettextP.h (struct binding): Add a wdirname field.
(_nl_find_domain): On native Windows, accept a wdirname parameter.
* gettext-runtime/intl/finddomain.c (_nl_find_domain): On native Windows, accept
a wdirname parameter. Pass it to _nl_make_l10nflist.
* gettext-runtime/intl/dcigettext.c (DCIGETTEXT): Consider not only
binding->dirname but also binding->wdirname. On native Windows, use _wgetcwd
instead of getcwd. Pass also wdirname to _nl_find_domain.
* gettext-tools/tests/intl-6: New file, based on gettext-tools/tests/intl-1.
* gettext-tools/tests/intl-6-prg.c: New file, based on
gettext-tools/tests/intl-1-prg.c.
* gettext-tools/tests/Makefile.am (TESTS): Add intl-6.
(check_PROGRAMS): Add intl-6-prg.
(intl_6_prg_SOURCES, intl_6_prg_LDADD): New variables.
* gettext-tools/doc/gettext.texi (Ambiguities, src/Makefile,
Language Implementors, C): Document wbindtextdomain.
* gettext-runtime/NEWS: Mention the change.
* NEWS: Likewise.

5 years agoUpdate after gnulib changed.
Bruno Haible [Sun, 19 Apr 2020 22:14:29 +0000 (00:14 +0200)] 
Update after gnulib changed.

* gettext-runtime/intl/vasnprintf.c: Update from gnulib.

5 years agoUpdate to newest gnulib.
Bruno Haible [Sun, 19 Apr 2020 22:13:18 +0000 (00:13 +0200)] 
Update to newest gnulib.

5 years agointl: Add comment regarding debugging printf.
Bruno Haible [Sun, 19 Apr 2020 15:30:57 +0000 (17:30 +0200)] 
intl: Add comment regarding debugging printf.

* gettext-runtime/intl/printf.c (ENABLE_WCHAR_FALLBACK): New commented
definition.

5 years agolibtextstyle: Fix a memory leak.
Bruno Haible [Tue, 14 Apr 2020 21:48:23 +0000 (23:48 +0200)] 
libtextstyle: Fix a memory leak.

Reported by José E. Marchesi <jemarch@gnu.org>.

* libtextstyle/gnulib-local/lib/term-ostream.oo.c (term_ostream::free): Free
also the stream's attrbuffer.

5 years agoUpdate NEWS files after version 0.20.2 was released.
Bruno Haible [Tue, 14 Apr 2020 11:57:10 +0000 (13:57 +0200)] 
Update NEWS files after version 0.20.2 was released.

5 years agoFix typo in release steps.
Bruno Haible [Tue, 14 Apr 2020 09:01:55 +0000 (11:01 +0200)] 
Fix typo in release steps.

5 years agoMerge from 0.20.x branch: Update translations (from the TP).
Bruno Haible [Mon, 13 Apr 2020 13:40:50 +0000 (15:40 +0200)] 
Merge from 0.20.x branch: Update translations (from the TP).

* gettext-runtime/po/*.po: Update.
* gettext-tools/po/*.po: Update.
* gettext-tools/examples/po/*.po: Update.
* gettext-tools/examples/po/LINGUAS: Add 'sq'.
* gettext-tools/examples/hello-*/po/LINGUAS: Likewise.
* gettext-tools/examples/Makefile.am (EXAMPLESPOFILES): Add sq.po.

5 years agoMerge from 0.20.x branch: examples: Use infrastructure from gettext version 0.20.2.
Bruno Haible [Mon, 13 Apr 2020 20:41:54 +0000 (22:41 +0200)] 
Merge from 0.20.x branch: examples: Use infrastructure from gettext version 0.20.2.

* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.20.2.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.

5 years agoMerge from 0.20.x branch: Prepare for 0.20.2 release.
Bruno Haible [Mon, 13 Apr 2020 13:32:22 +0000 (15:32 +0200)] 
Merge from 0.20.x branch: Prepare for 0.20.2 release.

* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 9:7:1.
* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.20.2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:6:5.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* gettext-runtime/src/envsubst.c: Update copyright years in --version output.
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/gettext.sh.in: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-tools/src/cldr-plurals.c: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/recode-sr-latin.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
* gettext-tools/misc/convert-archive.in: Likewise.
* gettext-tools/misc/gettextize.in: Likewise.
* gettext-tools/misc/autopoint.in: Likewise. Handle version 0.20.2.

5 years agomaint: Update download location of jdom-1.0.jar.
Bruno Haible [Mon, 13 Apr 2020 13:23:55 +0000 (15:23 +0200)] 
maint: Update download location of jdom-1.0.jar.

5 years agobuild: Fix the generation of hello-c-gnome3.pot (regression from 2019-10-04).
Bruno Haible [Tue, 14 Apr 2020 01:29:58 +0000 (03:29 +0200)] 
build: Fix the generation of hello-c-gnome3.pot (regression from 2019-10-04).

* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): Set also
GETTEXTDATADIR.

5 years agoFix a compilation error (regression from 2019-12-24).
Bruno Haible [Mon, 13 Apr 2020 12:14:20 +0000 (14:14 +0200)] 
Fix a compilation error (regression from 2019-12-24).

* gettext-tools/src/write-desktop.c: Include <stdint.h>.

5 years agointl: Drop argz processing outside of glibc.
Bruno Haible [Sun, 12 Apr 2020 17:29:36 +0000 (19:29 +0200)] 
intl: Drop argz processing outside of glibc.

* gettext-runtime/intl/l10nflist.c: Don't test HAVE_ARGZ_H.
(__argz_count, __argz_stringify, __argz_next): Remove definitions.
(_nl_make_l10nflist): Simplify !_LIBC case.
* gettext-runtime/m4/intl.m4 (gt_INTL_SUBDIR_CORE): Don't test for <argz.h>,
argz_count, argz_stringify, argz_next.

5 years agointl: Improve comments.
Bruno Haible [Sun, 12 Apr 2020 16:49:42 +0000 (18:49 +0200)] 
intl: Improve comments.

* gettext-runtime/intl/Makefile.am: Add an overview of the code.
* gettext-runtime/intl/loadinfo.h (_nl_make_l10nflist): Improve comment.
* gettext-runtime/intl/dcigettext.c (guess_category_value): Likewise.
* gettext-runtime/intl/finddomain.c (_nl_find_domain): Likewise.

5 years agopo: Emit a warning when creating a tarball without POT file.
Bruno Haible [Sat, 11 Apr 2020 21:00:21 +0000 (23:00 +0200)] 
po: Emit a warning when creating a tarball without POT file.

* gettext-runtime/po/Makefile.in.in (dist2): Emit a warning when the POT file
does not exist.
* gettext-tools/examples/hello-*/po/Makefile.am (distdir1): Likewise.

5 years agolibtextstyle: Update .gitignore after 2019-12-24 change.
Bruno Haible [Sat, 11 Apr 2020 11:16:26 +0000 (13:16 +0200)] 
libtextstyle: Update .gitignore after 2019-12-24 change.

5 years agoUpdate to newest gnulib.
Bruno Haible [Sat, 11 Apr 2020 10:09:23 +0000 (12:09 +0200)] 
Update to newest gnulib.

5 years agoxgettext: Fix a report by an undefined-behaviour sanitizer.
Bruno Haible [Fri, 10 Apr 2020 19:19:36 +0000 (21:19 +0200)] 
xgettext: Fix a report by an undefined-behaviour sanitizer.

Reported by Jeffrey Walton <noloader@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2020-01/msg00029.html>.

* gettext-tools/src/read-properties.c (read_escaped_string): Don't call memcpy
with a NULL argument.

5 years agoxgettext: Improve JSX support in JavaScript.
Bruno Haible [Mon, 6 Apr 2020 21:29:56 +0000 (23:29 +0200)] 
xgettext: Improve JSX support in JavaScript.

Reported by Vaclav Slavik <vaclav@slavik.io> in
<https://savannah.gnu.org/bugs/?57927>.

* gettext-tools/src/x-javascript.c (enum token_type_ty): Add some more types.
(is_after_expression): New function.
(phase5_get): Distinguish the "other" tokens in more detail. Use
'is_after_expression ()' when interpreting a '<' or '/' character.
(extract_balanced): Don't let commas in braced expressions and in XML elements
disturb the argument processing outside.
(extract_javascript): Update.
* gettext-tools/tests/xgettext-javascript-6: Enhance the test.
* NEWS: Mention the change.

5 years agoxgettext: Freshly initialize all static variables for each input file.
Bruno Haible [Mon, 6 Apr 2020 12:07:01 +0000 (14:07 +0200)] 
xgettext: Freshly initialize all static variables for each input file.

* gettext-tools/src/x-c.c (extract_whole_file): Initialize
phase1_pushback_length, phase2_pushback_length, phase3_pushback_length,
phase5_pushback_length, phase6_pushback_length.
* gettext-tools/src/x-csharp.c (extract_csharp): Initialize
phase1_pushback_length, phase2_pushback_length, phase3_pushback_length,
phase5_pushback_length, phase6_pushback_length, phase7_pushback_length.
* gettext-tools/src/x-java.c (extract_java): Initialize phase1_pushback_length,
phase2_pushback_length, phase3_pushback_length, phase5_pushback_length,
phase6_pushback_length.
* gettext-tools/src/x-javascript.c (continuation_or_nonblank_line,
last_token_type): Remove static initialization.
(extract_javascript): Initialize phase1_pushback_length, phase2_pushback_length,
phase5_pushback_length, last_token_type.
* gettext-tools/src/x-lua.c (first_character): Change type to 'bool'. Remove
static initialization.
(extract_lua): Initialize phase1_pushback_length, first_character,
phase3_pushback_length, phase4_last, phase4_pushback_length.
* gettext-tools/src/x-perl.c (extract_perl): Reorder initializations.
* gettext-tools/src/x-php.c (extract_php): Initialize phase1_pushback_length,
phase3_pushback_length, phase4_pushback_length.
* gettext-tools/src/x-python.c (continuation_or_nonblank_line): Remove static
initialization.
(extract_python): Initialize phase1_pushback_length, phase2_pushback_length,
phase5_pushback_length.
* gettext-tools/src/x-sh.c (extract_sh): Initialize phase1_pushback_length,
phase2_pushback_length.
* gettext-tools/src/x-smalltalk.c (extract_smalltalk): Initialize
phase2_pushback_length, phase3_pushback_length.
* gettext-tools/src/x-tcl.c (extract_tcl): Initialize phase1_pushback_length,
phase2_pushback_length.
* gettext-tools/src/x-vala.c (last_token_type): Remove static initialization.
(extract_vala): Initialize phase1_pushback_length, phase3_pushback_length,
last_token_type.
* gettext-tools/src/x-ycp.c (extract_ycp): Initialize phase2_pushback_length,
phase5_pushback_length, phase8_pushback_length.

5 years agopo, examples: In the .po -> .gmo rules, really consider the newest changes to the...
Bruno Haible [Sun, 5 Apr 2020 13:08:34 +0000 (15:08 +0200)] 
po, examples: In the .po -> .gmo rules, really consider the newest changes to the POT file.

Reported by Petr Ovtchenkov <ptr@void-ptr.info> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00000.html>.
Helped by Paul Smith.

* gettext-runtime/po/Makefile.in.in (.po.gmo): Write dependency on the POT file
as a target rule, since inference rules don't support prerequisites.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise, also for the .po.qm
rule.
* NEWS: Mention the fix.

5 years agoThe gettext library is under LGPL 2.1, not 2.0.
Bruno Haible [Sat, 4 Apr 2020 15:28:55 +0000 (17:28 +0200)] 
The gettext library is under LGPL 2.1, not 2.0.

* gettext-runtime/m4/intl.m4: Fix comments regarding the gettext library.
* gettext-runtime/m4/intlmacosx.m4: Likewise.
* gettext-runtime/m4/nls.m4: Likewise.
* gettext-runtime/m4/po.m4: Likewise.
* gettext-runtime/m4/progtest.m4: Likewise.

5 years agoThe next release will be 0.20.2, not 0.21.
Bruno Haible [Sat, 4 Apr 2020 15:27:24 +0000 (17:27 +0200)] 
The next release will be 0.20.2, not 0.21.

* gettext-runtime/m4/gettext.m4: Update header comment.
* gettext-runtime/m4/intdiv0.m4: Likewise.
* gettext-tools/m4/exported.m4: Likewise.

5 years agodoc: Don't recommend to use the reserved identifier '_' in Java.
Bruno Haible [Sun, 29 Mar 2020 19:03:50 +0000 (21:03 +0200)] 
doc: Don't recommend to use the reserved identifier '_' in Java.

Reported by Akim Demaille <akim.demaille@gmail.com>.

* gettext-tools/doc/gettext.texi (Java): Use i18n instead _ as magic identifier.

5 years agoUpdate after gnulib changed.
Bruno Haible [Sat, 28 Mar 2020 19:03:44 +0000 (20:03 +0100)] 
Update after gnulib changed.

* gnulib-local/lib/regex_internal.h.diff: Update.
* gnulib-local/lib/unistd.in.h.diff: Update.
* gettext-runtime/intl/filename.h: New file, from gnulib.
* gettext-runtime/intl/dcigettext.c (ISSLASH, HAS_DEVICE, IS_ABSOLUTE_PATH,
IS_PATH_WITH_DIR): Remove macros. Instead, include filename.h.
(IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR): New
macros.
(DCIGETTEXT): Use IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR.
* gettext-runtime/intl/l10nflist.c (ISSLASH, HAS_DEVICE, IS_ABSOLUTE_PATH):
Remove macros. Instead, include filename.h.
(IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
(_nl_make_l10nflist): Use IS_RELATIVE_FILE_NAME.
* gettext-runtime/intl/Makefile.am (EXTRA_DIST): Add filename.h.
(l10nflist.lo, dcigettext.lo): Depend on it.
* Makefile.am (distcheck-hook): Check also gettext-runtime/intl/filename.h.
* gettext-runtime/intl/lock.c: Update from gnulib.
* gettext-runtime/intl/lock.h: Likewise.
* gettext-runtime/intl/relocatable.c: Likewise.
* gettext-tools/src/locating-rule.c (locating_rule_list_locate): Use
IS_RELATIVE_FILE_NAME instead of IS_ABSOLUTE_PATH.
* gettext-tools/src/open-catalog.c (try_open_catalog_file): Likewise.
* gettext-tools/src/xgettext.c (main, xgettext_open): Likewise.
* libtextstyle/lib/color.c (style_file_lookup): Use IS_FILE_NAME_WITH_DIR
instead of IS_PATH_WITH_DIR.

5 years agoUpdate to newest gnulib.
Bruno Haible [Sat, 28 Mar 2020 18:48:45 +0000 (19:48 +0100)] 
Update to newest gnulib.

5 years agourlget: Follow the "privacy by design" principle.
Bruno Haible [Mon, 24 Feb 2020 11:31:21 +0000 (12:31 +0100)] 
urlget: Follow the "privacy by design" principle.

* gettext-tools/src/urlget.c (fetch): Override the User-Agent string, so as not
to reveal the program version to the server. For wget, use long options.

5 years agourlget: Follow the "privacy by design" principle.
Bruno Haible [Sun, 23 Feb 2020 19:56:32 +0000 (20:56 +0100)] 
urlget: Follow the "privacy by design" principle.

* gettext-tools/src/gnu/gettext/GetURL.java (fetch): Override the User-Agent
string, so as not to reveal the Java version to the server.

5 years agolibtextstyle: Prepare intermediate release 0.20.5.
Bruno Haible [Tue, 21 Jan 2020 20:44:02 +0000 (21:44 +0100)] 
libtextstyle: Prepare intermediate release 0.20.5.

* libtextstyle/version.sh: Update version number.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 1:0:1.
* libtextstyle/NEWS: Update.
* NEWS: Likewise.

5 years agobuild: Tweak configure.ac.
Bruno Haible [Sun, 5 Jan 2020 20:53:43 +0000 (21:53 +0100)] 
build: Tweak configure.ac.

* gettext-runtime/configure.ac: Move AH_BOTTOM invocation, for consistency with
gettext-tools/configure.ac.

5 years agobuild: Fix link error on MSVC with --disable-shared.
Bruno Haible [Sun, 5 Jan 2020 19:19:17 +0000 (20:19 +0100)] 
build: Fix link error on MSVC with --disable-shared.

* gettext-tools/tests/setlocale.c (setlocale): Define to fake_setlocale on
native Windows.
* gettext-tools/tests/format-c-3-prg.c (setlocale): Likewise.
* gettext-tools/tests/format-c-4-prg.c (setlocale): Likewise.
* gettext-tools/tests/plural-1-prg.c (setlocale): Likewise.
* gettext-tools/tests/tstgettext.c (setlocale): Likewise.
* gettext-tools/tests/tstngettext.c (setlocale): Likewise.

5 years agobuild: Fix build error on MSVC with --disable-shared.
Bruno Haible [Sun, 5 Jan 2020 19:15:46 +0000 (20:15 +0100)] 
build: Fix build error on MSVC with --disable-shared.

* gettext-tools/configure.ac (AH_BOTTOM): On MSVC with --disable-shared, even
when compiling with option -MD, define DLL_VARIABLE to empty.

5 years agolibtextstyle: Enable large files and, on Linux, 64-bit inodes support.
Dmitry V. Levin [Fri, 3 Jan 2020 12:08:20 +0000 (13:08 +0100)] 
libtextstyle: Enable large files and, on Linux, 64-bit inodes support.

* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'largefile' to enable
large files support on systems where this is not the default and 64-bit
inodes in 32-bit applications on Linux.

5 years agoUpdate after gnulib changed.
Bruno Haible [Sun, 5 Jan 2020 19:11:22 +0000 (20:11 +0100)] 
Update after gnulib changed.

5 years agoUpdate after gnulib changed.
Bruno Haible [Thu, 2 Jan 2020 13:54:32 +0000 (14:54 +0100)] 
Update after gnulib changed.

* gettext-runtime/intl/localcharset.c: Update from gnulib.
* gettext-runtime/intl/setlocale-lock.c: Likewise.

5 years agoUpdate to newest gnulib.
Bruno Haible [Tue, 24 Dec 2019 20:56:26 +0000 (21:56 +0100)] 
Update to newest gnulib.

5 years agoFix a test failure of msgfmt-desktop-2 on HP-UX with cc.
Bruno Haible [Tue, 24 Dec 2019 19:02:27 +0000 (20:02 +0100)] 
Fix a test failure of msgfmt-desktop-2 on HP-UX with cc.

* gettext-tools/src/write-desktop.c (msgfmt_desktop_handle_pair): Don't cast
directly from 'void *' to 'bool'.

5 years agoUpdate after gnulib changed: Support building with --enable-threads=isoc.
Bruno Haible [Tue, 24 Dec 2019 16:37:22 +0000 (17:37 +0100)] 
Update after gnulib changed: Support building with --enable-threads=isoc.

* gettext-runtime/intl/dcigettext.c (lock): Move outside _nl_find_msg.
* gettext-runtime/intl/finddomain.c (lock): Move outside _nl_find_domain.
* gettext-runtime/intl/loadmsgcat.c (lock): Move outside _nl_load_domain.

5 years agoUpdate after gnulib changed: Fix test failures on FreeBSD, NetBSD, macOS.
Bruno Haible [Tue, 24 Dec 2019 16:37:19 +0000 (17:37 +0100)] 
Update after gnulib changed: Fix test failures on FreeBSD, NetBSD, macOS.

* gettext-tools/tests/setlocale.c (setlocale): Undefine.

5 years agoUpdate after gnulib changed.
Bruno Haible [Tue, 24 Dec 2019 16:37:17 +0000 (17:37 +0100)] 
Update after gnulib changed.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES): Add
setlocale-null.
* gettext-runtime/intl/localcharset.h: Update from gnulib.
* gettext-runtime/intl/localcharset.c: Likewise.
* gettext-runtime/intl/localename.c: Likewise.
* gettext-runtime/intl/setlocale_null.h: New file, from gnulib.
* gettext-runtime/intl/arg-nonnull.h: New file, from gnulib.
* gettext-runtime/intl/setlocale_null.c: New file, from gnulib.
* gettext-runtime/intl/setlocale-lock.c: New file, from gnulib.
* gettext-runtime/intl/lock.h: Update from gnulib.
* gettext-runtime/intl/lock.c: Likewise.
* gettext-runtime/intl/threadlib.c: Likewise.
* gettext-runtime/intl/vasnprintf.c: Likewise.
* gettext-runtime/intl/verify.h: Likewise.
* gettext-runtime/intl/Makefile.am (EXTRA_DIST): Add arg-nonnull.h,
setlocale_null.h.
(LIBINTLSOURCES): Add setlocale-lock.c, setlocale_null.c.
(setlocale-lock.lo, setlocale_null.lo): New rules.
(localename.lo, setlocale-lock.lo, setlocale_null.lo): Update dependencies.
* Makefile.am (distcheck-hook): Check the new files in gettext-runtime/intl/.
* gettext-runtime/libasprintf/vasnprintf.c: Update from gnulib.
* gettext-tools/libgettextpo/Makefile.am (DEFS): Define OMIT_SETLOCALE_LOCK.
* gettext-runtime/NEWS: Mention the multithread-safety fix in localcharset.c.
* NEWS: Likewise.

5 years agoUpdate to newest gnulib.
Bruno Haible [Tue, 24 Dec 2019 16:37:09 +0000 (17:37 +0100)] 
Update to newest gnulib.

5 years agoFix test failures on Haiku.
Bruno Haible [Tue, 24 Dec 2019 16:37:07 +0000 (17:37 +0100)] 
Fix test failures on Haiku.

* gettext-tools/tests/init.cfg (func_filter_POT_Creation_Date): New function.
* gettext-tools/tests/xgettext-*: Use it.

5 years agobuild: Fix build failures on HP-UX 11.31/hppa with cc.
Bruno Haible [Tue, 24 Dec 2019 16:37:04 +0000 (17:37 +0100)] 
build: Fix build failures on HP-UX 11.31/hppa with cc.

* gnulib-local/lib/libxml/parser.c (struct _xmlDefAttrs): Don't use ISO C 99
syntax with this compiler.
* gettext-runtime/intl/plural-exp.h (HAVE_STRUCT_INITIALIZER): Set to 0 with
this compiler.

5 years agolibtextstyle: Don't erase the .sym.in file if 'sed' is not GNU sed.
Bruno Haible [Tue, 24 Dec 2019 16:37:00 +0000 (17:37 +0100)] 
libtextstyle: Don't erase the .sym.in file if 'sed' is not GNU sed.

* libtextstyle/lib/Makefile.am (libtextstyle.sym.in): Test the exit status of
the declared.sh command. Preserve the existing libunistring.sym if it failed.

5 years agolibcroco: Improve copyright headers.
Bruno Haible [Sun, 24 Nov 2019 23:40:08 +0000 (00:40 +0100)] 
libcroco: Improve copyright headers.

The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.

* libtextstyle/gnulib-local/lib/libcroco/*: Inline the COPYRIGHT file where
applicable. Add copyright header.
* libtextstyle/gnulib-local/lib/libcroco/libcroco-config.h: Add copyright header.

5 years agolibxml: Improve copyright headers.
Bruno Haible [Sun, 24 Nov 2019 18:57:37 +0000 (19:57 +0100)] 
libxml: Improve copyright headers.

The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.

* gnulib-local/lib/libxml/*: Inline this directory's COPYING file where
applicable. Add FSF copyright header.
* gnulib-local/lib/libxml/trionan.c: Add copyright header.

5 years agoglib: Improve copyright headers.
Bruno Haible [Sun, 24 Nov 2019 18:53:45 +0000 (19:53 +0100)] 
glib: Improve copyright headers.

The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.

* libtextstyle/gnulib-local/lib/glib*: Add FSF copyright header.

5 years agolibtextstyle: Add test for ostream_printf.
Bruno Haible [Mon, 28 Oct 2019 00:11:21 +0000 (01:11 +0100)] 
libtextstyle: Add test for ostream_printf.

* libtextstyle/gnulib-local/tests/test-memory-ostream.c: New file.
* libtextstyle/gnulib-local/modules/memory-ostream-tests: New file.
* libtextstyle/Makefile.am (EXTRA_DIST): Add them.
* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'memory-ostream-tests'.

5 years agolibtextstyle: Add ostream_printf, ostream_vprintf functions.
Bruno Haible [Mon, 28 Oct 2019 00:08:41 +0000 (01:08 +0100)] 
libtextstyle: Add ostream_printf, ostream_vprintf functions.

Suggested by José Marchesi.

* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'vasprintf-posix'.
* libtextstyle/gnulib-local/lib/ostream.oo.h: Include <stdarg.h>.
(ostream_printf, ostream_vprintf): New declarations.
* libtextstyle/gnulib-local/lib/ostream.oo.c: Include <stdio.h>.
(ostream_printf, ostream_vprintf): New functions.
* libtextstyle/gnulib-local/lib/styled-ostream.oo.h: Update comments.
* libtextstyle/gnulib-local/lib/term-ostream.oo.h: Likewise.
* libtextstyle/gnulib-local/lib/html-ostream.oo.h: Likewise.
* libtextstyle/lib/textstyle.h: Include <stdio.h>.
(ostream_printf, ostream_vprintf): New functions.
(styled_ostream_flush_to_current_style, term_ostream_flush_to_current_style,
html_ostream_flush_to_current_style): Update comments.
* libtextstyle/doc/libtextstyle.texi (The ostream class): Document
ostream_printf, ostream_vprintf.
(The styled_ostream class, The term_ostream class, The html_ostream class):
Update comments.
* libtextstyle/NEWS: Mention it.
* NEWS: Likewise.

5 years agolibtextstyle: Clarify memory_stream_contents function.
Bruno Haible [Sun, 27 Oct 2019 23:55:05 +0000 (00:55 +0100)] 
libtextstyle: Clarify memory_stream_contents function.

* libtextstyle/gnulib-local/lib/memory-ostream.oo.h (memory_stream::contents):
Clarify extent of return values.
* libtextstyle/doc/libtextstyle.texi (The memory_ostream class): Likewise.

5 years agobuild: Fix typo in comment.
Bruno Haible [Sun, 27 Oct 2019 23:10:15 +0000 (00:10 +0100)] 
build: Fix typo in comment.

* gettext-tools/gnulib-tests/Makefile.am: Fix typo.
* libtextstyle/adhoc-tests/Makefile.am: Likewise.
* libtextstyle/tests/Makefile.am: Likewise.

5 years agodoc: Add more info for language implementors.
Bruno Haible [Sun, 20 Oct 2019 15:08:30 +0000 (17:08 +0200)] 
doc: Add more info for language implementors.

* gettext-tools/doc/gettext.texi (Language Implementors): Add more details.

5 years agoUpdate after gnulib changed.
Bruno Haible [Sun, 13 Oct 2019 18:25:46 +0000 (20:25 +0200)] 
Update after gnulib changed.

* gettext-runtime/intl/localcharset.c: Update from gnulib.
* gettext-runtime/intl/verify.h: Likewise.

5 years agoUpdate to the newest gnulib.
Bruno Haible [Sun, 13 Oct 2019 15:35:17 +0000 (17:35 +0200)] 
Update to the newest gnulib.

5 years agodoc: Mention continuous integration.
Bruno Haible [Mon, 7 Oct 2019 12:30:43 +0000 (14:30 +0200)] 
doc: Mention continuous integration.

* HACKING: Mention continuous integration.

5 years agobuild: Fix failure to build the doc in a VPATH build.
Bruno Haible [Sun, 6 Oct 2019 12:54:30 +0000 (14:54 +0200)] 
build: Fix failure to build the doc in a VPATH build.

* gettext-tools/doc/Makefile.am ($(srcdir)/stamp-vti): Create version.texi in
the source directory.

5 years agoxgettext: Fix bug in shell script parser (regression from 2019-09-15).
Bruno Haible [Sun, 6 Oct 2019 02:20:01 +0000 (04:20 +0200)] 
xgettext: Fix bug in shell script parser (regression from 2019-09-15).

* gettext-tools/src/x-sh.c (read_command): Set matters_for_argparser = false
when context_iter is not being initialized.

5 years agoCorrect indentation.
Bruno Haible [Sun, 6 Oct 2019 01:40:09 +0000 (03:40 +0200)] 
Correct indentation.

* gettext-tools/src/x-scheme.c (read_object): Correct indentation.

5 years agodoc: Mention packages needed for Javascript support.
Bruno Haible [Sat, 5 Oct 2019 13:59:01 +0000 (15:59 +0200)] 
doc: Mention packages needed for Javascript support.

* HACKING: Mention the gir1.2-gtk-3.0 package alongside with gjs.

5 years agodoc: Don't need an ar_SA locale.
Bruno Haible [Fri, 4 Oct 2019 20:02:46 +0000 (22:02 +0200)] 
doc: Don't need an ar_SA locale.

* HACKING: Remove command that creates an ar_SA locale.

5 years agodoc: Update list of external dependencies.
Bruno Haible [Fri, 4 Oct 2019 18:22:33 +0000 (20:22 +0200)] 
doc: Update list of external dependencies.

* DEPENDENCIES: Don't list glib2 and libcroco (not needed any more since
2019-02-15).

5 years agobuild: Fix the build error in gettext-tools/examples/po.
Bruno Haible [Fri, 4 Oct 2019 15:59:22 +0000 (17:59 +0200)] 
build: Fix the build error in gettext-tools/examples/po.

Reported by Nick Alcock <nix@esperi.org.uk>
at <https://savannah.gnu.org/bugs/?56529>.

* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): New variable.
(hello-*.pot): Use it.
($(srcdir)/../hello-*/po/$(LL).po): Likewise.
* HACKING: Remove the workaround.

5 years agoMake it easier to build the code when the documentation tools don't work.
Bruno Haible [Fri, 4 Oct 2019 15:26:08 +0000 (17:26 +0200)] 
Make it easier to build the code when the documentation tools don't work.

* libtextstyle/Makefile.am (SUBDIRS): Move 'doc' to the end.

5 years agolibxml: Simplify autoconf macro.
Bruno Haible [Fri, 4 Oct 2019 11:20:12 +0000 (13:20 +0200)] 
libxml: Simplify autoconf macro.

* gnulib-local/m4/libxml.m4 (gl_LIBXML): Don't test for dlopen and shlload.
The test for dlopen failed, because it would require linking with '-ldl'.
The test for shlload failed, because the function on HP-UX is called 'shl_load'
and it would require linking with '-ldld'.

5 years agobuild: Don't fetch gnulib a second time in libtextstyle.
Bruno Haible [Fri, 4 Oct 2019 09:47:18 +0000 (11:47 +0200)] 
build: Don't fetch gnulib a second time in libtextstyle.

* autogen.sh: Set GNULIB_SRCDIR when invoking libtextstyle/autogen.sh.
* libtextstyle/autogen.sh: Remove all git operations. Look at the GNULIB_SRCDIR
environment variable. Ignore the GNULIB_TOOL environment variable.

5 years agolibtextstyle: Fix failure to download texinfo.tex.
Bruno Haible [Fri, 4 Oct 2019 09:36:40 +0000 (11:36 +0200)] 
libtextstyle: Fix failure to download texinfo.tex.

* libtextstyle/autogen.sh: Create build-aux directory.

5 years agoUpdate NEWS file.
Bruno Haible [Sun, 29 Sep 2019 22:07:30 +0000 (00:07 +0200)] 
Update NEWS file.

* NEWS: Include the news about libtextstyle.

5 years agoxgettext: Signal a warning when the same msgid is used with and without plural.
Bruno Haible [Sun, 29 Sep 2019 18:52:48 +0000 (20:52 +0200)] 
xgettext: Signal a warning when the same msgid is used with and without plural.

* gettext-tools/src/xg-message.h (remember_a_message): Add pluralp argument.
* gettext-tools/src/xg-message.c (remember_a_message): Likewise. Signal a
warning when the same msgid is used with and without plural.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Update
remember_a_message invocation.
* gettext-tools/src/xgettext.c (xgettext_its_extract_callback): Update
remember_a_message invocations.
* gettext-tools/src/x-awk.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-c.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-desktop.c (extract_desktop_handle_pair): Likewise.
* gettext-tools/src/x-elisp.c (read_object): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-librep.c (read_object): Likewise.
* gettext-tools/src/x-lisp.c (read_object): Likewise.
* gettext-tools/src/x-lua.c (extract_balanced): Likewise.
* gettext-tools/src/x-perl.c (extract_variable, interpolate_keywords,
extract_balanced): Likewise.
* gettext-tools/src/x-php.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-rst.c (extract_rst, extract_rsj): Likewise.
* gettext-tools/src/x-scheme.c (read_object): Likewise.
* gettext-tools/src/x-sh.c (read_word, read_command): Likewise.
* gettext-tools/src/x-tcl.c (read_command): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-smalltalk.c (phase3_pushback, phase3_pushback_length): New
variables.
(phase3_get): Renamed from x_smalltalk_lex. Handle pushback.
(phase3_unget): New function.
(extract_smalltalk): Update remember_a_message invocations through a lookahead
of one token.
* gettext-tools/src/x-ycp.c (phase8_pushback, phase8_pushback_length): New
variables.
(phase8_get): Handle pushback.
(phase8_unget): New function.
(extract_parenthesized): Update remember_a_message invocations through a
lookahead of one token.
* gettext-tools/tests/xgettext-15: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

5 years agomsgcat: Signal error when the same msgid is used with and without msgid_plural.
Bruno Haible [Sun, 29 Sep 2019 18:20:36 +0000 (20:20 +0200)] 
msgcat: Signal error when the same msgid is used with and without msgid_plural.

Suggested by Mikko Rantalainen <mikko.rantalainen@peda.net>
in <https://lists.gnu.org/archive/html/bug-gettext/2019-09/msg00020.html>.

* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Signal an error when
the same msgid is used with and without msgid_plural.
* gettext-tools/src/msgcat.c (main): Exit with failure code if there was an
error.
* gettext-tools/src/msgcomm.c (main): Likewise.
* gettext-tools/src/msguniq.c (main): Likewise.
* gettext-tools/tests/msgcat-21: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

5 years agolibxml: Fix buffer overrun.
Bruno Haible [Sun, 29 Sep 2019 14:50:15 +0000 (16:50 +0200)] 
libxml: Fix buffer overrun.

Reported by GCC 8 -Wformat-truncation warning.

* gnulib-local/lib/libxml/parser.c (xmlParseReference): Increase size of buffer
'out' to 12 bytes.

5 years agoxgettext: Fix parsing of XML tags.
Bruno Haible [Sun, 29 Sep 2019 12:35:37 +0000 (14:35 +0200)] 
xgettext: Fix parsing of XML tags.

* gettext-tools/src/x-javascript.c (phase5_get): Fix lexical_context after
decrementing xml_element_depth.

5 years agoxgettext: Fix parsing of XML tags that end in /> and have attributes.
Bruno Haible [Sun, 29 Sep 2019 12:29:41 +0000 (14:29 +0200)] 
xgettext: Fix parsing of XML tags that end in /> and have attributes.

Reported by Matej Marusak <marusak.matej@gmail.com>
in <https://savannah.gnu.org/bugs/?56848>.

* gettext-tools/src/x-javascript.c (phase5_get): After reading a string, reset
the lexical_context to the previous one, not to lc_outside. When reading /> at
the end of an XML element, decrement xml_element_depth.
* gettext-tools/tests/xgettext-javascript-6: Add a test.

5 years agoxgettext: Recognize text blocks in Java parser.
Bruno Haible [Sun, 29 Sep 2019 10:58:09 +0000 (12:58 +0200)] 
xgettext: Recognize text blocks in Java parser.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add
unictype/syntax-java-whitespace.
* gettext-tools/src/x-java.c: Include unictype.h.
(strip_indent): New function.
(phase5_get): Parse text blocks (Java 13 syntax).
* gettext-tools/tests/xgettext-java-2: Add tests of text blocks.
* gettext-tools/doc/gettext.texi (Java): Mention the text block syntax.
* NEWS: Mention the change.

5 years agoxgettext: Verify parsing of JavaScript template literals inside objects.
Bruno Haible [Sun, 29 Sep 2019 08:54:32 +0000 (10:54 +0200)] 
xgettext: Verify parsing of JavaScript template literals inside objects.

Reported by Andy Holmes <andrew.g.r.holmes@gmail.com>
in <https://savannah.gnu.org/bugs/?50920>.

* gettext-tools/tests/xgettext-javascript-7: Test template literals inside an
object.

5 years agoxgettext: Recognize 'env' and assignments in Shell scripts.
Bruno Haible [Mon, 16 Sep 2019 00:47:44 +0000 (02:47 +0200)] 
xgettext: Recognize 'env' and assignments in Shell scripts.

Reported by Jason Vas Dias <jason.vas.dias@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2019-08/msg00032.html>.

* gettext-tools/src/x-sh.c (enum word_type): Add t_assignment.
(read_word): Recognize assignments.
(read_command): In a function position, ignore assignments and 'env' tokens.
* gettext-tools/tests/xgettext-sh-7: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

5 years agoDocument improvement done on 2019-05-20.
Bruno Haible [Sun, 15 Sep 2019 23:45:20 +0000 (01:45 +0200)] 
Document improvement done on 2019-05-20.

* gettext-runtime/NEWS: Document improvement.
* NEWS: Likewise.

5 years agobuild: Install gettext.h with the LGPL license header, not with the GPL header.
Bruno Haible [Sat, 14 Sep 2019 13:25:36 +0000 (15:25 +0200)] 
build: Install gettext.h with the LGPL license header, not with the GPL header.

Reported by Joachim Metz <joachim.metz@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2012-09/msg00000.html>.

* gettext-tools/gnulib-lib/Makefile.am (gettextsrcdir, gettextsrc_DATA): Remove
variables.
* gnulib-local/Makefile.am (gettextsrcdir, gettextsrc_DATA): Define them here.

5 years agoClarify license of gettext.m4.
Bruno Haible [Sat, 14 Sep 2019 13:20:21 +0000 (15:20 +0200)] 
Clarify license of gettext.m4.

* gettext-runtime/m4/gettext.m4: Update comments: libintl is under LGPLv2.1+.

5 years agobuild: Avoid failing a configure test due to CFLAGS="-Werror".
Bruno Haible [Sat, 14 Sep 2019 11:30:24 +0000 (13:30 +0200)] 
build: Avoid failing a configure test due to CFLAGS="-Werror".

Reported by Florian Weimer <fweimer@redhat.com>.

* gettext-runtime/m4/intdiv0.m4 (gt_INTDIV0): In the test program, include
<unistd.h>, for the declaration of _exit().

5 years agobuild: Add support for shallow-cloning of subdirectories.
Bruno Haible [Sun, 1 Sep 2019 15:51:31 +0000 (17:51 +0200)] 
build: Add support for shallow-cloning of subdirectories.

* gitsub.sh (func_usage): Document allowed git options with 'git pull'.
(func_pull): Accept GIT_OPTIONS argument.
(pull): Parse git options before complaining about too many arguments.
Pass the git options to func_pull.

5 years agoxgettext: Assume that Python source files are in UTF-8 by default.
Bruno Haible [Sun, 25 Aug 2019 21:37:44 +0000 (23:37 +0200)] 
xgettext: Assume that Python source files are in UTF-8 by default.

Reported by ilias iliadis <apiuano-bugs@yahoo.gr>
at <https://savannah.gnu.org/bugs/?55231>.

* gettext-tools/src/xg-encoding.h (xgettext_global_source_encoding): Allow a
NULL value.
* gettext-tools/src/xg-encoding.c (xgettext_global_source_encoding): Likewise.
* gettext-tools/src/xgettext.c (main): Initialize
xgettext_global_source_encoding with NULL, not "ASCII". Handle a NULL
xgettext_global_source_encoding.
(extract_from_file): Use ASCII as default for xgettext_global_source_encoding.
* gettext-tools/src/x-javascript.c (extract_javascript): Likewise.
* gettext-tools/src/x-python.c (phase2_getc): Signal an error when encountering
an invalid or incomplete UTF-8 character.
(set_current_file_source_encoding): In the error message, use
xgettext_current_file_source_encoding instead of
xgettext_global_source_encoding.
(extract_python): Use UTF-8 as default for xgettext_global_source_encoding.
* gettext-tools/tests/xgettext-python-3: Verify that if the source file has no
magic coding comment but is UTF-8 encoded, xgettext succeeds.
* NEWS: Mention the change.

5 years agoAdd support for Java format strings in the Formatter syntax.
Bruno Haible [Sun, 25 Aug 2019 17:17:21 +0000 (19:17 +0200)] 
Add support for Java format strings in the Formatter syntax.

* gettext-tools/src/message.h (format_type): Add format_java_printf.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add
entry for format_java_printf.
* gettext-tools/src/format.h (formatstring_java_printf): New declaration.
* gettext-tools/src/format-java.c: Update comments.
* gettext-tools/src/format-java-printf.c: New file.
* gettext-tools/src/format.c (formatstring_parsers): Add entry for
format_java_printf.
* gettext-tools/src/x-java.h (SCANNERS_JAVA): Use formatstring_java_printf.
* gettext-tools/src/x-java.c (init_flag_table_java): Add entries relevant to
format strings in Formatter syntax.
* gettext-tools/src/xgettext.c (xgettext_record_flag): Add support for
format_java_printf.
* gettext-tools/src/FILES: Add format-java-printf.c.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-java-printf.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_java_printf.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Likewise.
* gettext-tools/tests/xgettext-6 (xg-test6.java): Add test for recognition of
format strings in Formatter syntax.
* gettext-tools/tests/format-java-printf-1: New file.
* gettext-tools/tests/format-java-printf-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/tests/lang-java: Add two uses of String.format to the program.
* gettext-tools/doc/gettext.texi (PO Files): Document java-printf-format and
no-java-printf-format.
(java-format): Describe both kinds of format strings. Update URLs.
(Java): Mention the second kind of format string as well.
* NEWS: Mention the improvement.

5 years agotests: Remove comments about GCJ.
Bruno Haible [Sun, 25 Aug 2019 17:00:26 +0000 (19:00 +0200)] 
tests: Remove comments about GCJ.

We don't support GCJ any more since 2017-05-04.

* gettext-tools/tests/lang-java: Remove comment about failure with GCJ.
* gettext-tools/tests/msgunfmt-java-1: Likewise.

5 years agoUpdate compile-command in comments.
Bruno Haible [Sun, 25 Aug 2019 14:21:09 +0000 (16:21 +0200)] 
Update compile-command in comments.

* gettext-tools/src/format-*.c: Fix -I options in compile-command.

5 years agodesktop: Small parser fix.
Bruno Haible [Sun, 25 Aug 2019 09:46:48 +0000 (11:46 +0200)] 
desktop: Small parser fix.

* gettext-tools/src/read-desktop.c (desktop_lex): Fix handling of control
characters in group names.

5 years agocode style: Avoid gratuitous 'continue;' statements.
Bruno Haible [Sun, 25 Aug 2019 09:38:22 +0000 (11:38 +0200)] 
code style: Avoid gratuitous 'continue;' statements.

* gettext-tools/src/file-list.c (read_names_from_file): Use 'if' instead of
'continue'.
* gettext-tools/src/its.c (its_rule_list_add_from_doc): Likewise.
* gettext-tools/src/locating-rule.c (locating_rule_list_add_from_file):
Likewise.
* gettext-tools/src/msgfmt.c (get_languages): Likewise.
* gettext-tools/src/x-javascript.c (phase5_scan_xml_markup): Likewise.
* gettext-tools/src/x-lua.c (phase2_getc): Likewise.
* gettext-tools/src/read-desktop.c (desktop_lex): Use 'if' instead of 'switch'
with few alternatives. Test for EOF first.

5 years agoautogen.sh: Make more reliable.
Bruno Haible [Sat, 24 Aug 2019 17:25:06 +0000 (19:25 +0200)] 
autogen.sh: Make more reliable.

* autogen.sh: Really bail out if gnulib-tool fails to copy config.{guess,sub}.

5 years agoxgettext: Handle newlines in Lua long bracket literal strings correctly.
Bruno Haible [Thu, 22 Aug 2019 14:36:59 +0000 (16:36 +0200)] 
xgettext: Handle newlines in Lua long bracket literal strings correctly.

Reported by Frans de Jonge <fransdejonge@gmail.com>
at <https://savannah.gnu.org/bugs/?56794>.

* gettext-tools/src/x-lua.c (phase3_get): Test for EOF first. After an opening
long bracket, swallow one newline.
* gettext-tools/tests/xgettext-lua-1: Add tests for newlines in long brackets.
* gettext-tools/tests/xgettext-lua-2: Update comment.