git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: broken strings in localization (was: How to run git-gui always in English?)

From
Christian Stimming <stimming@tuhh.de>
Date
Oct 30, 2007, 12:59 UTC
Message-ID
<20071030135913.h0c6jdn2xw8w0ccs@webmail.tu-harburg.de>
In-Reply-To
<Pine.LNX.4.64.0710301040490.4362@racer.site>
Quoting Johannes Schindelin <Johannes.Schindelin@gmx.de>:
Show 8 quoted lines
>> Note that the msgstr-translation has not been changed yet - this can
>> only be done by a human. For that reason, the update inserted the
>> "fuzzy" marker. Here's where the error came in: All strings marked as
>> "fuzzy" MUST NOT BE USED by msgfmt! And git-gui's script po2msg.sh
>> doesn't adhere to this rule. Boo, that's why such erroneous translations
>> made it into the msgcat catalog.
>
> My bad.  I thought I handled that, but obviously I did not.  Will fix.
Patch looks good.

Note that "msgfmt" with the "-c" option still does more checking and should probably be enabled by default. Currently I can use the "-c" option by running make MSGFMT="msgfmt -c". We can just call msgfmt always with the option -c (it was added in gettext-0.10.35 in 1998) so that Shawn or everyone else gets immediate notice if there is a format string problem in the file.

@nanako3: In particular, with the current git-gui.git master msgfmt will complain about an error in ja.po, which is a rather tricky one. (All the rest is fine.) The fix looks as follows (ignoring the non-european characters):

diff --git a/po/ja.po b/po/ja.po
index f65e460..2713c9e 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -1781,3 +1781,3 @@ msgstr "??????????:"
  msgid "%s ... %*i of %*i %s (%3i%%)"
-msgstr "%1$s ... %3$*i %4$s ?? %$2*i (%5$3i%%)"
+msgstr "%1$s ... %4$*i %6$s ?? %2$*i (%7$3i%%)"

Two errors: The easy one #1 is the confused '$' and '2' - the format  
string in the middle should start with '%2$'. The difficult one #2 is  
that one has to know that a format specification with a '*' (asterisk)  
suddenly refers to *two* arguments instead of one, hence the suceeding  
argument number is two higher instead of one. This way, the argument  
numbers count up to 7.

Regards,

Christian
Previous: Johannes Schindelin
Message 3 of 3 in “Re: broken strings in localization (was: How to run git-gui always in English?)”
  1. Christian StimmingOct 30, 2007
  2. Johannes SchindelinOct 30, 2007
  3. Christian StimmingOct 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.