The Sword Project: sword::LocaleMgr Class Reference |
#include <localemgr.h>
Collaboration diagram for sword::LocaleMgr:
Public Member Functions | |
LocaleMgr (const char *iConfigPath=0) | |
Default constructor of LocaleMgr You do normally not need this constructor, use LocaleMgr::getSystemLocaleMgr() instead. | |
virtual | ~LocaleMgr () |
Default destructor of LocaleMgr. | |
virtual SWLocale * | getLocale (const char *name) |
Get the locale connected with the name "name". | |
virtual StringList | getAvailableLocales () |
Get the list of available locales. | |
virtual const char * | translate (const char *text, const char *localeName=0) |
Returns translated text. | |
virtual const char * | getDefaultLocaleName () |
Get the default locale name. | |
virtual void | setDefaultLocaleName (const char *name) |
Set the new standard locale of Sword. | |
virtual void | loadConfigDir (const char *ipath) |
Augment this localmgr with all locale.conf files in a directory. | |
Static Public Member Functions | |
static LocaleMgr * | getSystemLocaleMgr () |
The LocaleMgr object used globally in the Sword world. | |
static void | setSystemLocaleMgr (LocaleMgr *newLocaleMgr) |
Protected Attributes | |
LocaleMap * | locales |
Static Protected Attributes | |
static LocaleMgr * | systemLocaleMgr |
Private Member Functions | |
void | deleteLocales () |
LocaleMgr (const LocaleMgr &) | |
Private Attributes | |
char * | defaultLocaleName |
Friends | |
class | __staticsystemLocaleMgr |
It provides functions to get a list of all available locales, to get the default locale name and to get it. The other functions are not interesting for frontend programmers.
To get the default locale name use
setDefaultLocaleName To get the locale for a language name use
Definition at line 49 of file localemgr.h.
virtual SWLocale* sword::LocaleMgr::getLocale | ( | const char * | name | ) | [virtual] |
Get the locale connected with the name "name".
name | The name of the locale you want to have. For example use getLocale("de") to get the locale for the German language. |
virtual StringList sword::LocaleMgr::getAvailableLocales | ( | ) | [virtual] |
Get the list of available locales.
virtual const char* sword::LocaleMgr::translate | ( | const char * | text, | |
const char * | localeName = 0 | |||
) | [virtual] |
Returns translated text.
This function uses both parameters to return the translated version of the given text.
text | The text to translate into the language given by the first parameter. | |
localeName | The name of the locale Sword should use |
virtual const char* sword::LocaleMgr::getDefaultLocaleName | ( | ) | [virtual] |
Get the default locale name.
To set it use
virtual void sword::LocaleMgr::setDefaultLocaleName | ( | const char * | name | ) | [virtual] |
Set the new standard locale of Sword.
name | The name of the new default locale |
static LocaleMgr* sword::LocaleMgr::getSystemLocaleMgr | ( | ) | [static] |
The SWORD Project; P. O. Box 2528; Tempe, AZ 85280-2528 USA |