{"thread":{"id":"10525","subject":"Re: broken strings in localization (was: How to run git-gui always in English?)","startedAt":"2007-10-30T10:16:26Z","lastAt":"2007-10-30T12:59:13Z","messageCount":3,"participants":["Christian Stimming","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"57557","messageId":"20071030111626.0mbeh417tw4wos0s@webmail.tu-harburg.de","threadId":"10525","inReplyTo":null,"subject":"Re: broken strings in localization (was: How to run git-gui always in English?)","fromName":"Christian Stimming","fromEmail":"stimming@tuhh.de","sentAt":"2007-10-30T10:16:26Z","receivedAt":"2007-10-30T10:16:26Z","isPatch":false,"sender":{"key":"stimming@tuhh.de","avatar":"https://avatars.githubusercontent.com/u/227778?v=4"},"body":"Steffen Prohaska wrote:\n> And it's even worse. An error in the localization can completely\n> break git-gui. Apparently the German localization included in\n> msysgit's Git-1.5.3-preview20071019.exe _is_ broken (see\n> attached png).\n>\n> Shouldn't the localization code be a bit more fault tolerant?\n\nThanks for this error description. However, this isn't a fault of the  \nlocalization per se; rather, it's a bad side-effects of git-gui using  \nits own script po2msg.sh instead of gettext's msgfmt to prepare  \ntranslations for inclusion in the program - and additionally the fact  \nthat this po2msg.sh script is used by the creator of the setup.exe,  \nwhereas the translators use msgfmt which will not exhibit this error.\n\nHere's what happened: The program code changed from using the string  \n\"Prune from %s\" to \"Prune from\" (just like program code changes  \noften). Before, the translation had a translation like this:\n\nmsgid \"Prune from %s\"\nmsgstr \"Abschneiden von %s\"\n\nor similar, in any case with the including \"%s\". After the string  \nchanged in the program, the next update of the translation file will  \nrecord the fact that the original string changed by changing the  \ntranslation like this:\n\n#, fuzzy\nmsgid \"Prune from\"\nmsgstr \"Abschneiden von %s\"\n\nNote that the msgstr-translation has not been changed yet - this can  \nonly be done by a human. For that reason, the update inserted the  \n\"fuzzy\" marker. Here's where the error came in: All strings marked as  \n\"fuzzy\" MUST NOT BE USED by msgfmt! And git-gui's script po2msg.sh  \ndoesn't adhere to this rule. Boo, that's why such erroneous  \ntranslations made it into the msgcat catalog.\n\nIn other words: The tcl msgcat procedure is the wrong end to deal with  \nthat problem. Instead, those string argument checks should be done  \nwhen \"compiling\" the foo.po files into the foo.msg files. And that's  \nprecisely what the msgfmt program is for: It correctly ignores all  \n\"fuzzy\" strings and it additionally checks the %s et al string formats  \nfor correct translation (when used with the \"-c\" switch, as the  \n\"shift-V\" command in emacs po-mode or any other po file editor will  \nuse).\n\n@Dscho: That's why I'm rather unhappy with the addition of the  \npo2msg.sh script. Not adhering to the \"fuzzy\" marker is clearly a bug  \nand needs to be fixed there, but additionally you lose all format  \nchecking that msgfmt gives to you. Syntax errors in the translator's  \nfoo.po file should really be dealt with at msgfmt compile time, not  \nlater at runtime. That's the whole point of that compile step.\n\nRegards,\n\nChristian\n"},{"id":"57560","messageId":"Pine.LNX.4.64.0710301040490.4362@racer.site","threadId":"10525","inReplyTo":"20071030111626.0mbeh417tw4wos0s@webmail.tu-harburg.de","subject":"Re: broken strings in localization (was: How to run git-gui always in English?)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-30T10:45:57Z","receivedAt":"2007-10-30T10:45:57Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 30 Oct 2007, Christian Stimming wrote:\n\n> Note that the msgstr-translation has not been changed yet - this can \n> only be done by a human. For that reason, the update inserted the \n> \"fuzzy\" marker. Here's where the error came in: All strings marked as \n> \"fuzzy\" MUST NOT BE USED by msgfmt! And git-gui's script po2msg.sh \n> doesn't adhere to this rule. Boo, that's why such erroneous translations \n> made it into the msgcat catalog.\n\nMy bad.  I thought I handled that, but obviously I did not.  Will fix.\n\nCiao,\nDscho\n"},{"id":"57570","messageId":"20071030135913.h0c6jdn2xw8w0ccs@webmail.tu-harburg.de","threadId":"10525","inReplyTo":"Pine.LNX.4.64.0710301040490.4362@racer.site","subject":"Re: broken strings in localization (was: How to run git-gui always in English?)","fromName":"Christian Stimming","fromEmail":"stimming@tuhh.de","sentAt":"2007-10-30T12:59:13Z","receivedAt":"2007-10-30T12:59:13Z","isPatch":false,"sender":{"key":"stimming@tuhh.de","avatar":"https://avatars.githubusercontent.com/u/227778?v=4"},"body":"Quoting Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n>> Note that the msgstr-translation has not been changed yet - this can\n>> only be done by a human. For that reason, the update inserted the\n>> \"fuzzy\" marker. Here's where the error came in: All strings marked as\n>> \"fuzzy\" MUST NOT BE USED by msgfmt! And git-gui's script po2msg.sh\n>> doesn't adhere to this rule. Boo, that's why such erroneous translations\n>> made it into the msgcat catalog.\n>\n> My bad.  I thought I handled that, but obviously I did not.  Will fix.\n\nPatch looks good.\n\nNote that \"msgfmt\" with the \"-c\" option still does more checking and  \nshould probably be enabled by default. Currently I can use the \"-c\"  \noption by running make MSGFMT=\"msgfmt -c\". We can just call msgfmt  \nalways with the option -c (it was added in gettext-0.10.35 in 1998) so  \nthat Shawn or everyone else gets immediate notice if there is a format  \nstring problem in the file.\n\n@nanako3: In particular, with the current git-gui.git master msgfmt  \nwill complain about an error in ja.po, which is a rather tricky one.  \n(All the rest is fine.) The fix looks as follows (ignoring the  \nnon-european characters):\n\ndiff --git a/po/ja.po b/po/ja.po\nindex f65e460..2713c9e 100644\n--- a/po/ja.po\n+++ b/po/ja.po\n@@ -1781,3 +1781,3 @@ msgstr \"??????????:\"\n  msgid \"%s ... %*i of %*i %s (%3i%%)\"\n-msgstr \"%1$s ... %3$*i %4$s ?? %$2*i (%5$3i%%)\"\n+msgstr \"%1$s ... %4$*i %6$s ?? %2$*i (%7$3i%%)\"\n\nTwo errors: The easy one #1 is the confused '$' and '2' - the format  \nstring in the middle should start with '%2$'. The difficult one #2 is  \nthat one has to know that a format specification with a '*' (asterisk)  \nsuddenly refers to *two* arguments instead of one, hence the suceeding  \nargument number is two higher instead of one. This way, the argument  \nnumbers count up to 7.\n\nRegards,\n\nChristian\n"}]}