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

KDECore

  • sources
  • kde-4.12
  • kdelibs
  • kdecore
  • localization
Classes | Macros | Functions
klocalizedstring.h File Reference
#include <kdecore_export.h>
#include <QtCore/QChar>
#include <QtCore/QLatin1Char>
#include <QtCore/QStringList>
Include dependency graph for klocalizedstring.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  I18nTypeCheck< T, s >
 
class  I18nTypeCheck< char[s], s >
 
class  KLocalizedString
 

Macros

#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

QString i18n (const char *text)
 
template<typename A1 >
QString i18n (const char *text, const A1 &a1)
 
template<typename A1 , typename A2 >
QString i18n (const char *text, const A1 &a1, const A2 &a2)
 
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 , 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 , 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 , 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 , 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 , 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 , 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)
 
QString i18nc (const char *ctxt, const char *text)
 
template<typename A1 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1)
 
template<typename A1 , typename A2 >
QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2)
 
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 , 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 , 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 , 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 , 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 , 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 , 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 >
QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1)
 
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 , 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 , 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 , 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 , 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 , 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 , 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 , 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 >
QString i18np (const char *sing, const char *plur, const A1 &a1)
 
template<typename A1 , typename A2 >
QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2)
 
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 , 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 , 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 , 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 , 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 , 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 , 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)
 
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)
 

Macro Definition Documentation

#define I18N_ERR_MSG   String_literal_as_second_argument_to_i18n___Perhaps_you_need_i18nc_or_i18np

Definition at line 615 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 618 of file klocalizedstring.h.

Function Documentation

QString i18n ( const char *  text)
inline

Returns a localized version of a string.

Parameters
textstring to be localized
Returns
localized string

Definition at line 630 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
textstring to be localized
a1first argument
Returns
localized string

Definition at line 642 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
textstring to be localized
a1first argument
a2second argument
Returns
localized string

Definition at line 656 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
textstring to be localized
a1first argument
a2second argument
a3third argument
Returns
localized string

Definition at line 671 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
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
Returns
localized string

Definition at line 687 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
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
Returns
localized string

Definition at line 704 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
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
Returns
localized string

Definition at line 722 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
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
Returns
localized string

Definition at line 741 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
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
a8eighth argument
Returns
localized string

Definition at line 761 of file klocalizedstring.h.

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
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
a8eighth argument
a9ninth argument
Returns
localized string

Definition at line 782 of file klocalizedstring.h.

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

Returns a localized version of a string and a context.

Parameters
ctxtcontext of the string
textstring to be localized
Returns
localized string

Definition at line 797 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
ctxtcontext of the string
textstring to be localized
a1first argument
Returns
localized string

Definition at line 810 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
ctxtcontext of the string
textstring to be localized
a1first argument
a2second argument
Returns
localized string

Definition at line 824 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
ctxtcontext of the string
textstring to be localized
a1first argument
a2second argument
a3third argument
Returns
localized string

Definition at line 839 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
ctxtcontext of the string
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
Returns
localized string

Definition at line 855 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
ctxtcontext of the string
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
Returns
localized string

Definition at line 872 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
ctxtcontext of the string
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
Returns
localized string

Definition at line 890 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
ctxtcontext of the string
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
Returns
localized string

Definition at line 909 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
ctxtcontext of the string
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
a8eighth argument
Returns
localized string

Definition at line 929 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
ctxtcontext of the string
textstring to be localized
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
a8eighth argument
a9ninth argument
Returns
localized string

Definition at line 950 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
Returns
localized string

Definition at line 1123 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
Returns
localized string

Definition at line 1138 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
Returns
localized string

Definition at line 1154 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
Returns
localized string

Definition at line 1171 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
Returns
localized string

Definition at line 1189 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
Returns
localized string

Definition at line 1208 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
Returns
localized string

Definition at line 1228 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
a8eighth argument
Returns
localized string

Definition at line 1249 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
ctxtcontext of the string
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
a8eighth argument
a9ninth argument
Returns
localized string

Definition at line 1271 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
Returns
localized string

Definition at line 966 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
Returns
localized string

Definition at line 980 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
Returns
localized string

Definition at line 995 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
Returns
localized string

Definition at line 1011 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
Returns
localized string

Definition at line 1028 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
Returns
localized string

Definition at line 1046 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
Returns
localized string

Definition at line 1065 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
a8eighth argument
Returns
localized string

Definition at line 1085 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
singstring to be localized in singular
plurstring to be localized in plural
a1first argument
a2second argument
a3third argument
a4fourth argument
a5fifth argument
a6sixth argument
a7seventh argument
a8eighth argument
a9ninth argument
Returns
localized string

Definition at line 1106 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
msgmessage text
Returns
created KLocalizedString

Definition at line 924 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
ctxtcontext text
msgmessage text
Returns
created KLocalizedString

Definition at line 929 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
ctxtcontext text
singularmessage text in singular
pluralmessage text in plural
Returns
created KLocalizedString

Definition at line 939 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
singularmessage text in singular
pluralmessage text in plural
Returns
created KLocalizedString

Definition at line 934 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 602 of file klocalizedstring.h.

This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal