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

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

 



Steffen Prohaska wrote:
And it's even worse. An error in the localization can completely
break git-gui. Apparently the German localization included in
msysgit's Git-1.5.3-preview20071019.exe _is_ broken (see
attached png).

Shouldn't the localization code be a bit more fault tolerant?

Thanks for this error description. However, this isn't a fault of the localization per se; rather, it's a bad side-effects of git-gui using its own script po2msg.sh instead of gettext's msgfmt to prepare translations for inclusion in the program - and additionally the fact that this po2msg.sh script is used by the creator of the setup.exe, whereas the translators use msgfmt which will not exhibit this error.

Here's what happened: The program code changed from using the string "Prune from %s" to "Prune from" (just like program code changes often). Before, the translation had a translation like this:

msgid "Prune from %s"
msgstr "Abschneiden von %s"

or similar, in any case with the including "%s". After the string changed in the program, the next update of the translation file will record the fact that the original string changed by changing the translation like this:

#, fuzzy
msgid "Prune from"
msgstr "Abschneiden von %s"

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.

In other words: The tcl msgcat procedure is the wrong end to deal with that problem. Instead, those string argument checks should be done when "compiling" the foo.po files into the foo.msg files. And that's precisely what the msgfmt program is for: It correctly ignores all "fuzzy" strings and it additionally checks the %s et al string formats for correct translation (when used with the "-c" switch, as the "shift-V" command in emacs po-mode or any other po file editor will use).

@Dscho: That's why I'm rather unhappy with the addition of the po2msg.sh script. Not adhering to the "fuzzy" marker is clearly a bug and needs to be fixed there, but additionally you lose all format checking that msgfmt gives to you. Syntax errors in the translator's foo.po file should really be dealt with at msgfmt compile time, not later at runtime. That's the whole point of that compile step.

Regards,

Christian
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux