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

KDECore

Public Member Functions | Static Public Member Functions | Friends
KCatalog Class Reference

#include <kcatalog_p.h>

List of all members.

Public Member Functions

 KCatalog (const QString &name, const QString &language)
 KCatalog (const KCatalog &rhs)
virtual ~KCatalog ()
QString language () const
QString localeDir () const
QString name () const
KCatalog & operator= (const KCatalog &rhs)
QString translate (const char *msgid) const
QString translate (const char *msgctxt, const char *msgid) const
QString translate (const char *msgid, const char *msgid_plural, unsigned long n) const
QString translate (const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long n) const
QString translateStrict (const char *msgid) const
QString translateStrict (const char *msgctxt, const char *msgid) const
QString translateStrict (const char *msgid, const char *msgid_plural, unsigned long n) const
QString translateStrict (const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long n) const

Static Public Member Functions

static QString catalogLocaleDir (const QString &name, const QString &language)

Friends

QDebug operator<< (QDebug debug, const KCatalog &c)

Detailed Description

This class abstracts a gettext message catalog.

It will take care of needed gettext bindings.

See also:
KLocale

Definition at line 35 of file kcatalog_p.h.


Constructor & Destructor Documentation

KCatalog::KCatalog ( const QString &  name,
const QString &  language 
)

Constructor.

Parameters:
nameThe name of the catalog
languageThe language of this catalog

Definition at line 100 of file kcatalog.cpp.

KCatalog::KCatalog ( const KCatalog &  rhs)

Copy constructor.

Definition at line 131 of file kcatalog.cpp.

KCatalog::~KCatalog ( )
virtual

Destructor.

Definition at line 144 of file kcatalog.cpp.


Member Function Documentation

QString KCatalog::catalogLocaleDir ( const QString &  name,
const QString &  language 
)
static

Finds the locale directory for the given catalog in given language.

Parameters:
nameThe name of the catalog
languageThe language of this catalog
Returns:
The locale directory if found, QString() otherwise.

Definition at line 149 of file kcatalog.cpp.

QString KCatalog::language ( ) const

Returns the language of the catalog.

Returns:
The language of the catalog

Definition at line 162 of file kcatalog.cpp.

QString KCatalog::localeDir ( ) const

Returns locale directory of the catalog.

Returns:
The locale directory of the catalog.

Definition at line 167 of file kcatalog.cpp.

QString KCatalog::name ( ) const

Returns the name of the catalog.

Returns:
The name of the catalog

Definition at line 157 of file kcatalog.cpp.

KCatalog & KCatalog::operator= ( const KCatalog &  rhs)

Assignment operator.

Definition at line 137 of file kcatalog.cpp.

QString KCatalog::translate ( const char *  msgid) const

Retrieves a translation of the specified message id.

Do not pass 0 or "" strings as message id.

Parameters:
msgidThe message id
Returns:
The translated message, or msgid if not found

Definition at line 212 of file kcatalog.cpp.

QString KCatalog::translate ( const char *  msgctxt,
const char *  msgid 
) const

Retrieves a translation of the specified message id with given context.

Do not pass 0 or "" strings as message id or context.

Parameters:
msgctxtThe context
msgidThe message id
Returns:
The translated message, or msgid if not found

Definition at line 221 of file kcatalog.cpp.

QString KCatalog::translate ( const char *  msgid,
const char *  msgid_plural,
unsigned long  n 
) const

Retrieves a proper plural form of translation for the specified English singular and plural message ids.

Do not pass 0 or "" strings as message ids.

Parameters:
msgidThe singular message id
msgid_pluralThe plural message id
nThe number to which the plural form applies
Returns:
The translated message, or proper English form if not found

Definition at line 230 of file kcatalog.cpp.

QString KCatalog::translate ( const char *  msgctxt,
const char *  msgid,
const char *  msgid_plural,
unsigned long  n 
) const

Retrieves a proper plural form of translation for the specified English singular and plural message ids, with given context.

Do not pass 0 or "" strings as message ids or context.

Parameters:
msgctxtThe context
msgidThe singular message id
msgid_pluralThe plural message id
nThe number to which the plural form applies
Returns:
The translated message, or proper English form if not found

Definition at line 240 of file kcatalog.cpp.

QString KCatalog::translateStrict ( const char *  msgid) const

Retrieves a translation of the specified message id, returning empty if the translation was not found.

Do not pass 0 or "" strings as message id.

Parameters:
msgidThe message id
Returns:
The translated message, or QString() if not found

Definition at line 250 of file kcatalog.cpp.

QString KCatalog::translateStrict ( const char *  msgctxt,
const char *  msgid 
) const

Retrieves a translation of the specified message id with given context, returning empty if the translation was not found.

Do not pass 0 or "" strings as message id or context.

Parameters:
msgctxtThe context
msgidThe message id
Returns:
The translated message, or QString() if not found

Definition at line 259 of file kcatalog.cpp.

QString KCatalog::translateStrict ( const char *  msgid,
const char *  msgid_plural,
unsigned long  n 
) const

Retrieves a proper plural form of translation for the specified English singular and plural message ids, returning empty if the translation was not found.

Do not pass 0 or "" strings as message ids.

Parameters:
msgidThe singular message id
msgid_pluralThe plural message id
nThe number to which the plural form applies
Returns:
The translated message, or QString() if not found

Definition at line 268 of file kcatalog.cpp.

QString KCatalog::translateStrict ( const char *  msgctxt,
const char *  msgid,
const char *  msgid_plural,
unsigned long  n 
) const

Retrieves a proper plural form of translation for the specified English singular and plural message ids, with given context, returning empty if the translation was not found.

Do not pass 0 or "" strings as message ids or context.

Parameters:
msgctxtThe context
msgidThe singular message id
msgid_pluralThe plural message id
nThe number to which the plural form applies
Returns:
The translated message, or QString() if not found

Definition at line 278 of file kcatalog.cpp.


Friends And Related Function Documentation

QDebug operator<< ( QDebug  debug,
const KCatalog &  c 
)
friend

Definition at line 93 of file kcatalog.cpp.


The documentation for this class was generated from the following files:
  • kcatalog_p.h
  • kcatalog.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 11:43:35 by doxygen 1.8.1.1 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-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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