KI18n

klocalizedstring.h File Reference
#include <ki18n_export.h>
#include <QChar>
#include <QLatin1Char>
#include <QSet>
#include <QString>
#include <QStringList>
#include <memory>
#include <kuitmarkup.h>
#include <klocalizedcontext.h>
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  KLocalizedString
 

Macros

#define I18N_NOOP(text)   text
 
#define I18N_NOOP2(context, text)   text
 
#define I18N_NOOP2_NOSTRIP(context, text)   context, text
 
#define I18NC_NOOP(context, text)   context, text
 

Functions

QString i18n (const char *text, const TYPE &arg...)
 
QString i18nc (const char *context, const char *text, const TYPE &arg...)
 
QString i18ncp (const char *context, const char *singular, const char *plural, const TYPE &arg...)
 
QString i18nd (const char *domain, const char *text, const TYPE &arg...)
 
QString i18ndc (const char *domain, const char *context, const char *text, const TYPE &arg...)
 
QString i18ndcp (const char *domain, const char *context, const char *singular, const char *plural, const TYPE &arg...)
 
QString i18ndp (const char *domain, const char *singular, const char *plural, const TYPE &arg...)
 
QString i18np (const char *singular, const char *plural, const TYPE &arg...)
 
KLocalizedString KI18N_EXPORT ki18n (const char *text)
 
KLocalizedString KI18N_EXPORT ki18nc (const char *context, const char *text)
 
KLocalizedString KI18N_EXPORT ki18ncp (const char *context, const char *singular, const char *plural)
 
KLocalizedString KI18N_EXPORT ki18nd (const char *domain, const char *text)
 
KLocalizedString KI18N_EXPORT ki18ndc (const char *domain, const char *context, const char *text)
 
KLocalizedString KI18N_EXPORT ki18ndcp (const char *domain, const char *context, const char *singular, const char *plural)
 
KLocalizedString KI18N_EXPORT ki18ndp (const char *domain, const char *singular, const char *plural)
 
KLocalizedString KI18N_EXPORT ki18np (const char *singular, const char *plural)
 
KLocalizedString KI18N_EXPORT kxi18n (const char *text)
 
KLocalizedString KI18N_EXPORT kxi18nc (const char *context, const char *text)
 
KLocalizedString KI18N_EXPORT kxi18ncp (const char *context, const char *singular, const char *plural)
 
KLocalizedString KI18N_EXPORT kxi18nd (const char *domain, const char *text)
 
KLocalizedString KI18N_EXPORT kxi18ndc (const char *domain, const char *context, const char *text)
 
KLocalizedString KI18N_EXPORT kxi18ndcp (const char *domain, const char *context, const char *singular, const char *plural)
 
KLocalizedString KI18N_EXPORT kxi18ndp (const char *domain, const char *singular, const char *plural)
 
KLocalizedString KI18N_EXPORT kxi18np (const char *singular, const char *plural)
 
QString tr2i18n (const char *text, const char *comment=nullptr)
 
QString tr2i18nd (const char *domain, const char *text, const char *comment=nullptr)
 
QString tr2xi18n (const char *text, const char *comment=nullptr)
 
QString tr2xi18nd (const char *domain, const char *text, const char *comment=nullptr)
 
QString xi18n (const char *text, const TYPE &arg...)
 
QString xi18nc (const char *context, const char *text, const TYPE &arg...)
 
QString xi18ncp (const char *context, const char *singular, const char *plural, const TYPE &arg...)
 
QString xi18nd (const char *domain, const char *text, const TYPE &arg...)
 
QString xi18ndc (const char *domain, const char *context, const char *text, const TYPE &arg...)
 
QString xi18ndcp (const char *domain, const char *context, const char *singular, const char *plural, const TYPE &arg...)
 
QString xi18ndp (const char *domain, const char *singular, const char *plural, const TYPE &arg...)
 
QString xi18np (const char *singular, const char *plural, const TYPE &arg...)
 

Macro Definition Documentation

#define I18N_NOOP (   text)    text

Wrap string for extraction.

See i18n_noop for use cases.

Definition at line 37 of file klocalizedstring.h.

#define I18N_NOOP2 (   context,
  text 
)    text

Wrap string with context for extraction, discarding context.

WARNING: this means you'll need to pass the exact same context when calling i18nc() later on. Do not make typos... The preferred solution is to use I18NC_NOOP and store both context and text. I18NC_NOOP2 exists for cases where storing the context is not possible.

Deprecated:
between 5.0 and 5.64, re-enabled in 5.65

Definition at line 59 of file klocalizedstring.h.

#define I18N_NOOP2_NOSTRIP (   context,
  text 
)    context, text

Wrap string with context for extraction.

Deprecated:
Since 5.0, use I18NC_NOOP.

Definition at line 69 of file klocalizedstring.h.

#define I18NC_NOOP (   context,
  text 
)    context, text

Wrap string with context for extraction.

See i18n_noop for use cases.

Definition at line 46 of file klocalizedstring.h.

Function Documentation

QString i18n ( const char *  text,
const TYPE &  arg... 
)

Translate a string and substitute any arguments.

Parameters
textstring to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString i18nc ( const char *  context,
const char *  text,
const TYPE &  arg... 
)

Translate a string with context and substitute any arguments.

Parameters
contextcontext of the string
textstring to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString i18ncp ( const char *  context,
const char *  singular,
const char *  plural,
const TYPE &  arg... 
)

Translate a string with context and plural and substitute any arguments.

Parameters
contextcontext of the string
singularsingular form of the string to translate
pluralplural form of the string to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString i18nd ( const char *  domain,
const char *  text,
const TYPE &  arg... 
)

Translate a string from domain and substitute any arguments.

Parameters
domaindomain in which to look for translations
textstring to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString i18ndc ( const char *  domain,
const char *  context,
const char *  text,
const TYPE &  arg... 
)

Translate a string from domain with context and substitute any arguments.

Parameters
domaindomain in which to look for translations
contextcontext of the string
textstring to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString i18ndcp ( const char *  domain,
const char *  context,
const char *  singular,
const char *  plural,
const TYPE &  arg... 
)

Translate a string from domain with context and plural and substitute any arguments.

Parameters
domaindomain in which to look for translations
contextcontext of the string
singularsingular form of the string to translate
pluralplural form of the string to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString i18ndp ( const char *  domain,
const char *  singular,
const char *  plural,
const TYPE &  arg... 
)

Translate a string from domain with plural and substitute any arguments.

Parameters
domaindomain in which to look for translations
singularsingular form of the string to translate
pluralplural form of the string to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString i18np ( const char *  singular,
const char *  plural,
const TYPE &  arg... 
)

Translate a string with plural and substitute any arguments.

Parameters
singularsingular form of the string to translate
pluralplural form of the string to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
KLocalizedString KI18N_EXPORT ki18n ( const char *  text)

Create non-finalized translated string.

Parameters
textstring to translate
Returns
non-finalized translated string

Definition at line 1459 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT ki18nc ( const char *  context,
const char *  text 
)

Create non-finalized translated string with context.

Parameters
contextcontext of the string
textstring to translate
Returns
non-finalized translated string

Definition at line 1464 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT ki18ncp ( const char *  context,
const char *  singular,
const char *  plural 
)

Create non-finalized translated string with context and plural.

Parameters
contextcontext of the string
singularsingular form of the string to translate
pluralplural form of the string to translate
Returns
non-finalized translated string

Definition at line 1474 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT ki18nd ( const char *  domain,
const char *  text 
)

Create non-finalized translated string from domain.

Parameters
domaindomain in which to look for translations
textstring to translate
Returns
non-finalized translated string

Definition at line 1479 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT ki18ndc ( const char *  domain,
const char *  context,
const char *  text 
)

Create non-finalized translated string from domain with context.

Parameters
domaindomain in which to look for translations
contextcontext of the string
textstring to translate
Returns
non-finalized translated string

Definition at line 1484 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT ki18ndcp ( const char *  domain,
const char *  context,
const char *  singular,
const char *  plural 
)

Create non-finalized translated string from domain with context and plural.

Parameters
domaindomain in which to look for translations
contextcontext of the string
singularsingular form of the string to translate
pluralplural form of the string to translate
Returns
non-finalized translated string

Definition at line 1494 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT ki18ndp ( const char *  domain,
const char *  singular,
const char *  plural 
)

Create non-finalized translated string from domain with plural.

Parameters
domaindomain in which to look for translations
singularsingular form of the string to translate
pluralplural form of the string to translate
Returns
non-finalized translated string

Definition at line 1489 of file klocalizedstring.cpp.

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

Create non-finalized translated string with plural.

Parameters
singularsingular form of the string to translate
pluralplural form of the string to translate
Returns
non-finalized translated string

Definition at line 1469 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT kxi18n ( const char *  text)

Create non-finalized markup-aware translated string.

Parameters
textstring to translate
Returns
non-finalized translated string

Definition at line 1499 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT kxi18nc ( const char *  context,
const char *  text 
)

Create non-finalized markup-aware translated string with context.

Parameters
contextcontext of the string
textstring to translate
Returns
non-finalized translated string

Definition at line 1504 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT kxi18ncp ( const char *  context,
const char *  singular,
const char *  plural 
)

Create non-finalized markup-aware translated string.

with context and plural.

Parameters
contextcontext of the string
singularsingular form of the string to translate
pluralplural form of the string to translate
Returns
non-finalized translated string

Definition at line 1514 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT kxi18nd ( const char *  domain,
const char *  text 
)

Create non-finalized markup-aware translated string from domain.

Parameters
domaindomain in which to look for translations
textstring to translate
Returns
non-finalized translated string

Definition at line 1519 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT kxi18ndc ( const char *  domain,
const char *  context,
const char *  text 
)

Create non-finalized markup-aware translated string from domain with context.

Parameters
domaindomain in which to look for translations
contextcontext of the string
textstring to translate
Returns
non-finalized translated string

Definition at line 1524 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT kxi18ndcp ( const char *  domain,
const char *  context,
const char *  singular,
const char *  plural 
)

Create non-finalized markup-aware translated string from domain with context and plural.

Parameters
domaindomain in which to look for translations
contextcontext of the string
singularsingular form of the string to translate
pluralplural form of the string to translate
Returns
non-finalized translated string

Definition at line 1534 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT kxi18ndp ( const char *  domain,
const char *  singular,
const char *  plural 
)

Create non-finalized markup-aware translated string from domain with plural.

Parameters
domaindomain in which to look for translations
singularsingular form of the string to translate
pluralplural form of the string to translate
Returns
non-finalized translated string

Definition at line 1529 of file klocalizedstring.cpp.

KLocalizedString KI18N_EXPORT kxi18np ( const char *  singular,
const char *  plural 
)

Create non-finalized markup-aware translated string with plural.

Parameters
singularsingular form of the string to translate
pluralplural form of the string to translate
Returns
non-finalized translated string

Definition at line 1509 of file klocalizedstring.cpp.

QString tr2i18n ( const char *  text,
const char *  comment = nullptr 
)
inline

Redirect Qt's uic-generated translation calls to Ki18n.

Use -tr tr2i18n option to uic to have it redirect calls.

Parameters
textstring to translate
commentQt equivalent of disambiguation context
Returns
translated string

Definition at line 1025 of file klocalizedstring.h.

QString tr2i18nd ( const char *  domain,
const char *  text,
const char *  comment = nullptr 
)
inline

Like tr2i18n, but look for translation in a specific domain.

Use -tr tr2i18nd option to uic to have it redirect calls.

Parameters
domaindomain in which to look for translations
textstring to translate
commentQt equivalent of disambiguation context
Returns
translated string

Definition at line 1046 of file klocalizedstring.h.

QString tr2xi18n ( const char *  text,
const char *  comment = nullptr 
)
inline

Like tr2i18n, but when UI strings are KUIT markup-aware.

Use -tr tr2xi18n option to uic to have it redirect calls.

Parameters
textmarkup-aware string to translate
commentQt equivalent of disambiguation context
Returns
translated string

Definition at line 1066 of file klocalizedstring.h.

QString tr2xi18nd ( const char *  domain,
const char *  text,
const char *  comment = nullptr 
)
inline

Like tr2xi18n, but look for translation in a specific domain.

Use -tr tr2xi18nd option to uic to have it redirect calls.

Parameters
domaindomain in which to look for translations
textmarkup-aware string to translate
commentQt equivalent of disambiguation context
Returns
translated string

Definition at line 1087 of file klocalizedstring.h.

QString xi18n ( const char *  text,
const TYPE &  arg... 
)

Translate a markup-aware string and substitute any arguments.

Parameters
textstring to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString xi18nc ( const char *  context,
const char *  text,
const TYPE &  arg... 
)

Translate a markup-aware string with context and substitute any arguments.

Parameters
contextcontext of the string
textstring to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString xi18ncp ( const char *  context,
const char *  singular,
const char *  plural,
const TYPE &  arg... 
)

Translate a markup-aware string with context and plural and substitute any arguments.

Parameters
contextcontext of the string
singularsingular form of the string to translate
pluralplural form of the string to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString xi18nd ( const char *  domain,
const char *  text,
const TYPE &  arg... 
)

Translate a markup-aware string from domain and substitute any arguments.

Parameters
domaindomain in which to look for translations
textstring to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString xi18ndc ( const char *  domain,
const char *  context,
const char *  text,
const TYPE &  arg... 
)

Translate a markup-aware string from domain with context and substitute any arguments.

Parameters
domaindomain in which to look for translations
contextcontext of the string
textstring to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString xi18ndcp ( const char *  domain,
const char *  context,
const char *  singular,
const char *  plural,
const TYPE &  arg... 
)

Translate a markup-aware string from domain with context and plural and substitute any arguments.

Parameters
domaindomain in which to look for translations
contextcontext of the string
singularsingular form of the string to translate
pluralplural form of the string to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString xi18ndp ( const char *  domain,
const char *  singular,
const char *  plural,
const TYPE &  arg... 
)

Translate a markup-aware string from domain with plural and substitute any arguments.

Parameters
domaindomain in which to look for translations
singularsingular form of the string to translate
pluralplural form of the string to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
QString xi18np ( const char *  singular,
const char *  plural,
const TYPE &  arg... 
)

Translate a markup-aware string with plural and substitute any arguments.

Parameters
singularsingular form of the string to translate
pluralplural form of the string to translate
argarguments to insert (0 to 9), admissible types according to KLocalizedString::subs methods
Returns
translated string
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Aug 2 2021 22:43:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.