summaryrefslogtreecommitdiffstats
path: root/gettext-tools/src
Commit message (Collapse)AuthorAgeFilesLines
* Android doesn't support the pw_gecos fieldWolfgang Wiedmeyer2017-06-241-1/+1
| | | | Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* maint: Update copyright yearDaiki Ueno2016-05-3015-15/+15
|
* xgettext: Update usage documentationDaiki Ueno2016-05-301-1/+1
| | | | * gettext-tools/src/xgettext.c (usage): Mention 'bullet-unicode' check.
* desktop: Add missing "extern" in headerDaiki Ueno2016-05-271-16/+19
| | | | | | * gettext-tools/src/read-desktop.h: Add "extern" to each function declaration. Possibly related to: https://savannah.gnu.org/bugs/?45896
* desktop: Fix invalid memory accessDavid Shea2016-05-241-6/+8
| | | | | | * gettext-tools/src/read-desktop.c (desktop_lex): Don't access memory deallocated with realloc(). Reported in: http://savannah.gnu.org/bugs/?47991
* javascript: Fix format type compatibility checkDaiki Ueno2016-05-231-3/+4
| | | | | * gettext-tools/src/format-javascript.c (format_check): Check if the two argument types are the same.
* search-path: Fix XDG_DATA_DIRS traversalDaiki Ueno2016-05-201-9/+23
| | | | | * gettext-tools/src/search-path.c (foreach_elements): Append "gettext" suffix to each element from XDG_DATA_DIRS.
* search-path: Don't relocate dirs given as envvarDaiki Ueno2016-05-204-95/+91
| | | | | | | | | | | | * gettext-tools/src/search-path.c (foreach_function_ty): New typedef. (path_array_ty): New struct. (foreach_components, increment, fill): New functions. (get_search_path): Rewrite using those functions. Relocate GETTEXTDATADIR here. * gettext-tools/src/search-path.h (get_search_path): Update documentation. * gettext-tools/src/msgfmt.c (main): Don't relocate directories in ITS search path. * gettext-tools/src/xgettext.c (main): Likewise.
* msgfmt, xgettext: Respect XDG_DATA_DIRSDaiki Ueno2016-05-165-53/+215
| | | | | | | | | | | | | | | Suggested in https://savannah.gnu.org/bugs/?47123 * autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add 'xmemdup0'. * gettext-tools/gnulib-lib/.gitignore: Ignore files brought by gnulib-tool. * gettext-tools/gnulib-tests/.gitignore: Likewise. * gettext-tools/src/search-path.c: New file. * gettext-tools/src/search-path.h: New file. * gettext-tools/src/Makefile.am (noinst_HEADERS): Add search-path.h. (libgettextsrc_la_SOURCES): Add search-path.c. * gettext-tools/src/msgfmt.c: Include "search-path.h". (main): Use get_search_path to locate ITS directories. * gettext-tools/src/xgettext.c: Include "search-path.h". (main): Use get_search_path to locate ITS directories.
* javascript: Avoid uninitialized variableDaiki Ueno2016-05-161-1/+1
| | | | | * gettext-tools/src/format-javascript.c (format_check): Fix loop initialization. Spotted by clang-analyzer.
* lua: Avoid heap buffer overflowHanno Boeck2016-03-261-0/+6
| | | | | | | * gettext-tools/src/x-lua.c (string_end): Allocate a room for terminating NUL. Reported in: http://savannah.gnu.org/bugs/?4753 Copyright-paperwork-exempt: yes
* format-python-brace: Support chained expressionDaiki Ueno2016-03-231-30/+37
| | | | | | | | | * gettext-tools/src/format-python-brace.c (parse_directive): Recognize chained getattr/getitem expressions. * gettext-tools/tests/format-python-brace-1: Add test for the case where both getattr and getitem are used. Reported by Paul Franklin in: https://lists.gnu.org/archive/html/bug-gettext/2016-03/msg00017.html
* javascript: Fix invalid memory accessDaiki Ueno2016-03-221-1/+1
| | | | | | | * gettext-tools/src/format-javascript.c (format_parse): Fix numbered_arg allocation for the unnumbered case. Reported by Roger Mc Murtrie in: <http://savannah.gnu.org/bugs/?47492>.
* xgettext: Put --its help in the right sectionDaiki Ueno2016-03-021-2/+4
| | | | | * gettext-tools/src/xgettext.c (usage): Move --its=FILE option under "Language specific options" from "Output details".
* xgettext: Add new check bullet-unicodeDaiki Ueno2016-02-224-11/+118
| | | | | | | | | | | | | | | | | * 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
* javascript: Support '%m$' in format stringsDaiki Ueno2016-02-081-39/+207
| | | | | | | | | | | | | | | | | | 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.
* gettext-tools: Use a short name for DLLs on OS/2KO Myung-Hun2016-01-201-0/+5
| | | | | | | | | | | | 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.
* Change msgfmt to produce little-endian .mo files by default.Bruno Haible2016-01-151-0/+1
| | | | | | | * 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.
* maint: Update copyright yearDaiki Ueno2016-01-02218-252/+227
|
* cldr-plurals: Fix errors from clang-analyzerDaiki Ueno2015-12-211-8/+10
| | | | | | * 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.
* its: Allow CDATA and comments in translatable nodeDaiki Ueno2015-12-171-0/+2
| | | | | * gettext-tools/src/its.c (its_rule_list_is_translatable): Don't return false on CDATA and comments.
* xgettext: Respect ITS escape rule for attributesDaiki Ueno2015-12-101-1/+4
| | | | | | * 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.
* kde: Fix KUIT error handling when libxml2 is usedDaiki Ueno2015-12-101-0/+3
| | | | | * gettext-tools/src/format-kde-kuit.c (format_parse): Return NULL if xmlReadMemory returns NULL.
* xgettext: Add --its option for ease of testingDaiki Ueno2015-12-101-0/+24
| | | | | | | * 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.
* xgettext: Improve error reporting when ITS is usedDaiki Ueno2015-12-101-2/+5
| | | | | * gettext-tools/src/xgettext.c (main): Print error when an ITS file is designated through a locating rule, but the file does not exist.
* build: Remove expat dependencyDaiki Ueno2015-12-094-494/+84
| | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* xgettext: Ignore --from-code when XML modeDaiki Ueno2015-12-081-3/+5
| | | | | * gettext-tools/src/xgettext.c (extract_from_xml_file): Forcibly set current source encoding to UTF-8, on XML mode.
* build: Suppress compiler warningDaiki Ueno2015-12-081-3/+1
| | | | | * gettext-tools/src/its.c (its_rule_list_extract_text): Remove unused local variable "message".
* msgfmt: Support XML file mergingDaiki Ueno2015-12-046-9/+509
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* xgettext: Rewrite Glade scanner in ITSDaiki Ueno2015-12-043-631/+9
| | | | | | | | | | | | | | * 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
* xgettext: Rewrite GSettings scanner in ITSDaiki Ueno2015-12-043-397/+6
| | | | | | | | | | | * 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.
* xgettext: Rewrite AppData scanner in ITSDaiki Ueno2015-12-043-382/+5
| | | | | | | | | | | * 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.
* xgettext: Add support for generic XML filesDaiki Ueno2015-12-046-32/+2577
| | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* cldr-plurals: Add sanity checks for inputDaiki Ueno2015-11-181-10/+17
| | | | | * gettext-tools/src/cldr-plurals.c (extract_rules): Add null checks and element type checks.
* cldr-plurals: Rewrite XML handling using libxml2Daiki Ueno2015-11-172-259/+127
| | | | | | | | | | | | * 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).
* cldr-plurals: Fix a trivial leakDaiki Ueno2015-11-171-0/+4
| | | | * src/cldr-plural.y (sample_range): Free unused operand value.
* build: Remove ChangeLogsDaiki Ueno2015-10-142-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* msgfmt: More refactoring on --desktopDaiki Ueno2015-10-063-14/+23
| | | | | | | * 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.
* msgfmt: Refactor --desktop handlingDaiki Ueno2015-10-065-92/+170
| | | | | | | | | | | | | | | | | * 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.
* sentence: Avoid compiler warningsDaiki Ueno2015-10-062-2/+8
| | | | | | * 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.
* Release 0.19.6Daiki Ueno2015-09-111-0/+4
|
* Revert "xgettext: Allow multiple --copyright-holder"Daiki Ueno2015-09-101-64/+6
| | | | | | | This reverts commit 15363cca838ff1d69f6e3bfbb47ecfe90c0f5000. 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.
* xgettext: Replace PACKAGE placeholder if possibleDaiki Ueno2015-08-242-2/+8
| | | | | * xgettext.c (construct_header): Replace PACKAGE placeholder in the header comment.
* xgettext: Add support for AppData XML filesPhilip Withnall2015-08-216-2/+439
| | | | | | | | | | | 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
* xgettext: Allow multiple --copyright-holderDaiki Ueno2015-08-212-6/+75
| | | | | | | | | | 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.
* cldr-plurals: Fix trivial resource leakDaiki Ueno2015-08-152-0/+6
| | | | | * cldr-plurals.c (main): Close FP after use. Reported by Denis Denisov.
* cldr-plurals: Fix --enable-relocatable compilationVáclav Slavík2015-07-212-0/+12
| | | | | | | | | 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.
* Release 0.19.5Daiki Ueno2015-07-101-0/+4
|
* msginit: Remove obsolete country codesDaiki Ueno2015-06-292-2/+10
| | | | | | | | | * 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>.
* xgettext: Fix the last change to literalstringDaiki Ueno2015-06-252-11/+22
| | | | | | | * 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>.