Grantlee
0.3.0
|
Provides internationalization based on QLocale and QTranslator. More...
#include <qtlocalizer.h>
Public Member Functions | |
QtLocalizer (const QLocale &locale=QLocale::system()) | |
virtual | ~QtLocalizer () |
virtual QString | currentLocale () const |
void | installTranslator (QTranslator *translator, const QString &localeName=QLocale::system().name()) |
virtual void | loadCatalog (const QString &path, const QString &catalog) |
virtual QString | localizeContextString (const QString &string, const QString &context, const QVariantList &arguments=QVariantList()) const |
virtual QString | localizeDate (const QDate &date, QLocale::FormatType formatType=QLocale::ShortFormat) const |
virtual QString | localizeDateTime (const QDateTime &dateTime, QLocale::FormatType formatType=QLocale::ShortFormat) const |
virtual QString | localizeMonetaryValue (qreal value, const QString ¤cyCode=QString()) const |
virtual QString | localizeNumber (int number) const |
virtual QString | localizeNumber (qreal number) const |
virtual QString | localizePluralContextString (const QString &string, const QString &pluralForm, const QString &context, const QVariantList &arguments=QVariantList()) const |
virtual QString | localizePluralString (const QString &string, const QString &pluralForm, const QVariantList &arguments=QVariantList()) const |
virtual QString | localizeString (const QString &string, const QVariantList &arguments=QVariantList()) const |
virtual QString | localizeTime (const QTime &time, QLocale::FormatType formatType=QLocale::ShortFormat) const |
virtual void | popLocale () |
virtual void | pushLocale (const QString &localeName) |
void | setAppTranslatorPath (const QString &path) |
void | setAppTranslatorPrefix (const QString &prefix) |
virtual void | unloadCatalog (const QString &catalog) |
![]() | |
AbstractLocalizer () | |
virtual | ~AbstractLocalizer () |
virtual QString | localize (const QVariant &variant) const |
Additional Inherited Members | |
![]() | |
typedef QSharedPointer < AbstractLocalizer > | Ptr |
This class implements access to the Qt Localization system. Localizaable types such as strings, numbers, dates and times can be processed.
Definition at line 55 of file qtlocalizer.h.
Grantlee::QtLocalizer::QtLocalizer | ( | const QLocale & | locale = QLocale::system() ) |
Constructs a new QtLocalizer using the locale
|
virtual |
Destructor
|
virtual |
Returns the current locale as a string.
Implements Grantlee::AbstractLocalizer.
void Grantlee::QtLocalizer::installTranslator | ( | QTranslator * | translator, |
const QString & | localeName = QLocale::system().name() |
||
) |
Install a translator
to use for a particular localeName
.
|
virtual |
Loads the catalog
from path
.
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes string
, disambiguated by context
with the specified arguments
for substitution
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes date
with the specified formatType
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes dateTime
with the specified formatType
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes value
as a monetary value in the currency specified by currencyCode
.
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes number
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes number
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes string
or its pluralForm
, disambiguated by context
with the specified arguments
for substitution
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes string
or its pluralForm
with the specified arguments
for substitution
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes string
with the specified arguments
for substitution
Implements Grantlee::AbstractLocalizer.
|
virtual |
Localizes time
with the specified formatType
Implements Grantlee::AbstractLocalizer.
|
virtual |
Makes this localizer use the previous locale for output.
Implements Grantlee::AbstractLocalizer.
|
virtual |
Makes this localizer use the locale specified by localeName
for output.
Implements Grantlee::AbstractLocalizer.
void Grantlee::QtLocalizer::setAppTranslatorPath | ( | const QString & | path) |
Set the path to look for translations of the application strings.
void Grantlee::QtLocalizer::setAppTranslatorPrefix | ( | const QString & | prefix) |
Set the prefix of translation files. For example, if the German translation file is called myapp_de_DE.qm
, the prefix should be set to myapp_
.
|
virtual |
Unloads the catalog
Implements Grantlee::AbstractLocalizer.