Daiki Ueno [Mon, 5 Oct 2015 08:18:41 +0000 (17:18 +0900)]
msgfmt: Support XML file merging
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add write-xml.h.
(msgfmt_SOURCES): Add write-xml.c.
* gettext-tools/src/its.c (its_merge_context_merge_node): New function.
(its_merge_context_merge): New function.
(its_merge_context_alloc): New function.
(its_merge_context_write): New function.
(its_merge_context_free): New function.
* gettext-tools/src/its.h (its_merge_context_ty): New type.
* gettext-tools/src/msgfmt.c: Include "its.h", "locating-rule.h", and
"write-xml.h".
(SIZEOF): New macro.
(xml_mode, xml_locale_name, xml_template_name, xml_base_directory,
xml_language, xml_its_rules): New variable.
(long_options): Add --language and --xml.
(main): Handle new options.
(usage): Document new options.
(msgfmt_xml_bulk): New function.
* gettext-tools/src/write-xml.c: New file.
* gettext-tools/src/write-xml.h: New file.
* gettext-tools/doc/gettext.texi: Mention XML file merging use-case.
* gettext-tools/doc/msgfmt.texi: Mention --xml option.
* gettext-tools/tests/msgfmt-xml-1: New file.
* gettext-tools/tests/msgfmt-xml-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new tests.
Daiki Ueno [Fri, 2 Oct 2015 03:44:04 +0000 (12:44 +0900)]
xgettext: Rewrite Glade scanner in ITS
* gettext-tools/its/glade.loc: New file.
* gettext-tools/its/glade1.its: New file.
* gettext-tools/its/glade2.its: New file.
* gettext-tools/its/gtkbuilder.its: New file.
* gettext-tools/its/Makefile.am (dist_its_DATA): Add new files.
* gettext-tools/src/Makefile.am (xgettext_SOURCES): Remove x-glade.c.
* gettext-tools/src/x-glade.c: Remove.
* gettext-tools/src/x-glade.h (EXTENSIONS_GLADE): Set language field to
NULL.
(SCANNERS_GLADE): Set func field to NULL.
* gettext-tools/po/POTFILES.in: Remove x-glade.c
Daiki Ueno [Fri, 2 Oct 2015 03:38:14 +0000 (12:38 +0900)]
xgettext: Rewrite GSettings scanner in ITS
* gettext-tools/its/gsettings.its: New file.
* gettext-tools/its/gsettings.loc: New file.
* gettext-tools/its/Makefile.am (dist_its_DATA): Add new files.
* gettext-tools/src/Makefile.am (xgettext_SOURCES): Remove x-gsettings.c.
* gettext-tools/src/x-gsettings.c: Remove.
* gettext-tools/src/x-gsettings.h (EXTENSIONS_GSETTINGS): Set language
field to NULL.
(SCANNER_GSETTINGS): Set func field to NULL.
Daiki Ueno [Fri, 2 Oct 2015 02:38:29 +0000 (11:38 +0900)]
xgettext: Rewrite AppData scanner in ITS
* gettext-tools/its/appdata.loc: New file.
* gettext-tools/its/appdata.its: New file.
* gettext-tools/its/Makefile.am (dist_its_DATA): Add new files.
* gettext-tools/src/Makefile.am (xgettext_SOURCES): Remove x-appdata.c.
* gettext-tools/src/x-appdata.c: Remove.
* gettext-tools/src/x-appdata.h (EXTENSIONS_APPDATA): Set language
field to NULL.
(SCANNERS_APPDATA): Set func field to NULL.
Daiki Ueno [Thu, 15 Oct 2015 01:18:03 +0000 (10:18 +0900)]
build: Generate ChangeLogs for intl and po
* autogen.sh: Create empty ChangeLog files under intl and po.
* Makefile.am (gen-ChangeLogs): Rename from gen-ChangeLog. Generate
ChangeLog files for */intl and */po as well as top-level.
* gettext-runtime/intl/ChangeLog.0: Rename from ChangeLog.
* gettext-runtime/po/ChangeLog.0: Rename from ChangeLog.
* gettext-tools/po/ChangeLog.1: Rename from ChangeLog.
Mike Frysinger [Mon, 12 Oct 2015 21:57:27 +0000 (17:57 -0400)]
tests: use check_PROGRAMS
The noinst_xxx targets will be compiled all the time. For test programs,
the check_xxx targets make more sense as they'll only be built when the
user runs `make check`.
* gettext-runtime/tests/Makefile.am (noinst_PROGRAMS): Rename to ...
(check_PROGRAMS): ... this.
Mike Frysinger [Mon, 12 Oct 2015 22:00:43 +0000 (18:00 -0400)]
intl/localename: control langinfo.h inclusion
This header is only used to work around buggy behavior in old versions
of glibc, so do not include it all the time. Otherwise we get build
failures on systems that do not provide langinfo.h.
* gettext-runtime/intl/localename.c: Wrap langinfo.h include with same
ifdefs used in the source later on.
Daiki Ueno [Wed, 14 Oct 2015 01:20:34 +0000 (10:20 +0900)]
build: Remove ChangeLogs
Generate ChangeLog files at "make dist" time, using
gitlog-to-changelog. We still keep ChangeLog files under "po" and
"intl" directories, since those files are copied as part of gettext
infrastructure and it is still meaningful to have them there.
* .gitignore: Add ChangeLog files.
* Admin/release-steps: Remove mention of running update-changelog
script.
* Admin/update-changelog: Remove.
* Makefile.am (gen-ChangeLog): New rule.
* autogen.sh: Copy gitlog-to-changelog from gnulib. Create empty
ChangeLog files to suppress Automake errors.
* gettext-tools/doc/Makefile.am (EXTRA_DIST): Remove ChangeLog.0.
* gettext-tools/man/Makefile.am (EXTRA_DIST): Remove ChangeLog.0.
* gettext-tools/src/Makefile.am (EXTRA_DIST): Remove ChangeLog.0.
* gettext-tools/tests/Makefile.am (EXTRA_DIST): Remove ChangeLog.0.
* gnulib-local/Makefile.am (EXTRA_DIST): Remove ChangeLog files.
* */ChangeLog: Rename to ChangeLog.0 or ChangeLog.1.
* HACKING: Add brief guideline to submit patches.
Daiki Ueno [Tue, 6 Oct 2015 07:27:40 +0000 (16:27 +0900)]
doc: Don't expose generated version
* gettext-tools/doc/Makefile.am ($(srcdir)/stamp-vti): Set
ARCHIVE-VERSION, derived from $(ARCHIVE_VERSION) in version.texi.
* gettext-tools/doc/gettext.texi (Files under Version Control): Refer to
ARCHIVE-VERSION, instead of VERSION.
* gettext-tools/doc/autopoint.texi: Refer to ARCHIVE-VERSION, instead of VERSION.
Daiki Ueno [Tue, 6 Oct 2015 03:35:15 +0000 (12:35 +0900)]
msgfmt: More refactoring on --desktop
* msgfmt.c (msgfmt_desktop_bulk): Distinguish the number of errors
and the exit status.
* write-desktop.c (msgdomain_write_desktop_bulk): Don't
immediately exit when fwriteerror() returns error.
Daiki Ueno [Mon, 5 Oct 2015 07:33:31 +0000 (16:33 +0900)]
msgfmt: Refactor --desktop handling
* gettext-tools/src/msgfmt.c (get_languages): Avoid redundant memory
allocation.
(msgfmt_operand_list_init): New function.
(msgfmt_operand_list_destroy): New function.
(msgfmt_operand_list_append): New function.
(msgfmt_operand_list_add_directory): New function.
(msgfmt_desktop_bulk): Rewrite using msgfmt_operand_list_ty.
* gettext-tools/src/msgfmt.h (msgfmt_operand_ty,
msgfmt_operand_list_ty): New type.
* gettext-tools/src/write-desktop.c (msgdomain_write_desktop_bulk):
Simplify using msgfmt_operand_list_ty.
(msgdomain_write_desktop): Simplify using msgfmt_operand_list_ty.
* gettext-tools/src/write-desktop.h (msgdomain_write_desktop_bulk):
Take OPERANDS as the first argument, instead of LANGUAGES and MESSAGES.
Daiki Ueno [Tue, 6 Oct 2015 00:59:32 +0000 (09:59 +0900)]
sentence: Avoid compiler warnings
* gettext-tools/src/sentence.c (sentence_end): Assign initial values to
local variables to suppress compiler warnings with
-Wmaybe-uninitialized. This shouldn't address any real bug.
"csharpdoc" is a bit too long to accommodate long file names with
the version returned from git-version-gen:
tar: gettext-0.19.6.4-1e74e4/.../csharpdoc/...: file name is too
long (max 99); not dumped
* gettext-runtime/intl-csharp/doc: Rename from csharpdoc.
* gettext-runtime/intl-cshap/Makefile.am (doc, DOC_FILES): Adjust to the
directory name change.
Daiki Ueno [Fri, 21 Aug 2015 05:43:30 +0000 (14:43 +0900)]
xgettext: Allow multiple --copyright-holder
Feature requested by Francesco Poli in:
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=682580>.
* xgettext.c (default_copyright_holder): New constant, renamed
from copyright_holder.
(copyright_holder): Define as a variable.
(main): Allow multiple --copyright-holder options.
(construct_header): Support multiple --copyright-holder options.
Daiki Ueno [Fri, 21 Aug 2015 01:22:01 +0000 (10:22 +0900)]
intl: Pacify compilation with pre-C99 compilers
* loadmsgcat.c (_nl_load_domain): Move the call to
__libc_lock_define_initialized_recursive to the end of local
variable declarations to avoid extra ';' being expanded to an
empty statement.
Reported by pan7 in:
<http://savannah.gnu.org/support/?108864>.
* gettext-tools/configure.ac (ARCHIVE_VERSION): New substituted
variable.
* gettext-tools/misc/gettextize.in (archive_version): New variable, set
to ARCHIVE_VERSION. Use it as the argument of AM_GNU_GETTEXT_VERSION.
* gettext-tools/tests/init-env.in (ARCHIVE_VERSION): New substituted
variable.
* gettext-tools/tests/autopoint-2: Use ARCHIVE_VERSION, instead of the
hard-coded version string.
* gettext-tools/tests/autopoint-3: Likewise.
Reported by Max Lin in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-07/msg00024.html>.
* gettextize.in: Replace AM_GNU_GETTEXT_VERSION invocation with
"$gettext_version" rather than "$version". This makes it easier
to maintain a minor release without being affected by the actual
version number generated by git-version-gen.
(gettext_version): New variable.
Compilation of the cldr-plurals tool was broken in the relocatable case
because of missing CPPFLAGS/LDFLAGS. Add the same flags used by other
tools to the makefile.
* gettext-tools/src/Makefile.am (cldr_plurals_CPPFLAGS)
(cldr_plurals_LDFLAGS): Adjust for --enable-relocatable
compilation.
Daiki Ueno [Mon, 29 Jun 2015 02:44:52 +0000 (11:44 +0900)]
msginit: Remove obsolete country codes
* gettext-tools/src/msginit.c (catalogname_for_locale): Remove sr_YU,
which were removed from ISO 3166-1:1997. Add comment saying that
pap_AN, which were removed from ISO 3166-1:2006, can be removed in the
future.
Reported by Jakub Wilk in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00057.html>.
Daiki Ueno [Thu, 25 Jun 2015 12:02:47 +0000 (21:02 +0900)]
xgettext: Fix the last change to literalstring
* gettext-tools/src/x-c.c (literalstring_parse): Bail out if C == NUL.
Also adjust the loop invariant in Unicode literal handling.
Reported by Hanno Boeck in:
<http://savannah.gnu.org/bugs/?45391>.
Daiki Ueno [Thu, 25 Jun 2015 02:37:39 +0000 (11:37 +0900)]
xgettext: Make literal parser robust against NUL
* gettext-tools/src/x-c.c (literalstring_parse): Add more NUL checks.
Change the loop invariant so that C always points to the character
previously pointed by P.
Reported by Hanno Boeck in:
<http://savannah.gnu.org/bugs/?45391>.
* gettext-tools/tests/xg-c-21.c (main): New file.
* gettext-tools/tests/xgettext-c-21 (result): New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new test.
(EXTRA_DIST): Add xg-c-21.c.
Daiki Ueno [Wed, 24 Jun 2015 14:23:22 +0000 (23:23 +0900)]
xgettext: avoid out-of-bounds read in literals
* gettext-tools/src/x-c.c (literalstring_parse): Check if the next
character of a backslash is NUL. Reported by Hanno Boeck in:
<http://savannah.gnu.org/bugs/?45391>.
Daiki Ueno [Wed, 24 Jun 2015 03:04:25 +0000 (12:04 +0900)]
tests: Don't rely on echo -n
* gettext-tools/tests/msgfilter-8: Port the "echo -n" equivalent from gettext-2.
Reported by paul zimmermann in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00019.html>.
Daiki Ueno [Tue, 23 Jun 2015 09:04:35 +0000 (18:04 +0900)]
build: Fix build failure on Solaris
* gettext-tools/src/cldr-plurals.c: Include "basename.h".
(main): Place optind on the right hand side of the expression, to
work around build failure on Solaris.
Reported by Dagobert Michelsen in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00015.html>.
Daiki Ueno [Tue, 23 Jun 2015 04:03:09 +0000 (13:03 +0900)]
m4, help2man: Update from gnulib
* gettext-runtime/m4/codeset.m4: Update copyright year.
* gettext-runtime/m4/gettext.m4: Likewise.
* gettext-runtime/m4/iconv.m4: Likewise.
* gettext-runtime/m4/intl.m4: Likewise.
* gettext-runtime/m4/intldir.m4: Likewise.
* gettext-runtime/m4/intlmacosx.m4: Likewise.
* gettext-runtime/m4/lcmessage.m4: Likewise.
* gettext-runtime/m4/nls.m4: Likewise.
* gettext-runtime/m4/po.m4: Likewise.
* gettext-runtime/m4/extern-inline.m4: Likewise. Port the following
change:
2015-04-29 Paul Eggert <eggert@cs.ucla.edu>
extern-inline: no need for workaround in GCC 5.1
* doc/extern-inline.texi (extern inline):
* m4/extern-inline.m4 (gl_EXTERN_INLINE):
GCC bugs 54113 and 63877 are fixed in GCC 5.1, so don't work
around these bugs in GCC 5.1 and later. Maybe in a decade or
two we can remove these workarounds.
* gettext-tools/man/help2man: Update copyright year.
Daiki Ueno [Tue, 23 Jun 2015 03:28:41 +0000 (12:28 +0900)]
intl: Update locale.alias
* locale.alias: Update from glibc:
2015-05-22 Paul Eggert <eggert@cs.ucla.edu>
Remove obsolete aliases that broke 'locale -a'
[BZ #18412]
* intl/locale.alias: Remove obsolete aliases "bokmål" and "français"
which caused 'locale -a' to output Latin-1 data in UTF-8 locales,
breaking some applications that use 'locale -a' output.
Change the encoding of this file from Latin-1 to ASCII to avoid
other potential problems with people grepping this file.
Daiki Ueno [Tue, 23 Jun 2015 01:16:25 +0000 (10:16 +0900)]
tests: Add test for msginit CLDR support
* gettext-tools/tests/msginit-4: New file.
* gettext-tools/tests/common/supplemental/plurals.xml: New data file.
* gettext-tools/tests/Makefile.am (TESTS): Add new tests.
(EXTRA_DIST): Add new data file.
Daiki Ueno [Thu, 21 May 2015 04:03:50 +0000 (13:03 +0900)]
msginit: Guess plural rules from Unicode CLDR
* gettext-tools/src/Makefile.am (noinst_PROGRAMS): Add cldr-plurals.
(install-exec-local): Install cldr-plurals.
(BUILT_SOURCES): Add cldr-plural.c and cldr-plural.h.
(cldr_plural_SOURCES): New variable.
(cldr_plural_LDADD): New variable.
* gettext-tools/src/cldr-plural-exp.h: New file.
* gettext-tools/src/cldr-plural-exp.c: New file.
* gettext-tools/src/cldr-plural.y: New file.
* gettext-tools/src/cldr-plurals.c: New file.
* gettext-tools/src/msginit.c (plural_forms): Call cldr-plurals program
if the plural rule is not defined in the code.
* gettext-tools/doc/msginit.texi: More explanations about "meta
information".
* gettext-tools/doc/gettext.texi (Plural forms): Mention Unicode CLDR
support in msginit.
* gettext-tools/tests/cldr-plurals-1: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new tests.
* NEWS: Mention msginit change.
Daiki Ueno [Mon, 1 Jun 2015 03:12:28 +0000 (12:12 +0900)]
awk: Recognize .twjr file extension
* gettext-tools/src/x-awk.h (EXTENSIONS_AWK): Register file extensions
".gawk" and ".twjr". Suggested by Karl Berry in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-05/msg00032.html>.
* gettext-tools/doc/gettext.texi (gawk): Mention new file extensions
".gawk" and ".twjr".
Daiki Ueno [Mon, 1 Jun 2015 01:19:23 +0000 (10:19 +0900)]
doc: Update link to GNU hello
* gettext.texi (Adjusting Files): Update link to GNU hello
distribution. Suggested by Karl Berry in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-05/msg00031.html>.
* gettext-tools/src/x-c.c (init_flag_table_kde): New function.
(additional_keywords_kde): New variable.
(activate_additional_keywords_kde): New function.
(init_keywords): Optional addition of KDE-specific keywords.
* gettext-tools/src/x-c.h (init_flag_table_kde): New function declaration.
(activate_additional_keywords_kde): New function declaration.
* gettext-tools/src/xgettext.c (main): Invoke addition of KDE-specific
keywords when language is C++ with KDE.