KUnitConversion Review

Chusslove Illich caslav.ilic at gmx.net
Fri Feb 28 21:30:19 UTC 2014


> [: John Layt :]
> One thing I've noticed is that it uses KLocalizedString in public api and
> as internal storage, is this a normal way of doing things? I would have
> thought once the translation has been done that a QString should be OK for
> storage and api use?

Since KLocalizedString delays translation and argument substitution until
toString() is called on it, it can be used in APIs and in storage for
repeated translations of same text but different arguments. (Plain i18n
calls internally immediatelly execute toString().)

It seems here this is primarily used to supply the plural message for
integer unit amounts, so another mechanism would have to be used to handle
that with Qt. The other use is for floating point amounts, non-plural, so
does not need delayed translation.

-- 
Chusslove Illich (Часлав Илић)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140228/bc0642e2/attachment.sig>


More information about the Kde-frameworks-devel mailing list