[Kalzium] KDE/kdeedu/kalzium/src

Carsten Niehaus cniehaus at gmx.de
Thu Jul 21 19:01:58 CEST 2005


On Thursday, 21. July 2005 06:48 pm, Eloy Cuadra wrote:
> Yes, it works. But, is it safe? Is it possible to put a variable as the
> first argument in a i18n() function?

Hehe, I know what you mean. But yes, that is the way to do it. The problem is 
that we are loading from xml. The xml-code is parsed with a "nice" sed-script 
(see Makefile.am) to a temporary .cpp-file. This is parsed with xgettext so 
that the stuff is found in the .pot und .po-files.
Now, on runtime, the i18n() compares the content of the variable with the 
internal strings (those available for translation). Only if a match is found 
it will substitute with the translated string even though there is no fix 
string (only the variable).
Strange but works :) KDE's blackmagic.

Carsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kalzium/attachments/20050721/66490153/attachment.pgp


More information about the Kalzium mailing list