Finalized proposal for changes to i18n in KF5

Chusslove Illich caslav.ilic at gmx.net
Thu Dec 27 11:45:37 GMT 2012


> Nice writeup, very complete!

On IRC Albert noted that I didn't quite cover tr2i18n use for .ui files,
which also holds for .kcfg and .rc. For these I should document how to set
the catalog and markup-awareness. For .ui this can be non-invasive (optional
arguments to CMake *_ADD_UI_FILES macro) because it is strictly compiled.
But for .kcfg and .rc I think two new optional attributes to the top tag are
needed.

> [: David Faure :]
>   #define TRANSLATION_CATALOG "foolib"
>   #include <klocalizedstring.h>
>
> [...] The #define will kill any "enable final" compilation support, but
> then again I think this is gone anyway.

I expect that every group of source files that could be treated with enable-
final, like one library, will have only one translation catalog. Then this
#define-#include construct would be put in exactly one private header, which
itself would have normal include guards, so enable-final would still work if
it worked otherwise. Or am I missing something here?

> BTW, something else I spotted:
>       KLocalizedString subs (QChar a, int fieldWidth = 0,
>                              const QChar &fillChar = QLatin1Char(' ')) const;
> See how one QChar is passed by value, and the other by const ref? QChar is
> just a ushort, so it should be passed by value everywhere, as per
> http://www.macieira.org/blog/2012/02/the-value-of-passing-by-value/

Ok :)

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


More information about the kde-core-devel mailing list