Gui::Translator Class Reference

#include <Translator.h>

List of all members.

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.

Detailed Description

Definition at line 47 of file Translator.h.


Member Function Documentation

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]
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().


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:04 2011 for FreeCAD by  doxygen 1.6.1