• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

klocalizedstring.h File Reference

#include <kdecore_export.h>
#include <QtCore/QChar>
#include <QtCore/QLatin1Char>
#include <QtCore/QStringList>

Go to the source code of this file.

Classes

class  I18nTypeCheck< T, s >
class  I18nTypeCheck< char[s], s >
class  KLocalizedString
 Class for producing and handling localized messages. More...

Defines

#define I18N_ERR_MSG   String_literal_as_second_argument_to_i18n___Perhaps_you_need_i18nc_or_i18np
#define I18N_NOOP(x)   x
#define I18N_NOOP2(comment, x)   x
#define I18N_NOOP2_NOSTRIP(ctxt, text)   ctxt, text
#define STATIC_ASSERT_NOT_LITERAL_STRING(T)   I18nTypeCheck<T, sizeof(T)>::I18N_ERR_MSG ();

Functions

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
template<typename A1 , typename A2 , typename A3 , typename A4 >
QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
template<typename A1 , typename A2 , typename A3 >
QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
template<typename A1 , typename A2 >
QString i18n (const char *text, const A1 &a1, const A2 &a2)
template<typename A1 >
QString i18n (const char *text, const A1 &a1)
QString i18n (const char *text)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
template<typename A1 , typename A2 , typename A3 , typename A4 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
template<typename A1 , typename A2 , typename A3 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
template<typename A1 , typename A2 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2)
template<typename A1 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1)
QString i18nc (const char *ctxt, const char *text)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
template<typename A1 , typename A2 , typename A3 , typename A4 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
template<typename A1 , typename A2 , typename A3 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3)
template<typename A1 , typename A2 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2)
template<typename A1 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
template<typename A1 , typename A2 , typename A3 , typename A4 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
template<typename A1 , typename A2 , typename A3 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3)
template<typename A1 , typename A2 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2)
template<typename A1 >
QString i18np (const char *sing, const char *plur, const A1 &a1)
KLocalizedString ki18n (const char *msg)
KLocalizedString ki18nc (const char *ctxt, const char *msg)
KLocalizedString ki18ncp (const char *ctxt, const char *singular, const char *plural)
KLocalizedString ki18np (const char *singular, const char *plural)
QString tr2i18n (const char *message, const char *comment=0)

Detailed Description

Definition in file klocalizedstring.h.


Define Documentation

#define I18N_ERR_MSG   String_literal_as_second_argument_to_i18n___Perhaps_you_need_i18nc_or_i18np

Definition at line 583 of file klocalizedstring.h.

#define I18N_NOOP ( x   )     x

I18N_NOOP marks a string to be translated without translating it.

Do not use this unless you know you need it. http://developer.kde.org/documentation/other/developer-faq.html#q2.11.2

Example usage where say_something() returns either "hello" or "goodbye":

   (void) I18N_NOOP("hello");
   (void) I18N_NOOP("goodbye");
   ...
   mystring = i18n(say_something());

Definition at line 51 of file klocalizedstring.h.

#define I18N_NOOP2 ( comment,
x   )     x

If the string is too ambiguous to be translated well to a non-english language, use this instead of I18N_NOOP to separate lookup string and english.

Example usage where say_something() returns either "hello" or "goodbye":

   (void) I18N_NOOP2("greeting", "hello");
   (void) I18N_NOOP2("greeting", "goodbye");
   ...
   mystring = i18nc("greeting", say_something());
Warning:
You need to call i18nc(context, stringVar) later on, not just i18n(stringVar).
See also:
I18N_NOOP2_NOSTRIP

Definition at line 72 of file klocalizedstring.h.

#define I18N_NOOP2_NOSTRIP ( ctxt,
text   )     ctxt, text
Since:
4.3

Similar to I18N_NOOP2, except that neither of the two arguments is omitted. This is typically used when contexts need to differ between static entries, and only some of the entries need context:

   struct MyTextLabels
   {
     int labelId;
     const char *context;
     const char *text;
   };
   const MyTextLabels labels[] = {
     { 10, I18N_NOOP2_NOSTRIP("new game", "New") },
     { 20, 0, I18N_NOOP("End Turn") },
     { 30, I18N_NOOP2_NOSTRIP("default move", "Default") },
     { 40, 0, I18N_NOOP("Quit") },
     ...
   };
   ...
   QString itemLabel = i18nc(labels[item].context, labels[item].text);

Note that i18nc() will not have any problems with context being null, it will simply behave as ordinary i18n().

Definition at line 102 of file klocalizedstring.h.

#define STATIC_ASSERT_NOT_LITERAL_STRING ( T   )     I18nTypeCheck<T, sizeof(T)>::I18N_ERR_MSG ();

Definition at line 586 of file klocalizedstring.h.


Function Documentation

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
QString i18n ( const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9 
) [inline]

Returns a localized version of a string with 9 arguments.

Parameters:
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
a8 eighth argument
a9 ninth argument
Returns:
localized string

Definition at line 750 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
QString i18n ( const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8 
) [inline]

Returns a localized version of a string with 8 arguments.

Parameters:
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
a8 eighth argument
Returns:
localized string

Definition at line 729 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
QString i18n ( const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7 
) [inline]

Returns a localized version of a string with 7 arguments.

Parameters:
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
Returns:
localized string

Definition at line 709 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
QString i18n ( const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6 
) [inline]

Returns a localized version of a string with 6 arguments.

Parameters:
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
Returns:
localized string

Definition at line 690 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
QString i18n ( const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5 
) [inline]

Returns a localized version of a string with 5 arguments.

Parameters:
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
Returns:
localized string

Definition at line 672 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 >
QString i18n ( const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4 
) [inline]

Returns a localized version of a string with 4 arguments.

Parameters:
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
Returns:
localized string

Definition at line 655 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 >
QString i18n ( const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3 
) [inline]

Returns a localized version of a string with 3 arguments.

Parameters:
text string to be localized
a1 first argument
a2 second argument
a3 third argument
Returns:
localized string

Definition at line 639 of file klocalizedstring.h.

template<typename A1 , typename A2 >
QString i18n ( const char *  text,
const A1 &  a1,
const A2 &  a2 
) [inline]

Returns a localized version of a string with 2 arguments.

Parameters:
text string to be localized
a1 first argument
a2 second argument
Returns:
localized string

Definition at line 624 of file klocalizedstring.h.

template<typename A1 >
QString i18n ( const char *  text,
const A1 &  a1 
) [inline]

Returns a localized version of a string with 1 argument.

Parameters:
text string to be localized
a1 first argument
Returns:
localized string

Definition at line 610 of file klocalizedstring.h.

QString i18n ( const char *  text  )  [inline]

Returns a localized version of a string.

Parameters:
text string to be localized
Returns:
localized string

Definition at line 598 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9 
) [inline]

Returns a localized version of a string with 9 arguments and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
a8 eighth argument
a9 ninth argument
Returns:
localized string

Definition at line 918 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8 
) [inline]

Returns a localized version of a string with 8 arguments and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
a8 eighth argument
Returns:
localized string

Definition at line 897 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7 
) [inline]

Returns a localized version of a string with 7 arguments and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
Returns:
localized string

Definition at line 877 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6 
) [inline]

Returns a localized version of a string with 6 arguments and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
Returns:
localized string

Definition at line 858 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5 
) [inline]

Returns a localized version of a string with 5 arguments and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
Returns:
localized string

Definition at line 840 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4 
) [inline]

Returns a localized version of a string with 4 arguments and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
Returns:
localized string

Definition at line 823 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3 
) [inline]

Returns a localized version of a string with 3 arguments and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
a2 second argument
a3 third argument
Returns:
localized string

Definition at line 807 of file klocalizedstring.h.

template<typename A1 , typename A2 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1,
const A2 &  a2 
) [inline]

Returns a localized version of a string with 2 arguments and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
a2 second argument
Returns:
localized string

Definition at line 792 of file klocalizedstring.h.

template<typename A1 >
QString i18nc ( const char *  ctxt,
const char *  text,
const A1 &  a1 
) [inline]

Returns a localized version of a string with 1 argument and a context.

Parameters:
ctxt context of the string
text string to be localized
a1 first argument
Returns:
localized string

Definition at line 778 of file klocalizedstring.h.

QString i18nc ( const char *  ctxt,
const char *  text 
) [inline]

Returns a localized version of a string and a context.

Parameters:
ctxt context of the string
text string to be localized
Returns:
localized string

Definition at line 765 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9 
) [inline]

Returns a localized version of a string with 9 arguments and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
a8 eighth argument
a9 ninth argument
Returns:
localized string

Definition at line 1239 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8 
) [inline]

Returns a localized version of a string with 8 arguments and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
a8 eighth argument
Returns:
localized string

Definition at line 1217 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7 
) [inline]

Returns a localized version of a string with 7 arguments and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
Returns:
localized string

Definition at line 1196 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6 
) [inline]

Returns a localized version of a string with 6 arguments and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
Returns:
localized string

Definition at line 1176 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5 
) [inline]

Returns a localized version of a string with 5 arguments and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
Returns:
localized string

Definition at line 1157 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4 
) [inline]

Returns a localized version of a string with 4 arguments and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
Returns:
localized string

Definition at line 1139 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3 
) [inline]

Returns a localized version of a string with 3 arguments and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
Returns:
localized string

Definition at line 1122 of file klocalizedstring.h.

template<typename A1 , typename A2 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2 
) [inline]

Returns a localized version of a string with 2 arguments and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
Returns:
localized string

Definition at line 1106 of file klocalizedstring.h.

template<typename A1 >
QString i18ncp ( const char *  ctxt,
const char *  sing,
const char *  plur,
const A1 &  a1 
) [inline]

Returns a localized version of a string with 1 argument and a context using correct plural form.

Parameters:
ctxt context of the string
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
Returns:
localized string

Definition at line 1091 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9 
) [inline]

Returns a localized version of a string with 9 arguments using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
a8 eighth argument
a9 ninth argument
Returns:
localized string

Definition at line 1074 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8 
) [inline]

Returns a localized version of a string with 8 arguments using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
a8 eighth argument
Returns:
localized string

Definition at line 1053 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7 
) [inline]

Returns a localized version of a string with 7 arguments using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
a7 seventh argument
Returns:
localized string

Definition at line 1033 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6 
) [inline]

Returns a localized version of a string with 6 arguments using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
a6 sixth argument
Returns:
localized string

Definition at line 1014 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5 
) [inline]

Returns a localized version of a string with 5 arguments using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
a5 fifth argument
Returns:
localized string

Definition at line 996 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 , typename A4 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4 
) [inline]

Returns a localized version of a string with 4 arguments using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
a4 fourth argument
Returns:
localized string

Definition at line 979 of file klocalizedstring.h.

template<typename A1 , typename A2 , typename A3 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2,
const A3 &  a3 
) [inline]

Returns a localized version of a string with 3 arguments using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
a3 third argument
Returns:
localized string

Definition at line 963 of file klocalizedstring.h.

template<typename A1 , typename A2 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1,
const A2 &  a2 
) [inline]

Returns a localized version of a string with 2 arguments using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
a2 second argument
Returns:
localized string

Definition at line 948 of file klocalizedstring.h.

template<typename A1 >
QString i18np ( const char *  sing,
const char *  plur,
const A1 &  a1 
) [inline]

Returns a localized version of a string with 1 argument using correct plural form.

Parameters:
sing string to be localized in singular
plur string to be localized in plural
a1 first argument
Returns:
localized string

Definition at line 934 of file klocalizedstring.h.

KLocalizedString ki18n ( const char *  msg  ) 

Creates localized string from a given message.

Normaly you should use i18n() templates instead, as you need real KLocalizedString object only in special cases. All text arguments must be UTF-8 encoded and must not be empty or NULL.

Parameters:
msg message text
Returns:
created KLocalizedString

Definition at line 916 of file klocalizedstring.cpp.

KLocalizedString ki18nc ( const char *  ctxt,
const char *  msg 
)

Creates localized string from a given message, with added context.

Context is only for disambiguation purposes (both for lookup and for translators), it is not part of the message. Normaly you should use i18nc() templates instead, as you need real KLocalizedString object only in special cases. All text arguments must be UTF-8 encoded and must not be empty or NULL.

Parameters:
ctxt context text
msg message text
Returns:
created KLocalizedString

Definition at line 921 of file klocalizedstring.cpp.

KLocalizedString ki18ncp ( const char *  ctxt,
const char *  singular,
const char *  plural 
)

Creates localized string from a given plural and singular form, with added context.

Context is only for disambiguation purposes (both for lookup and for translators), it is not part of the message. Normaly you should use i18ncp() templates instead, as you need real KLocalizedString object only in special cases. All text arguments must be UTF-8 encoded and must not be empty or NULL.

Parameters:
ctxt context text
singular message text in singular
plural message text in plural
Returns:
created KLocalizedString

Definition at line 931 of file klocalizedstring.cpp.

KLocalizedString ki18np ( const char *  singular,
const char *  plural 
)

Creates localized string from a given plural and singular form.

Normaly you should use i18np() templates instead, as you need real KLocalizedString object only in special cases. All text arguments must be UTF-8 encoded and must not be empty or NULL.

Parameters:
singular message text in singular
plural message text in plural
Returns:
created KLocalizedString

Definition at line 926 of file klocalizedstring.cpp.

QString tr2i18n ( const char *  message,
const char *  comment = 0 
) [inline]

Qt's uic generated translation calls go through numerous indirections unnecessary in our case.

So we use uic -tr tr2i18n to redirect them to our i18n API.

Definition at line 570 of file klocalizedstring.h.

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal