Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Languages Class Reference

Manages available languages for the application. More...

#include <language.hpp>

List of all members.

Public Member Functions

int getLanguageIndexByShortName (const wxString &shortName) const
 Gets the index of language with the given short name.

wxString getLanguageName (const int index) const
 Gets the language name at the given index.

int getLanguagesCount () const
 Gets the number of available languages.

wxString getLanguageShortName (const int index) const
 Gets the language short name at the given index.

wxString getLanguageTranslatedName (const int index) const
 Gets the language translated name at the given index.

wxString getLanguageTranslatorName (const int index) const
 Gets the name of the translator (in latin-1 characters) at the given index.

wxString getLanguageTranslatorNameInLocale (const int index) const
 Gets the name of the translator in the language at the given index.

 Languages ()
 Default constructor.

bool setLocale (wxLocale &loc, const int language) const
 Changes the locale of the application with the given language.

bool setLocale (wxLocale &loc) const
 Changes the locale of the application.

 ~Languages ()
 Destructor.


Static Public Attributes

const int LANGUAGE_UNKNOW = -1
 Identifier for an unknown language.


Protected Member Functions

bool readLanguagesSettings (const wxString &langFileIni)
 Reads languages settings from a configuration file.

 WX_DEFINE_ARRAY (Language *, LanguagesList)
 List of languages.


Protected Attributes

LanguagesList languages
 List of languages.


Detailed Description

Manages available languages for the application.

Never pass an instance of this class by value, always pass by reference or by adress.

For adding a language, see the comments of the default constructor.

Definition at line 53 of file language.hpp.


Constructor & Destructor Documentation

Languages::Languages  ) 
 

Default constructor.

For adding a language:

  • Add the language in cmplLangs[].
  • Use the Add() method to add the language at the end of the method.

Definition at line 286 of file language.cpp.

References APP_AUTHOR, languages, and readLanguagesSettings().

Languages::~Languages  ) 
 

Destructor.

Definition at line 312 of file language.cpp.

References languages.


Member Function Documentation

int Languages::getLanguageIndexByShortName const wxString &  shortName  )  const
 

Gets the index of language with the given short name.

Parameters:
shortName A short name of the wanted language's index.
Returns:
The index of language with the given short name or Languages::LANGUAGE_UNKNOW if the short name doesn't correspond to a known language.

Definition at line 453 of file language.cpp.

References getLanguageIndexByShortName(), LANGUAGE_UNKNOW, and languages.

Referenced by dlgConfigure::createControls(), and getLanguageIndexByShortName().

wxString Languages::getLanguageName const int  index  )  const
 

Gets the language name at the given index.

Parameters:
index The index of the wanted language's name.
Returns:
The language name at the given index or an empty string if the given index is invalid.

Definition at line 401 of file language.cpp.

References getLanguageName(), getLanguagesCount(), and languages.

Referenced by dlgConfigure::createControls(), and getLanguageName().

int Languages::getLanguagesCount  )  const
 

Gets the number of available languages.

Returns:
The number of available languages.

Definition at line 387 of file language.cpp.

References languages.

Referenced by dlgConfigure::createControls(), dlgAbout::createControls(), getLanguageName(), getLanguageShortName(), getLanguageTranslatedName(), getLanguageTranslatorName(), and getLanguageTranslatorNameInLocale().

wxString Languages::getLanguageShortName const int  index  )  const
 

Gets the language short name at the given index.

Parameters:
index The index of the wanted language's short name.
Returns:
The language short name at the given index or an empty string if the given index is invalid.

Definition at line 435 of file language.cpp.

References getLanguagesCount(), getLanguageShortName(), and languages.

Referenced by dlgAbout::createControls(), getLanguageShortName(), and frmSums::itmToolsConfigureClick().

wxString Languages::getLanguageTranslatedName const int  index  )  const
 

Gets the language translated name at the given index.

Parameters:
index The index of the wanted translated language's name.
Returns:
The language translated name at the given index or an empty string if the given index is invalid.

Definition at line 418 of file language.cpp.

References getLanguagesCount(), getLanguageTranslatedName(), and languages.

Referenced by dlgConfigure::createControls(), and getLanguageTranslatedName().

wxString Languages::getLanguageTranslatorName const int  index  )  const
 

Gets the name of the translator (in latin-1 characters) at the given index.

Parameters:
index The index of the language of the wanted translator's name.
Returns:
The name of the translator of the language at the given index or an empty string if the given index is invalid.

Definition at line 483 of file language.cpp.

References getLanguagesCount(), getLanguageTranslatorName(), and languages.

Referenced by dlgAbout::createControls(), and getLanguageTranslatorName().

wxString Languages::getLanguageTranslatorNameInLocale const int  index  )  const
 

Gets the name of the translator in the language at the given index.

Parameters:
index The index of the language of the wanted translator's name.
Returns:
The name of the translator of the language at the given index or an empty string if the given index is invalid.

Definition at line 500 of file language.cpp.

References getLanguagesCount(), getLanguageTranslatorNameInLocale(), and languages.

Referenced by dlgAbout::createControls(), and getLanguageTranslatorNameInLocale().

bool Languages::readLanguagesSettings const wxString &  langFileIni  )  [protected]
 

Reads languages settings from a configuration file.

Parameters:
langFileIni Name of the the application's languages settings to use.
Returns:
true if at least one language definition has been read, false otherwise.

Definition at line 517 of file language.cpp.

References APP_AUTHOR, APP_NAME, languages, readLanguagesSettings(), and UTF8toLocal().

Referenced by Languages(), and readLanguagesSettings().

bool Languages::setLocale wxLocale &  loc,
const int  language
const
 

Changes the locale of the application with the given language.

Parameters:
loc The locale to change.
language Identifier of the language.
Returns:
true if the locale has been changed, false otherwise.

Definition at line 365 of file language.cpp.

References languages, and setLocale().

bool Languages::setLocale wxLocale &  loc  )  const
 

Changes the locale of the application.

Parameters:
loc The locale to change.
Returns:
true if the locale has been changed, false otherwise.

Definition at line 332 of file language.cpp.

References AppPrefs::get(), languages, AppPrefs::readString(), and setLocale().

Referenced by CkSumsApp::InitLocale(), and setLocale().

Languages::WX_DEFINE_ARRAY Language ,
LanguagesList 
[protected]
 

List of languages.


Member Data Documentation

const int Languages::LANGUAGE_UNKNOW = -1 [static]
 

Identifier for an unknown language.

Definition at line 274 of file language.cpp.

Referenced by getLanguageIndexByShortName().

LanguagesList Languages::languages [protected]
 

List of languages.

Definition at line 120 of file language.hpp.

Referenced by getLanguageIndexByShortName(), getLanguageName(), getLanguagesCount(), getLanguageShortName(), getLanguageTranslatedName(), getLanguageTranslatorName(), getLanguageTranslatorNameInLocale(), Languages(), readLanguagesSettings(), setLocale(), and ~Languages().


The documentation for this class was generated from the following files:
Generated on Sun May 30 13:38:05 2004 for wxChecksums by doxygen 1.3.7