9 #include <QReadWriteLock> 15 #define DEFAULT_QT_LANGUAGE (QLocale::AnyLanguage) 20 Q_CLASSINFO(
"Version",
"1.0.0")
26 static QString
ToString (QLocale::Language Language,
bool Empty = false);
48 QString
GetTranslation (const QString &Context, const QString &String,
49 const QString &Disambiguation,
int Number);
53 void InitialiseTranslations (
void);
54 static
void Initialise (
void);
57 Q_DISABLE_COPY(TorcLanguage)
62 QList<QLocale> m_languages;
63 QTranslator m_translator;
70 virtual ~TorcStringFactory() =
default;
72 static QVariantMap GetTorcStrings (
void);
73 static TorcStringFactory* GetTorcStringFactory (
void);
74 TorcStringFactory* NextFactory (
void)
const;
76 virtual void GetStrings (QVariantMap &Strings) = 0;
83 Q_DISABLE_COPY(TorcStringFactory)
86 #endif // TORCLANGUAGE_H
A wrapper around a database setting.
static QLocale::Language From2CharCode(const char *Code)
Return the language associated with the given 2 character code.
void SetLanguageCode(const QString &Language)
Set the current language for this application.
static QMap< QString, int > gLanguageMap
void LanguageCodeChanged(QString &Language)
void LanguageSettingChanged(QString &Language)
A class to track and manage language and locale settings and available translations.
QString GetLanguageString(void)
TorcStringFactory * nextTorcStringFactory
static TorcStringFactory * gTorcStringFactory
QString GetLanguageCode(void)
Return the current language.
QString GetTranslation(const QString &Context, const QString &String, const QString &Disambiguation, int Number)
A factory class to register translatable strings for use with external interfaces/applications.
void LanguageStringChanged(QString &String)
static QLocale::Language From3CharCode(const char *Code)
Return the language associated with the given 3 character code.
void SubscriberDeleted(QObject *Subscriber)
static QString ToString(QLocale::Language Language, bool Empty=false)
Return a user readable string for the current language.