Registered Member
|
Hi,
I was looking for a documentation for the ki18n function. I thought it belongs to KLocale, but I cannot find it there. I wonder when and how to use ki18n and when tr. Don't they do the same?
doesn't work, but
does. The first gives a compile error
Some include missing? KLocale is included, anything else I have to obey? What do I have to do to use it and when shall I use it compared to tr? Thanks. |
Administrator
|
ki18n() is for use before you have instantiated KApplication. It delays the translation until KApplication has been constructed.
You should not be using tr() in normal KDE applications, but i18n() instead.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
KDE Developer
|
The most useful variant is i18nc() because it allows to specify a translation context.
This context will be visible to the translators and help them to distinguish between ambiguous terms, e.g. whether "title" refers to a position or academic title of a person or the title of a book. KDE's developer wiki techbase.kde.org has a couple of tutorials and information pages on the topic of internationalization http://techbase.kde.org/Development/Tut ... calization Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]