[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some gettext bugs!

From: Steve Murphy
Subject: Some gettext bugs!
Date: Wed, 16 Mar 2005 11:00:22 -0700

I've reported the first bug before, but I'll repeat it so it's 
"in the group". The 3rd is also a bit of a repeat, but with a
suggestion for its resolution.

1. Bug in msgmerge:  no fuzzy matching if a msgstr "" is present for a
msgid-msgstr pair. The only way to get a fuzzy translation is if there
is no msgid in the PO file for a msgid in the POT file. This is
undocumented behavior. As a matter of fact, according to the usage
message, it's wrong behavior! Says the usage message: 
"... Where an exact match\n\
cannot be found, fuzzy matching is used to produce better results."

Fixed by changing test in msgmerge.c from
(around line 980)

  defmsg = message_list_list_search (definitions, refmsg->msgid);
  if (defmsg) 


  defmsg = message_list_list_search (definitions, refmsg->msgid);
  if (defmsg && defmsg->msgstr && defmsg->msgstr[0]) 

2. Bug in msginit: Unreported scripts in man pages & Usage:

The user-email, project-id, and team-address scripts are completely
unmentioned in the info manual and the man pages! When I install at 
the default locations, I see


The following enviroment/configuration variables seem to affect
the placement of these files:  LIBDIR, GETTEXTLIBDIR, PROJECTSDIR.

Someone with more usage experience might wish to write the
documentation. All I know, is that I couldn't use msginit without
modifying all 3 of these scripts. The default scripts do strange,
wonderful things, but in batch processing you can't have it ask for
your email.

I see default KDE, GNOME, etc scripts in the projects dir. All of this
really needs to be documented.

3. Documentation of msgmerge says nothing about the fuzzy algorithm
used. It would have been helpful to me to have some rough idea of the
algorithm, so as to get a feel of what to expect from it.

Even a terse paragraph like this, in the info manual and the usage
message might be very enlightening:

"Msgmerge uses a fuzzy matching algorithm, that compares the two
msgid strings (one from the ref, the other from the compendia or
"def" PO files), and computes a value equal to:

((number of chars in common) / (average length of the strings))

and, selects the highest value found from all the msgid's in the
compendia and PO files. The corresponding msgstr is then used as
the result. When the maximum match value is below some threshold, then
the matches are rejected, and the fuzzy match fails.  Needless to say,
if the compendia or "def" PO are large, and/or the msgid string to be
matched is large.  this algorithm will become computationally expensive
to perform. The -N, or --no-fuzzy-matching arguments can be used to
prevent this algorithm from being performed."

The above is NOT COPYRIGHTED. Feel free to use it if it works for you,
or make up your own verbage, if it is more understandable.

-- Thanks to Bruno Haible for his input!

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]