Anope IRC Services  Version 2.0
Functions | Variables
Language Namespace Reference

Functions

void InitLanguages ()
 
CoreExport const char * Translate (const char *string)
 
CoreExport const char * Translate (User *u, const char *string)
 
CoreExport const char * Translate (const NickCore *nc, const char *string)
 
CoreExport const char * Translate (const char *lang, const char *string)
 

Variables

CoreExport std::vector
< Anope::string
Languages
 
std::vector< Anope::stringDomains
 

Function Documentation

void Language::InitLanguages ( )

Initialize the language system. Finds valid language files and populates the Languages list.

Definition at line 26 of file language.cpp.

References _, Anope::string::c_str(), sepstream::GetToken(), Languages, Anope::LastError(), Anope::LocaleDir, LOG_DEBUG, and Translate().

Referenced by Anope::Init().

const char * Language::Translate ( const char *  string)
const char * Language::Translate ( User u,
const char *  string 
)

Translates a string to the language of the given user.

Parameters
uThe user to transate the string for
stringA string to translate
Returns
The translated string if found, else the original string.

Definition at line 64 of file language.cpp.

References User::Account(), and Translate().

const char * Language::Translate ( const NickCore nc,
const char *  string 
)

Translates a string to the language of the given account.

Parameters
ncThe account to translate the string for
stringA string to translate
Returns
The translated string if count, else the original string

Definition at line 72 of file language.cpp.

References Anope::string::c_str(), NickCore::language, and Translate().

const char * Language::Translate ( const char *  lang,
const char *  string 
)

Translatesa string to the given language.

Parameters
langThe language to translate to
stringThe string to translate
Returns
The translated string if found, else the original string.

Definition at line 119 of file language.cpp.

Variable Documentation

std::vector< Anope::string > Language::Domains

Definition at line 24 of file language.cpp.

Referenced by Module::Module(), and Module::~Module().

std::vector< Anope::string > Language::Languages