From: Bruno Haible Date: Mon, 15 Sep 2008 10:43:09 +0000 (+0000) Subject: New msgcmp option --no-fuzzy-matching. X-Git-Tag: v0.18~341 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e3c34da4f06e07ceb071bc14ed91ba28134ff6c;p=thirdparty%2Fgettext.git New msgcmp option --no-fuzzy-matching. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index bfed4904b..6ccc449ff 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2009-09-15 Bruno Haible + + * msgcmp.c (use_fuzzy_matching): New variable. + (long_options): Add option -N/--no-fuzzy-matching. + (main, match_domain): Implement it. + (usage): Document it. + 2008-09-14 Bruno Haible * msgl-fsearch.h (message_fuzzy_index_search): Add 'lower_bound' diff --git a/gettext-tools/src/msgcmp.c b/gettext-tools/src/msgcmp.c index 2188e654d..c51dd51a4 100644 --- a/gettext-tools/src/msgcmp.c +++ b/gettext-tools/src/msgcmp.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2008 Free Software Foundation, Inc. This file was written by Peter Miller This program is free software: you can redistribute it and/or modify @@ -50,6 +50,9 @@ /* Apply the .pot file to each of the domains in the PO file. */ static bool multi_domain_mode = false; +/* Determines whether to use fuzzy matching. */ +static bool use_fuzzy_matching = true; + /* Whether to consider fuzzy messages as translations. */ static bool include_fuzzies = false; @@ -62,6 +65,7 @@ static const struct option long_options[] = { "directory", required_argument, NULL, 'D' }, { "help", no_argument, NULL, 'h' }, { "multi-domain", no_argument, NULL, 'm' }, + { "no-fuzzy-matching", no_argument, NULL, 'N' }, { "properties-input", no_argument, NULL, 'P' }, { "stringtable-input", no_argument, NULL, CHAR_MAX + 1 }, { "use-fuzzy", no_argument, NULL, CHAR_MAX + 2 }, @@ -109,7 +113,7 @@ main (int argc, char *argv[]) do_help = false; do_version = false; - while ((optchar = getopt_long (argc, argv, "D:hmPV", long_options, NULL)) + while ((optchar = getopt_long (argc, argv, "D:hmNPV", long_options, NULL)) != EOF) switch (optchar) { @@ -128,6 +132,10 @@ main (int argc, char *argv[]) multi_domain_mode = true; break; + case 'N': + use_fuzzy_matching = false; + break; + case 'P': input_syntax = &input_format_properties; break; @@ -230,6 +238,8 @@ Operation modifiers:\n")); printf (_("\ -m, --multi-domain apply ref.pot to each of the domains in def.po\n")); printf (_("\ + -N, --no-fuzzy-matching do not use fuzzy matching\n")); + printf (_("\ --use-fuzzy consider fuzzy entries\n")); printf (_("\ --use-untranslated consider untranslated entries\n")); @@ -325,7 +335,10 @@ this message needs to be reviewed by the translator")); help. */ (*nerrors)++; defmsg = - message_list_search_fuzzy (defmlp, refmsg->msgctxt, refmsg->msgid); + (use_fuzzy_matching + ? message_list_search_fuzzy (defmlp, + refmsg->msgctxt, refmsg->msgid) + : NULL); if (defmsg) { po_gram_error_at_line (&refmsg->pos, _("\