Grantlee  5.1.0
Public Member Functions | List of all members
Grantlee::AbstractLocalizer Class Referenceabstract

Interface for implementing an internationalization system. More...

#include <abstractlocalizer.h>

Inheritance diagram for Grantlee::AbstractLocalizer:
Inheritance graph
[legend]

Public Member Functions

 AbstractLocalizer ()
 
virtual ~AbstractLocalizer ()
 
virtual QString currentLocale () const =0
 
virtual void loadCatalog (const QString &path, const QString &catalog)=0
 
virtual QString localize (const QVariant &variant) const
 
virtual QString localizeContextString (const QString &string, const QString &context, const QVariantList &arguments=QVariantList()) const =0
 
virtual QString localizeDate (const QDate &date, QLocale::FormatType formatType=QLocale::ShortFormat) const =0
 
virtual QString localizeDateTime (const QDateTime &dateTime, QLocale::FormatType formatType=QLocale::ShortFormat) const =0
 
virtual QString localizeMonetaryValue (qreal value, const QString &currencyCode=QString()) const =0
 
virtual QString localizeNumber (int number) const =0
 
virtual QString localizeNumber (qreal number) const =0
 
virtual QString localizePluralContextString (const QString &string, const QString &pluralForm, const QString &context, const QVariantList &arguments=QVariantList()) const =0
 
virtual QString localizePluralString (const QString &string, const QString &pluralForm, const QVariantList &arguments=QVariantList()) const =0
 
virtual QString localizeString (const QString &string, const QVariantList &arguments=QVariantList()) const =0
 
virtual QString localizeTime (const QTime &time, QLocale::FormatType formatType=QLocale::ShortFormat) const =0
 
virtual void popLocale ()=0
 
virtual void pushLocale (const QString &localeName)=0
 
virtual void unloadCatalog (const QString &catalog)=0
 

Detailed Description

This class defines an interface for accessing an internationalization, such as QLocale/QTranslator or gettext/KLocale.

Definition at line 41 of file abstractlocalizer.h.

Constructor & Destructor Documentation

Grantlee::AbstractLocalizer::AbstractLocalizer ( )

Constructor

virtual Grantlee::AbstractLocalizer::~AbstractLocalizer ( )
virtual

Destructor

Member Function Documentation

virtual QString Grantlee::AbstractLocalizer::currentLocale ( ) const
pure virtual

Returns the current locale as a string.

Implemented in Grantlee::QtLocalizer.

virtual void Grantlee::AbstractLocalizer::loadCatalog ( const QString path,
const QString catalog 
)
pure virtual

Loads the catalog from path.

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localize ( const QVariant variant) const
virtual

Processes the data in variant into a localized string.

The base implementation can localize numbers, dates and times, and strings.

virtual QString Grantlee::AbstractLocalizer::localizeContextString ( const QString string,
const QString context,
const QVariantList &  arguments = QVariantList() 
) const
pure virtual

Localizes string, disambiguated by context with the specified arguments for substitution

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizeDate ( const QDate date,
QLocale::FormatType  formatType = QLocale::ShortFormat 
) const
pure virtual

Localizes date with the specified formatType

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizeDateTime ( const QDateTime dateTime,
QLocale::FormatType  formatType = QLocale::ShortFormat 
) const
pure virtual

Localizes dateTime with the specified formatType

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizeMonetaryValue ( qreal  value,
const QString currencyCode = QString() 
) const
pure virtual

Localizes value as a monetary value in the currency specified by currencyCode.

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizeNumber ( int  number) const
pure virtual

Localizes number

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizeNumber ( qreal  number) const
pure virtual

Localizes number

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizePluralContextString ( const QString string,
const QString pluralForm,
const QString context,
const QVariantList &  arguments = QVariantList() 
) const
pure virtual

Localizes string or its pluralForm, disambiguated by context with the specified arguments for substitution

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizePluralString ( const QString string,
const QString pluralForm,
const QVariantList &  arguments = QVariantList() 
) const
pure virtual

Localizes string or its pluralForm with the specified arguments for substitution

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizeString ( const QString string,
const QVariantList &  arguments = QVariantList() 
) const
pure virtual

Localizes string with the specified arguments for substitution

Implemented in Grantlee::QtLocalizer.

virtual QString Grantlee::AbstractLocalizer::localizeTime ( const QTime time,
QLocale::FormatType  formatType = QLocale::ShortFormat 
) const
pure virtual

Localizes time with the specified formatType

Implemented in Grantlee::QtLocalizer.

virtual void Grantlee::AbstractLocalizer::popLocale ( )
pure virtual

Makes this localizer use the previous locale for output.

Implemented in Grantlee::QtLocalizer.

virtual void Grantlee::AbstractLocalizer::pushLocale ( const QString localeName)
pure virtual

Makes this localizer use the locale specified by localeName for output.

Implemented in Grantlee::QtLocalizer.

virtual void Grantlee::AbstractLocalizer::unloadCatalog ( const QString catalog)
pure virtual

Unloads the catalog

Implemented in Grantlee::QtLocalizer.