]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
msgmerge has a new option -N/--no-fuzzy-matching.
authorBruno Haible <bruno@clisp.org>
Thu, 23 Jan 2003 12:07:39 +0000 (12:07 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:57 +0000 (12:08 +0200)
NEWS
doc/ChangeLog
doc/msgmerge.texi
src/ChangeLog
src/msgmerge.c

diff --git a/NEWS b/NEWS
index deb704548367fc2b04e378e4e2fcd4e6f2c90a7c..431685f37411a8e82f130f3f7b8d28fb7a77ab68 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ Version 0.11.6 - October 2002
   xgettext has a new option --from-code that specifies the encoding of the
   source files. The resulting POT files are UTF-8 encoded.
 
+* msgmerge has a new option -N/--no-fuzzy-matching that inhibits the fuzzy
+  search for untranslated messages.
+
 * Compatibility with automake-1.7.
 \f
 Version 0.11.5 - August 2002
index 8ae96bc8118d91145ece305d5dc309a830848d64..3b49d27967a77edeb85f52ef638c62ac97a5b9b0 100644 (file)
@@ -1,3 +1,7 @@
+2003-01-23  Bruno Haible  <bruno@clisp.org>
+
+       * msgmerge.texi: Document option -N/--no-fuzzy-matching.
+
 2003-01-22  Bruno Haible  <bruno@clisp.org>
 
        * gettext.texi (AM_GNU_GETTEXT): Don't document use-libtool, as it's
index e07365581580595efa2b9b7dac655071d26e5202..1832e85e061b66997219bff6d0ebf991db2092f9 100644 (file)
@@ -120,6 +120,12 @@ The backup suffix is @samp{~}, unless set with @code{--suffix} or the
 @opindex --multi-domain@r{, @code{msgmerge} option}
 Apply @var{ref}.pot to each of the domains in @var{def}.po.
 
+@item -N
+@itemx --no-fuzzy-matching
+@opindex -N@r{, @code{msgmerge} option}
+@opindex --no-fuzzy-matching@r{, @code{msgmerge} option}
+Do not use fuzzy matching when an exact match is not found.  This may speed
+up the operation considerably.
 @end table
 
 @subsection Output details
index 60a5dbd72967a449006b2e9378b16cf5688dd5c7..b9b2efb874b3c8375ff7f48ef7ae7666ce7842b4 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-23  Bruno Haible  <bruno@clisp.org>
+
+       * msgmerge.c (use_fuzzy_matching): New variable.
+       (long_options): Add option -N/--no-fuzzy-matching.
+       (main, match_domain): Implement it.
+       (usage): Document it.
+
 2003-01-23  Bruno Haible  <bruno@clisp.org>
 
        * write-mo.c (write_table): Use xmalloc/free instead of alloca/freea
index 95789a8ca99b5c539e3a777f5845d2a3a5c0c8ce..22dbf534c2cdb01b2c7e958ae6edf11fc846a495 100644 (file)
@@ -66,6 +66,9 @@ static int force_po;
 /* 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;
+
 /* List of user-specified compendiums.  */
 static message_list_list_ty *compendiums;
 
@@ -87,6 +90,7 @@ static const struct option long_options[] =
   { "indent", no_argument, NULL, 'i' },
   { "multi-domain", no_argument, NULL, 'm' },
   { "no-escape", no_argument, NULL, 'e' },
+  { "no-fuzzy-matching", no_argument, NULL, 'N' },
   { "no-location", no_argument, &line_comment, 0 },
   { "no-wrap", no_argument, NULL, CHAR_MAX + 4 },
   { "output-file", required_argument, NULL, 'o' },
@@ -197,6 +201,10 @@ main (int argc, char **argv)
        multi_domain_mode = true;
        break;
 
+      case 'N':
+       use_fuzzy_matching = false;
+       break;
+
       case 'o':
        output_file = optarg;
        break;
@@ -446,6 +454,7 @@ environment variable.\n\
       printf (_("\
 Operation modifiers:\n\
   -m, --multi-domain          apply ref.pot to each of the domains in def.po\n\
+  -N, --no-fuzzy-matching     do not use fuzzy matching\n\
 "));
       printf ("\n");
       /* xgettext: no-wrap */
@@ -827,8 +836,10 @@ match_domain (const char *fn1, const char *fn2,
          /* If the message was not defined at all, try to find a very
             similar message, it could be a typo, or the suggestion may
             help.  */
-         defmsg = message_list_list_search_fuzzy (definitions, refmsg->msgid);
-         if (defmsg)
+         if (use_fuzzy_matching
+             && ((defmsg =
+                    message_list_list_search_fuzzy (definitions,
+                                                    refmsg->msgid)) != NULL))
            {
              message_ty *mp;