#include <Translator.h>
Public Member Functions | |
| void | activateLanguage (const char *lang) |
| Activates the specified language lang if available. | |
| std::string | activeLanguage () const |
| Returns the currently installed language. | |
| void | addPath (const QString &path) |
| Adds a path where localization files can be found. | |
| void | refresh () |
| This method checks for newly added (internal) .qm files which might be added at runtime. | |
| TStringList | supportedLanguages () const |
| Returns a list of supported languages. | |
Static Public Member Functions | |
singleton stuff | |
| static void | destruct (void) |
| Destroys the instance. | |
| static Translator * | instance (void) |
| Creates an instance. | |
Definition at line 47 of file Translator.h.
| void Translator::activateLanguage | ( | const char * | lang | ) |
Activates the specified language lang if available.
Definition at line 176 of file Translator.cpp.
References Gui::TranslatorP::activatedLanguage, draftlibs::fcvec::find(), refresh(), and supportedLanguages().
Referenced by Gui::Application::Application(), and Gui::Dialog::DlgGeneralImp::saveSettings().
| std::string Translator::activeLanguage | ( | ) | const |
Returns the currently installed language.
If no language is installed an empty string is returned.
Definition at line 186 of file Translator.cpp.
References Gui::TranslatorP::activatedLanguage.
Referenced by Gui::Application::sGetLocale().
| void Translator::addPath | ( | const QString & | path | ) |
Adds a path where localization files can be found.
Definition at line 204 of file Translator.cpp.
References Gui::TranslatorP::paths.
Referenced by Gui::Application::sAddLangPath(), and Gui::Application::sAddResPath().
| void Translator::destruct | ( | void | ) | [static] |
Destroys the instance.
Definition at line 121 of file Translator.cpp.
Referenced by Gui::Application::~Application().
| Translator * Translator::instance | ( | void | ) | [static] |
Creates an instance.
Definition at line 114 of file Translator.cpp.
Referenced by Gui::Application::Application(), loadAssemblyResource(), loadCompleteResource(), loadDrawingResource(), loadFemResource(), loadImageResource(), loadMeshPartResource(), loadMeshResource(), loadPartDesignResource(), loadPartResource(), loadPointsResource(), loadRaytracingResource(), loadReverseEngineeringResource(), loadRobotResource(), Gui::Dialog::DlgGeneralImp::loadSettings(), loadSketcherResource(), loadStartResource(), loadTestResource(), loadWebResource(), Gui::Application::sAddLangPath(), Gui::Application::sAddResPath(), Gui::Dialog::DlgGeneralImp::saveSettings(), Gui::Application::sGetLocale(), and Gui::Application::sUpdateLocale().
| void Translator::refresh | ( | ) |
This method checks for newly added (internal) .qm files which might be added at runtime.
This e.g. happens if a plugin gets loaded at runtime. For each newly added files that supports the currently set language a new translator object is created to load the file.
Definition at line 243 of file Translator.cpp.
References Gui::TranslatorP::activatedLanguage, Gui::TranslatorP::mapLanguageTopLevelDomain, and Gui::TranslatorP::paths.
Referenced by activateLanguage(), and Gui::Application::sUpdateLocale().
| TStringList Translator::supportedLanguages | ( | ) | const |
Returns a list of supported languages.
Definition at line 160 of file Translator.cpp.
References Gui::TranslatorP::mapLanguageTopLevelDomain.
Referenced by activateLanguage(), and Gui::Dialog::DlgGeneralImp::loadSettings().
1.6.1