summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-01-23 12:07:39 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:08:57 +0200
commit1c7d709586d692cc6167b637744425c0568d0626 (patch)
tree81f3eb5ec322f2f035123d73fc066e6dc48572e5
parent6b9fdda824d8a14707b8353a0dbea97f73623a50 (diff)
downloadexternal_gettext-1c7d709586d692cc6167b637744425c0568d0626.zip
external_gettext-1c7d709586d692cc6167b637744425c0568d0626.tar.gz
external_gettext-1c7d709586d692cc6167b637744425c0568d0626.tar.bz2
msgmerge has a new option -N/--no-fuzzy-matching.
-rw-r--r--NEWS3
-rw-r--r--doc/ChangeLog4
-rw-r--r--doc/msgmerge.texi6
-rw-r--r--src/ChangeLog7
-rw-r--r--src/msgmerge.c15
5 files changed, 33 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index deb7045..431685f 100644
--- 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.
Version 0.11.5 - August 2002
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 8ae96bc..3b49d27 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -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
diff --git a/doc/msgmerge.texi b/doc/msgmerge.texi
index e073655..1832e85 100644
--- a/doc/msgmerge.texi
+++ b/doc/msgmerge.texi
@@ -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
diff --git a/src/ChangeLog b/src/ChangeLog
index 60a5dbd..b9b2efb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
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
for most allocations. Needed for platforms with a small stack, such
as Woe32 with a default stack size of 1.2 MB.
diff --git a/src/msgmerge.c b/src/msgmerge.c
index 95789a8..22dbf53 100644
--- a/src/msgmerge.c
+++ b/src/msgmerge.c
@@ -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;