Bug 108119 - Fatal % signs in po files
Summary: Fatal % signs in po files
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kbabel
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Stanislav Visnovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-25 16:38 UTC by Hasso Tepper
Modified: 2011-06-26 14:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hasso Tepper 2005-06-25 16:38:07 UTC
Version:           1.11 (using KDE 3.4.89 (>= 20050615), compiled sources)
Compiler:          gcc version 3.3.6 (Debian 1:3.3.6-7)
OS:                Linux (i686) release 2.6.12

Syntax check doesn't really like various strings containing % signs. For example string from kdegames/kbounce.po:

msgid ""
"You have successfully cleared more than 75% of the board.\n"
msgstr ""
"TÌhjendasid edukalt rohkem kui 75% mÀngulauast.\n"

While saving file with this string kbabel claims that serious error is found - "number of format specifications in 'msgid' and 'msgstr' does not match".

Errors with strings from kdeedu/kpercentage.po is porbably also related with percentage sign although messages are different:

msgid "x% of &y = ??"
msgstr "x% &y-st = ??"

"/home/hasso/source/l10n-stable/et/messages/kdeedu/kpercentage.po:35: 'msgstr' is not a valid C format string, unlike 'msgid'. Reason: In the directive number 1, the character '&' is not a valid conversion specifier."

msgid " % of "
msgstr " % arvust "

"/home/hasso/source/l10n-stable/et/messages/kdeedu/kpercentage.po:169: format specifications in 'msgid' and 'msgstr' for argument 1 are not the same"

Strange thing is that in all these cases running "msgfmt --statistics" manually doesn't show any errors.
Comment 1 Nicolas Goutte 2005-06-28 10:11:46 UTC
It depends on your Gettext version. For older version of Gettext, such errors were indeed fatal.

As we do not which Gettext version a user might have when compiling l10n, it might be a good idea to maintain this check. (However perhaps make it optional if the project enforces certain versions of Gettext by choice.)

Have a nice day!
Comment 2 Stanislav Visnovsky 2005-07-05 09:43:05 UTC
KBabel uses stronger checks: msgfmt -v -c 

I assume the error is reported by the "Check syntax" validation.
If yes, the error is really from gettext, not from KBabel itself.
Comment 3 Nicolas Goutte 2005-11-22 09:39:55 UTC
I think that I finally have understood what this bug report is about.

Unlike what I thought, the errors probably does not come from msgfmt as I thought but the errors are from KBabel's tool checking arguments.

The problem is that KBabel tries to check the messages as being printf parameters, which for normal percent signs is rather futile.

It is kind of a similar problem than bug #116859 that I have just reported.

As for fixing it, I do not know really how. (Anyway in future, if KDE4 uses the current Gettext development version, the problem will be different, as Gettext already knows in stable version about Qt's %1, %2... placeholders, so that KBabel's argument checking tool could be changed to give more correct results.)

Have a nice day!
Comment 4 Christoph Feck 2011-06-26 14:03:48 UTC
KBabel is no longer maintained, please use the KDE 4 translator's tool called "Lokalize" instead. For more information, please visit http://userbase.kde.org/Lokalize

If this is a bug which is also present in Lokalize, please add a comment so that I can reassign the bug the the Lokalize authors.