Serial Studio 1.1.6
A dashboard software for your embedded projects
|
The Translator class. More...
#include <Translator.h>
Public Slots | |
void | setLanguage (const int language) |
void | setLanguage (const QLocale &locale, const QString &language) |
Signals | |
void | languageChanged () |
Public Member Functions | |
int | language () const |
int | systemLanguage () const |
StringList | availableLanguages () const |
Q_INVOKABLE QString | welcomeConsoleText () const |
Q_INVOKABLE QString | acknowledgementsText () const |
Static Public Member Functions | |
static Translator & | instance () |
Properties | |
int | language |
StringList | availableLanguages |
Private Member Functions | |
Translator () | |
Translator (Translator &&)=delete | |
Translator (const Translator &)=delete | |
Translator & | operator= (Translator &&)=delete |
Translator & | operator= (const Translator &)=delete |
Private Attributes | |
int | m_language |
QSettings | m_settings |
QTranslator | m_translator |
The Translator class.
The Translator
module provides the user interface with a list of available translations, and loads the specified translation file during application startup or when the user changes the language of the application.
|
explicitprivate |
Constructor function
|
privatedelete |
|
privatedelete |
QString Misc::Translator::acknowledgementsText | ( | ) | const |
Returns the acknowledgements text.
StringList Misc::Translator::availableLanguages | ( | ) | const |
Returns a list with the available translation languages.
|
static |
Returns the only instance of the class
int Misc::Translator::language | ( | ) | const |
Returns the current language ID, which corresponds to the indexes of the languages returned by the availableLanguages()
function.
|
signal |
|
privatedelete |
|
privatedelete |
|
slot |
Changes the language of the application and emits the signals appropiate to reload every string that uses the Qt translator system.
language | language ID based on the indexes of the availableLanguages() function |
|
slot |
Changes the language of the application and emits the signals neccesary to reload every string that uses the Qt translator system.
locale | user-set locale |
language | name of the *.qm file to load from the "translations" directory inside the application's resources |
int Misc::Translator::systemLanguage | ( | ) | const |
Returns the appropiate language ID based on the current locale settings of the host's operating system.
QString Misc::Translator::welcomeConsoleText | ( | ) | const |
Returns the welcome text displayed on the console
|
private |
|
private |
|
private |
|
read |
|
readwrite |