6742 Commits

Author SHA1 Message Date
Daiki Ueno
de4796a11d xgettext: Support per-file options
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add getsubopt.
* gettext-tools/src/xgettext.c: Include <fnmatch.h>.
(long_options): Add --options.
(main): Handle --options.  Factor out language guessing to...
(filename_to_language): ...here.
(usage): Mention --options.
(enum suboption_type): New enum.
(suboption_tokens): New variable.
(struct suboption_ty, struct suboption_list_ty,
struct suboption_list_list_ty): New struct.
(suboption_list_destroy, suboption_list_insert,
suboption_list_list_destroy, suboption_list_list_insert): New function.
(suboptions): New variable.
2016-03-02 19:18:40 +09:00
Daiki Ueno
b0af5330b3 xgettext: Add new check bullet-unicode
* gettext-tools/src/xgettext.c (main): Generalize --check option
handling.
* gettext-tools/src/message.h (enum syntax_check_type): New enum value
sc_bullet_unicode.
(NSYNTAXCHECKS): Increment.
* gettext-tools/src/message.c (syntax_check_name): Add name for
sc_bullet_unicode.
* gettext-tools/src/msgl-check.c (struct bullet_ty, struct
bullet_stack_ty): New struct.
(bullet_stack): New variable.
(syntax_check_bullet_unicode): New function.
(sc_funcs): Register syntax_check_bullet_unicode as a check function for
sc_bullet_unicode.
* gettext-tools/tests/xgettext-14: Add tests for --check=bullet-unicode
2016-02-22 17:59:40 +09:00
Daiki Ueno
16c93d9147 doc: Mention the behavior stripping *.in
* gettext-tools/doc/gettext.texi (Preparing ITS Rules): Add footnote
explaining the matching behavior if the input file name has the .in
suffix.  Suggested by Jan Synacek.
2016-02-10 15:50:39 +09:00
Daiki Ueno
9b9ebf8f96 javascript: Support '%m$' in format strings
Gjs has had support for numbered arguments in format strings since 1.40.
Recognize it as well in format-javascript, so msgfmt -c doesn't fail
when numbered arguments are in msgstr.  Reported by Sean Burke in:
https://lists.gnu.org/archive/html/bug-gettext/2015-10/msg00002.html
* gettext-tools/src/format-javascript.c (struct numbered_arg): New
struct.
(struct spec): Rename format_args_count to numbered_arg_count.  Add
NUMBERED field in place of FORMAT_ARGS.  All callers changed.
(numbered_arg_compare): New function.
(format_parse): Handle numbered arguments.  Based on format-awk.c.
(format_check): Add check for numbered arguments.
* gettext-tools/tests/format-javascript-1: Add tests for numbered
arguments.
* gettext-tools/tests/lang-javascript: Use numbered argument in format
strings.  Add check for Gjs version >= 1.40.
2016-02-08 12:40:23 +09:00
Daiki Ueno
c1eb1c8758 moopp: Revert file modes accidentally set 2016-02-08 11:59:56 +09:00
KO Myung-Hun
62d6e88d34 gettext-tools: Use a short name for DLLs on OS/2
OS/2 does not support a DLL name longer than 8 characters.

* gettext-tools/configure.ac (OS2): Define on OS/2.
* gettext-tools/gnulib-lib/Makefile.am (libgettextlib_la_LDFLAGS):
Set a DLL name to gtlib on OS/2.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_LDFLAGS):
Set a DLL name to gtpo on OS/2.
* gettext-tools/src/Makefile.am (libgettextsrc_la_LDFLAGS): Set a DLL
name to gtsrc on OS/2.
2016-01-20 11:38:26 +09:00
KO Myung-Hun
429e302f52 libasprintf: Build a shared library on OS/2
* gettext-runtime/libasprintf/configure.ac (LTNOUNDEF): Set to
-no-undefined on OS/2.
2016-01-20 11:38:23 +09:00
KO Myung-Hun
2a23de5580 intl: Support UNIXROOT in BINDTEXTDOMAIN () on EMX
$UNIXROOT is a drive on which a root of FHS is.

* gettext-runtime/intl/bindtextdom.c (BINDTEXTDOMAIN): Prepend
$UNIXROOT to dirname if it is started '/' or it is an empty string.
2016-01-20 11:38:19 +09:00
KO Myung-Hun
9c6af03886 moop: Replace CR as well as LF with a space
On OS/2, EOL marker is CR+LF.

* gnulib-local/bulid-aux/moopp (func_check_header_syntax):
Replace CR as well as LF with a space.
2016-01-20 11:37:18 +09:00
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
Santiago Vila
d9cc9dd1de * PACKAGING: List version specific files
Copyright-paperwork-exempt: yes
2016-01-05 10:05:04 +09:00
Daiki Ueno
7fa0c2779d maint: Update copyright year 2016-01-02 18:58:05 +09:00
Daiki Ueno
931677259a Update gnulib 2016-01-02 18:42:56 +09:00
Daiki Ueno
faacecdc43 maint: Use maintainer-makefile from gnulib
* autogen.sh: Pull GNUmakefile, maint.mk, and dependency scripts in
build-aux.
* cfg.mk (update-copyright-env): Adjust for gettext.
* .x-update-copyright: New file.
* .gitignore: Ignore files brought in by gnulib-tool.
2016-01-02 18:42:13 +09:00
Daiki Ueno
6d9150aad7 maint: Update release-steps to current practice
* Admin/release-steps: Split document into two sections ('Making a
snapshot release' and 'Making an official release'), reorder some steps,
and remove mention of manual generation of PO/POT files.
2015-12-28 16:26:14 +09:00
Daiki Ueno
d48f867c8f Release 0.19.7 v0.19.7 2015-12-28 07:58:27 +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
61bbedee6e doc: Regenerate translation matrix
* gettext-runtime/ABOUT-NLS: Regenerate for 0.19.7.
* gettext-runtime/doc/matrix.texi: Regenerate for 0.19.7.
2015-12-28 07:58:08 +09:00
Daiki Ueno
bca094a367 NEWS: Add 0.19.7 changes 2015-12-28 07:58:08 +09:00
Daiki Ueno
7ef4656914 Update gnulib 2015-12-28 07:57:48 +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
8054ef1150 term-ostream-tests: Add test data for FreeBSD 10.1
* gnulib-local/modules/term-ostream-tests: Add
test-term-ostream-xterm-freebsd101.out.
* gnulib-local/tests/test-term-ostream-xterm: Use new test data.
* gnulib-local/tests/test-term-ostream-xterm-freebsd101.out: New file.
2015-12-23 16:10:15 +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
7d14c54656 po: Prefer to use host tools when cross compiling
* gettext-runtime/po/Makefile.in.in (CROSS_COMPILING): New substitute
variable.
(.nop.po-update): Don't prepend ../src to $PATH when cross compiling.
* gettext-runtime/po/Rules-quot (.insert-header.po-update-en): Likewise.
2015-12-17 17:12:49 +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
bd00ae221f gnulib-local: Fix link error due to symbol dupes
* gnulib-local/lib/libxml/trionan.c (minus_zerod): Mark as static.
2015-12-15 12:20:46 +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
a2e0a31298 gnulib-local: Update included libxml2 to 2.9.3
* gnulib-local/lib/libxml/*: Update from libxml2 2.9.3.  Add buf.[ch],
enc.h, save.h, triodef.h, trionan.[ch].  Enable XPath and XPointer
support.
* gnulib-local/modules/libxml (Files): Add new files from libxml2 2.9.3.
2015-12-14 12:32:33 +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
4e1ffb3789 gnulib-local: Make markup.c translator friendly
* gnulib-local/lib/markup.c: Reuse strings.
2015-12-10 17:39:58 +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
660d9c6bc5 intl: Fix name resolution failures on kLIBC
kLIBC already has _nl_default_dirname and _nl_msg_cat_cntr in its own
gettext implmenetation.
* gettext-runtime/intl/dcigettext.c: Do not declare _nl_default_dirname
on kLIBC.
* gettext-runtime/intl/gettextP.h: Define _nl_msg_cat_cntr to
libintl_nl_msg_cat_cntr on kLIBC.

Copyright-paperwork-exempt: yes
2015-12-10 12:45:20 +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
KO Myung-Hun
8f36b74295 test-lock: Do not include sched.h on kLIBC
* gettext-runtime/tests/test-lock.c: Do not include sched.h on kLIBC,
since kLIBC does not have sched.h.

Copyright-paperwork-exempt: yes
2015-12-10 12:43:21 +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
618752075e build: Update DEPENDENCIES
* DEPENDENCIES: Remove duplicate entry for libxml2.
2015-12-10 04:37:55 +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