The Battle for Wesnoth  1.19.5+dev
Functions
translation Namespace Reference

Functions

std::string dgettext (const char *domain, const char *msgid)
 
std::string egettext (char const *msgid)
 
std::string dsgettext (const char *domainname, const char *msgid)
 
std::string dsngettext (const char *domainname, const char *singular, const char *plural, int n)
 
void bind_textdomain (const char *domain, const char *directory, const char *)
 
void set_default_textdomain (const char *domain)
 
void set_language (const std::string &language, const std::vector< std::string > *)
 
int compare (const std::string &s1, const std::string &s2)
 Case-sensitive lexicographical comparison. More...
 
int icompare (const std::string &s1, const std::string &s2)
 Case-insensitive lexicographical comparison. More...
 
std::string strftime (const std::string &format, const std::tm *time)
 
bool ci_search (const std::string &s1, const std::string &s2)
 
const boost::locale::info & get_effective_locale_info ()
 A facet that holds general information about the effective locale. More...
 
static std::string gettext (const char *str)
 
static std::string sgettext (const char *str)
 
static std::string sngettext (const char *str1, const char *str2, int n)
 

Function Documentation

◆ bind_textdomain()

void translation::bind_textdomain ( const char *  domain,
const char *  directory,
const char *   
)

◆ ci_search()

bool translation::ci_search ( const std::string &  s1,
const std::string &  s2 
)

◆ compare()

int translation::compare ( const std::string &  s1,
const std::string &  s2 
)

◆ dgettext()

std::string translation::dgettext ( const char *  domain,
const char *  msgid 
)

Definition at line 425 of file gettext.cpp.

References get_locale().

Referenced by dsgettext(), gui2::get_hp_tooltip(), and gettext().

◆ dsgettext()

std::string translation::dsgettext ( const char *  domainname,
const char *  msgid 
)

◆ dsngettext()

std::string translation::dsngettext ( const char *  domainname,
const char *  singular,
const char *  plural,
int  n 
)

Definition at line 464 of file gettext.cpp.

References get_locale(), and n.

Referenced by _n(), sngettext(), t_string_base::str(), and vngettext_impl().

◆ egettext()

std::string translation::egettext ( char const *  msgid)

Definition at line 429 of file gettext.cpp.

References get_locale(), and gettext().

Referenced by attack_type::attack_type().

◆ get_effective_locale_info()

const boost::locale::info & translation::get_effective_locale_info ( )

A facet that holds general information about the effective locale.

This describes the actual translation target language, unlike language_def.localename in language.hpp, where the "System default language" is represented by an empty string.

Definition at line 576 of file gettext.cpp.

References get_locale().

Referenced by addon_info::translated_info(), and gui2::dialogs::title_screen::update_static_labels().

◆ gettext()

static std::string translation::gettext ( const char *  str)
inlinestatic

◆ icompare()

int translation::icompare ( const std::string &  s1,
const std::string &  s2 
)

Case-insensitive lexicographical comparison.

Definition at line 519 of file gettext.cpp.

References compare(), e, and ERR_G.

Referenced by terrain_movement::operator<(), help::terrain_movement_info::operator<(), mp::user_info::operator<(), and gui2::listbox::register_translatable_sorting_option().

◆ set_default_textdomain()

void translation::set_default_textdomain ( const char *  domain)

Definition at line 487 of file gettext.cpp.

References LOG_G.

Referenced by test_utils::game_config_manager::game_config_manager(), and init_locale().

◆ set_language()

void translation::set_language ( const std::string &  language,
const std::vector< std::string > *   
)

◆ sgettext()

static std::string translation::sgettext ( const char *  str)
inlinestatic

Definition at line 62 of file gettext.hpp.

References dsgettext(), and GETTEXT_DOMAIN.

Referenced by events::menu_handler::ai_formula(), and events::menu_handler::user_command().

◆ sngettext()

static std::string translation::sngettext ( const char *  str1,
const char *  str2,
int  n 
)
inlinestatic

Definition at line 64 of file gettext.hpp.

References dsngettext(), GETTEXT_DOMAIN, and n.

◆ strftime()

std::string translation::strftime ( const std::string &  format,
const std::tm *  time 
)