KTextTemplate::AbstractLocalizer

Search for usage in LXR

KTextTemplate::AbstractLocalizer Class Referenceabstract

#include <KTextTemplate/AbstractLocalizer>

Inheritance diagram for KTextTemplate::AbstractLocalizer:

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={}) 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={}) 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={}) const =0
 
virtual QString localizePluralString (const QString &string, const QString &pluralForm, const QVariantList &arguments={}) const =0
 
virtual QString localizeString (const QString &string, const QVariantList &arguments={}) 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

Interface for implementing an internationalization system.

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

Author
Stephen Kelly steve.nosp@m.ire@.nosp@m.gmail.nosp@m..com

Definition at line 34 of file abstractlocalizer.h.

Constructor & Destructor Documentation

◆ AbstractLocalizer()

AbstractLocalizer::AbstractLocalizer ( )
default

Constructor.

◆ ~AbstractLocalizer()

AbstractLocalizer::~AbstractLocalizer ( )
virtualdefault

Destructor.

Member Function Documentation

◆ currentLocale()

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

Returns the current locale as a string.

Implemented in KTextTemplate::QtLocalizer.

◆ loadCatalog()

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

Loads the catalog from path.

Implemented in KTextTemplate::QtLocalizer.

◆ localize()

QString 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.

Definition at line 22 of file abstractlocalizer.cpp.

◆ localizeContextString()

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

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

Implemented in KTextTemplate::QtLocalizer.

◆ localizeDate()

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

Localizes date with the specified formatType.

Implemented in KTextTemplate::QtLocalizer.

◆ localizeDateTime()

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

Localizes dateTime with the specified formatType.

Implemented in KTextTemplate::QtLocalizer.

◆ localizeMonetaryValue()

virtual QString KTextTemplate::AbstractLocalizer::localizeMonetaryValue ( qreal value,
const QString & currencyCode = {} ) const
pure virtual

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

Implemented in KTextTemplate::QtLocalizer.

◆ localizeNumber() [1/2]

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

Localizes number.

Implemented in KTextTemplate::QtLocalizer.

◆ localizeNumber() [2/2]

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

Localizes number.

Implemented in KTextTemplate::QtLocalizer.

◆ localizePluralContextString()

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

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

Implemented in KTextTemplate::QtLocalizer.

◆ localizePluralString()

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

Localizes string or its pluralForm with the specified arguments for substitution.

Implemented in KTextTemplate::QtLocalizer.

◆ localizeString()

virtual QString KTextTemplate::AbstractLocalizer::localizeString ( const QString & string,
const QVariantList & arguments = {} ) const
pure virtual

Localizes string with the specified arguments for substitution.

Implemented in KTextTemplate::QtLocalizer.

◆ localizeTime()

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

Localizes time with the specified formatType.

Implemented in KTextTemplate::QtLocalizer.

◆ popLocale()

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

Makes this localizer use the previous locale for output.

Implemented in KTextTemplate::QtLocalizer.

◆ pushLocale()

virtual void KTextTemplate::AbstractLocalizer::pushLocale ( const QString & localeName)
pure virtual

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

Implemented in KTextTemplate::QtLocalizer.

◆ unloadCatalog()

virtual void KTextTemplate::AbstractLocalizer::unloadCatalog ( const QString & catalog)
pure virtual

Unloads the catalog.

Implemented in KTextTemplate::QtLocalizer.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.