Commit Graph

3406 Commits

Author SHA1 Message Date
Bruno Haible 4d475fa298 Change msgfmt to produce little-endian .mo files by default.
* gettext-tools/src/msgfmt.c (main): Initialize 'byteswap' so as to
produce little-endian .mo files by default.
* gettext-tools/doc/gettext.texi: Update documentation.
* gettext-tools/doc/msgfmt.texi (--endianness): Likewise.
2016-01-15 10:18:25 +01:00
Daiki Ueno ba5d34e523 maint: Revert copyright year changes in test data
Some test programs started failing after mass update of copyright notice
for year 2016 (commit 7fa0c277), because of embedded test data with
fixed copyright dates.  Revert the commit for those files.
Reported by Bruno Haible.
* .x-update-copyright: Exclude test programs embedding copyright date.
* gettext-tools/tests/msgcomm-22: Revert the last change.
* gettext-tools/tests/msgfilter-sr-latin-1: Likewise.
* gettext-tools/tests/msggrep-1: Likewise.
* gettext-tools/tests/msggrep-2: Likewise.
* gettext-tools/tests/msggrep-3: Likewise.
* gettext-tools/tests/msggrep-4: Likewise.
* gettext-tools/tests/msggrep-5: Likewise.
* gettext-tools/tests/msggrep-9: Likewise.
* gettext-tools/tests/msggrep-11: Likewise.
* gettext-tools/tests/msgmerge-14: Likewise.
2016-01-13 18:57:25 +09:00
Daiki Ueno 21ca680c31 its: Recognize *.glade as a GtkBuilder file too 2016-01-07 12:00:43 +09:00
Daiki Ueno 7fa0c2779d maint: Update copyright year 2016-01-02 18:58:05 +09:00
Daiki Ueno 0a083666b1 Update translations
* gettext-runtime/po/fr.po: Update from Stéphane Aulery <lkppo@free.fr>.
* gettext-runtime/po/nb.po: Update from Johnny A. Solbu <johnny@solbu.net>.
* gettext-runtime/po/pt_BR.po: Update from Rafael Ferreira <rffontenelle@gmail.com>.
* gettext-runtime/po/sr.po: Update from Мирослав Николић <miroslavnikolic@rocketmail.com>.
* gettext-runtime/po/zh_TW.po: Update from Wei-Lun Chao <bluebat@member.fsf.org>.
* gettext-tools/examples/po/fr.po: Update from Stéphane Aulery <lkppo@free.fr>.
* gettext-tools/examples/po/nb.po: Update from Johnny A. Solbu <johnny@solbu.net>.
* gettext-tools/examples/po/pt_BR.po: Update from Rafael Ferreira <rffontenelle@gmail.com>.
* gettext-tools/examples/po/sr.po: Update from Мирослав Николић <miroslavnikolic@rocketmail.com>.
* gettext-tools/examples/po/zh_TW.po: Update from Wei-Lun Chao <bluebat@member.fsf.org>.
* gettext-tools/po/bg.po: Update from Roumen Petrov <transl@roumenpetrov.info>.
* gettext-tools/po/es.po: Update from Antonio Ceballos <aceballos@gmail.com>.
* gettext-tools/po/fr.po: Update from Stéphane Aulery <lkppo@free.fr>.
* gettext-tools/po/ja.po: Update from Masahito Yamaga <ma@yama-ga.com>.
* gettext-tools/po/nl.po: Update from Benno Schulenberg <benno@vertaalt.nl>.
* gettext-tools/po/pt_BR.po: Update from Rafael Fontenelle <rffontenelle@gmail.com>.
* gettext-tools/po/sk.po: Update from Marcel Telka <marcel@telka.sk>.
* gettext-tools/po/sl.po: Update from Primoz PETERLIN <primozz.peterlin@gmail.com>.
* gettext-tools/po/sr.po: Update from Мирослав Николић <miroslavnikolic@rocketmail.com>.
* gettext-tools/po/uk.po: Update from Yuri Chornoivan <yurchor@ukr.net>.
* gettext-tools/po/vi.po: Update from Trần Ngọc Quân <vnwildman@gmail.com>.
2015-12-28 07:58:08 +09:00
Daiki Ueno c9215f6f6b Prepare for 0.19.7 2015-12-28 07:58:08 +09:00
Daiki Ueno b01d1f543c Ignore file brought by gnulib-tool
* gettext-tools/gnulib-tests/.gitignore: Ignore file brought by
gnulib-tool.
2015-12-28 05:40:07 +09:00
Daiki Ueno 05ccf1024b cldr-plurals: Fix errors from clang-analyzer
* gettext-tools/src/cldr-plurals.c (extract_rules): Add extra null
checks for NODE and BUFFER.  Don't add NUL byte to the end of buffer
manually.
2015-12-21 12:08:00 +09:00
Daiki Ueno 3a1a9ba8f9 its: Allow CDATA and comments in translatable node
* gettext-tools/src/its.c (its_rule_list_is_translatable): Don't return
false on CDATA and comments.
2015-12-17 16:21:58 +09:00
Daiki Ueno 04dcad093c its: Fix typo in GSettings rule
* gettext-tools/its/gsettings.its: Fix typo in escape rule.
2015-12-17 16:21:43 +09:00
Daiki Ueno ffb5a824d8 gnulib-local: Pull more functions for libxml
* gettext-tools/gnulib-lib/.gitignore: Ignore files brought by
gnulib-tool.
* gettext-tools/gnulib-tests/.gitignore: Likewise.
* gnulib-local/modules/libxml (Depends-on): Add 'pow', 'log10', and
'fabs'.
2015-12-15 12:12:37 +09:00
Daiki Ueno 19ce4c30bb gnulib-local: Replace libxml2 trio with Gnulib
* gettext-tools/gnulib-lib/.gitignore: Ignore files brought by
gnulib-tool.
* gettext-tools/gnulib-tests/.gitignore: Likewise.
* gnulib-local/lib/libxml/triodef.h: Remove.
* gnulib-local/lib/libxml/trionan.c: Replace it with Gnulib functions.
* gnulib-local/lib/libxml/trionan.h: Remove.
* gnulib-local/modules/libxml (Depends-on): Add 'isinf', 'isnan', and
'signbit'.
2015-12-15 11:58:53 +09:00
Daiki Ueno 6e6f6ee91f gettext-tools: Update POTFILES.in
* gettext-tools/po/POTFILES.in: Add newly added files.
2015-12-10 17:43:54 +09:00
Daiki Ueno 4242be2336 its: Mark some attributes as escape="no"
* gettext-tools/its/glade2.its: Mark "comments" attribute as
escape="no".
* gettext-tools/its/gsettings.its: Mark "context" attribute as
escape="no".
* gettext-tools/its/gtkbuilder.its: Mark "comments" attribute as
escape="no".
2015-12-10 16:47:36 +09:00
Daiki Ueno 031cc2acb6 xgettext: Respect ITS escape rule for attributes
* gettext-tools/src/its.c (its_rule_list_extract_text): Check for
"escape" value for an attribute node.
* gettext-tools/tests/xgettext-its-1: Add tests for gt:escapeRule.
2015-12-10 16:36:59 +09:00
KO Myung-Hun 6f2223058e build: Do not include os2compat.[ch]
kLIBC does not need os2compat.[ch]
* gettext-runtime/configure.ac (AH_BOTTOM): Do not include
intl/os2compat.h on kLIBC.
* gettext-runtime/intl/osdep.c: Do not include os2compat.c on kLIBC.
* gettext-tools/configure.ac (AH_BOTTOM): Do not include
intl/os2compat.h on kLIBC.

Copyright-paperwork-exempt: yes
2015-12-10 12:44:52 +09:00
Daiki Ueno 94bfe38f02 kde: Fix KUIT error handling when libxml2 is used
* gettext-tools/src/format-kde-kuit.c (format_parse): Return NULL if
xmlReadMemory returns NULL.
2015-12-10 12:35:34 +09:00
Daiki Ueno 30d474e1ce xgettext: Add --its option for ease of testing
* gettext-tools/doc/xgettext.texi (Output details): Mention --its
option.
* gettext-tools/src/xgettext.c (long_options): Add --its option.
(main): Handle --its option.  Suggested by Sébastien Wilmet.
2015-12-10 12:11:58 +09:00
Daiki Ueno fe3fee6f1f xgettext: Improve error reporting when ITS is used
* gettext-tools/src/xgettext.c (main): Print error when an ITS file is
designated through a locating rule, but the file does not exist.
2015-12-10 11:21:36 +09:00
Daiki Ueno 898e184a59 build: Remove expat dependency
* DEPENDENCIES: Suggest libxml2 instead of expat.
* gnulib-local/lib/markup.c: New file.
* gnulib-local/lib/markup.h: New file.
* gnulib-local/modules/markup: New file.
* autogen.sh (GNULIB_MODULES_LIBGETTEXTPO): Add markup module.
* gettext-tools/configure.ac: Remove checks for expat.
* gettext-tools/gnulib-lib/.gitignore: Ignore modules pulled by
gnulib-tool due to the markup module usage.
* gettext-tools/gnulib-tests/.gitignore: Likewise.
* gettext-tools/libgettextpo/.gitignore: Likewise.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES):
Remove ../src/libexpat-compat.c.
(libgettextpo_la_LDFLAGS): Remove @LTLIBEXPAT@.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Remove
libexpat-compat.h.
(libgettextsrc_la_SOURCES): Remove libexpat-compat.c.
(libgettextsrc_la_LDFLAGS): Remove @LTLIBEXPAT@.
* gettext-tools/src/format-kde-kuit.c: Use functions from markup.h, when
the file is being compiled as part of libgettextpo.  Otherwise use
libxml2.
* gettext-tools/src/libexpat-compat.c: Remove.
* gettext-tools/src/libexpat-compat.h: Remove.
2015-12-09 19:07:06 +09:00
Daiki Ueno f6dde6baee build: Fix texi2html failure with perl 5.22
* gettext-runtime/libasprintf/texi2html (update_sec_num): Don't use
"defined" against an array ref.
* gettext-tools/doc/texi2html (update_sec_num): Likewise.
2015-12-08 19:18:10 +09:00
Daiki Ueno 21a40c91fa Update gnulib 2015-12-08 18:59:47 +09:00
Daiki Ueno c15df930c6 xgettext: Ignore --from-code when XML mode
* gettext-tools/src/xgettext.c (extract_from_xml_file): Forcibly set
current source encoding to UTF-8, on XML mode.
2015-12-08 18:28:51 +09:00
Daiki Ueno 77637e3945 build: Suppress compiler warning
* gettext-tools/src/its.c (its_rule_list_extract_text): Remove unused
local variable "message".
2015-12-08 18:27:58 +09:00
Daiki Ueno b3c2a5a242 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.
2015-12-04 13:02:40 +09:00
Daiki Ueno a2e9e11868 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
2015-12-04 13:02:40 +09:00
Daiki Ueno 0daa0c191f 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.
2015-12-04 13:02:40 +09:00
Daiki Ueno 95d20e8712 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.
2015-12-04 13:02:40 +09:00
Daiki Ueno 6fab71fdbe xgettext: Add support for generic XML files
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add trim module.
* gettext-tools/src/locating-rule.h: New file.
* gettext-tools/src/locating-rule.c: New file.
* gettext-tools/src/its.h: New file.
* gettext-tools/src/its.c: New file.
* gettext-tools/src/xgettext.c: Include "locating-rule.h" and "its.h".
(its_locators): New variable.
(long_options): Add --itstool option.
(extract_from_xml_file): New function.
(main): Handle --itstool option.
(usage): Document --itstool option.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add locating-rule.h
and its.h.
(libgettextsrc_la_CPPFLAGS): Add $(INCXML).
(libgettextsrc_la_SOURCES): Add locating-rule.c and its.c.
* gettext-tools/Makefile.am (SUBDIRS): Add its directory.
* gettext-tools/configure.ac: Output its/Makefile.
* gettext-tools/doc/gettext.texi (Preparing ITS Rules): New section.
* gettext-tools/doc/xgettext.texi: Mention --itstool option.
* gettext-tools/tests/Makefile.am (TESTS): Add new tests.
* gettext-tools/tests/xgettext-its-1: New file
* gettext-tools/tests/init-env.in: Set GETTEXTDATADIR for ITS tests.
2015-12-04 13:02:40 +09:00
Daiki Ueno 4d0dcc0c64 cldr-plurals: Add sanity checks for input
* gettext-tools/src/cldr-plurals.c (extract_rules): Add null checks and
element type checks.
2015-11-18 10:17:40 +09:00
Daiki Ueno b780a0a376 cldr-plurals: Rewrite XML handling using libxml2
* src/cldr-plurals.c: Include <libxml/tree.h> and
<libxml/parser.h>, instead of "libexpat-compat.h".
(extract_locale, extracted_rules, parser, logical_file_name)
(struct element_state, stack, stack_size, stack_depth)
(ensure_stack_size, start_element_handler, end_element_handler)
(character_data_handler): Remove.
(extract_rules): Rename from extract_rule and rewrite using DOM.
(main): Use extract_rules.
* src/Makefile.am (cldr_plurals_CFLAGS): Add $(INCXML).
2015-11-17 16:26:33 +09:00
Daiki Ueno 26200674f0 cldr-plurals: Fix a trivial leak
* src/cldr-plural.y (sample_range): Free unused operand value.
2015-11-17 16:23:07 +09:00
Phil Davis 8764218362 doc: Fix typo in gettext_noop example
* doc/gettext.texi (Special cases): Add missing ')' to
a gettext_noop call.

Copyright-paperwork-exempt: yes
2015-11-17 11:03:24 +09:00
Daiki Ueno ea367f662c doc: Fix typo in msgfmt invocation
* gettext-tools/doc/msgfmt.texi: Fix the documentation of -d option,
used in the Desktop Entry mode.
2015-10-29 16:18:14 +09:00
Daiki Ueno 767ec35d1f 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.
2015-10-15 12:37:53 +09:00
Daiki Ueno 614ff78da5 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.
2015-10-14 15:00:09 +09:00
Daiki Ueno ac1632889d hello-c-gnome3: Simplify the Desktop Entry rules
* hello-c-gnome3/Makefile.am (hello.desktop.in): Don't use a
temporary file.
(hello.desktop): Likewise.
2015-10-08 14:50:04 +09:00
Daiki Ueno 3231fe8803 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.
2015-10-06 16:28:19 +09:00
Daiki Ueno e140a5832a 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.
2015-10-06 12:35:43 +09:00
Daiki Ueno d5a1f03517 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.
2015-10-06 10:03:34 +09:00
Daiki Ueno 423d5cca70 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.
2015-10-06 10:00:09 +09:00
Daiki Ueno c00302c3b2 Release 0.19.6 2015-09-11 12:03:07 +09:00
Daiki Ueno 14df6a2c35 Update translations 2015-09-11 12:01:48 +09:00
Daiki Ueno 2a8f15846f Prepare for 0.19.6 2015-09-11 11:49:14 +09:00
Daiki Ueno 1371da1f24 gettext-tools: Remove ABOUT-NLS from repository 2015-09-11 10:43:14 +09:00
Daiki Ueno 7498236b9f Revert "xgettext: Allow multiple --copyright-holder"
This reverts commit 15363cca83.

Now that po/Makefile.in.in supports custom header for POT files, it is
not meaningful to add a special case for multiple copyright holders.
2015-09-10 16:53:11 +09:00
Daiki Ueno 3a08add578 xgettext: Replace PACKAGE placeholder if possible
* xgettext.c (construct_header): Replace PACKAGE placeholder in
the header comment.
2015-08-24 17:31:44 +09:00
Philip Withnall 55f8e0c9c5 xgettext: Add support for AppData XML files
AppData files are used to describe an application for package
management, and are described here:

http://people.freedesktop.org/~hughsient/appdata/

They may also currently be translated using intltool or itstool:

http://people.freedesktop.org/~hughsient/appdata/#translation
2015-08-21 16:22:29 +09:00
Daiki Ueno b9b0b41095 tests: Use check_PROGRAMS
* gettext-tools/tests/Makefile.am (check_PROGRAMS): Rename from
noinst_PROGRAMS, to defer the compilation until required.
2015-08-21 15:48:04 +09:00
Daiki Ueno 50eae3f047 autopoint: Respect AM_GNU_GETTEXT_REQUIRE_VERSION
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT_REQUIRE_VERSION): New macro.
Bump serial to 67.
* gettext-tools/doc/autopoint.texi: Mention AM_GNU_GETTEXT_REQUIRE_VERSION.
* gettext-tools/misc/gettextize.in: Check if AM_GNU_GETTEXT_VERSION is
used.
* gettext-tools/misc/autopoint.in: Respect AM_GNU_GETTEXT_REQUIRE_VERSION.
* gettext-tools/tests/autopoint-2: Check AM_GNU_GETTEXT_REQUIRE_VERSION.
2015-08-21 15:42:48 +09:00