Defines | Functions | Variables

language.cpp File Reference

#include "global.hpp"
#include "filesystem.hpp"
#include "foreach.hpp"
#include "gettext.hpp"
#include "language.hpp"
#include "log.hpp"
#include "preferences.hpp"
#include "serialization/parser.hpp"
#include "serialization/preprocessor.hpp"
#include <stdexcept>
#include <clocale>
#include <boost/scoped_array.hpp>
Include dependency graph for language.cpp:

Go to the source code of this file.

Defines

#define DBG_G   LOG_STREAM(debug, lg::general)
#define LOG_G   LOG_STREAM(info, lg::general)
#define WRN_G   LOG_STREAM(warn, lg::general)
#define ERR_G   LOG_STREAM(err, lg::general)

Functions

bool load_strings (bool complain)
bool current_language_rtl ()
bool load_language_list ()
language_list get_languages ()
static void wesnoth_setlocale (int category, std::string const &slocale, std::vector< std::string > const *alternates)
void set_language (const language_def &locale)
const language_defget_language ()
const language_defget_locale ()
void init_textdomains (const config &cfg)
 Initializes the list of textdomains from a configuration object.
bool init_strings (const config &cfg)
 Initializes certain english strings.

Variables

static language_list known_languages
symbol_table string_table

Define Documentation

#define DBG_G   LOG_STREAM(debug, lg::general)

Definition at line 42 of file language.cpp.

Referenced by load_strings(), and wesnoth_setlocale().

#define ERR_G   LOG_STREAM(err, lg::general)

Definition at line 45 of file language.cpp.

Referenced by init_textdomains(), and wesnoth_setlocale().

#define LOG_G   LOG_STREAM(info, lg::general)

Definition at line 43 of file language.cpp.

Referenced by get_locale(), load_strings(), and wesnoth_setlocale().

#define WRN_G   LOG_STREAM(warn, lg::general)

Definition at line 44 of file language.cpp.

Referenced by wesnoth_setlocale().


Function Documentation

bool current_language_rtl (  ) 

Definition at line 57 of file language.cpp.

References get_language(), and language_def::rtl.

Referenced by gui::menu::draw_row().

Here is the call graph for this function:

Here is the caller graph for this function:

const language_def& get_language (  ) 

Definition at line 242 of file language.cpp.

Referenced by current_language_rtl(), and gui2::tlanguage_selection::pre_show().

Here is the caller graph for this function:

language_list get_languages (  ) 

Definition at line 114 of file language.cpp.

References known_languages, and sort().

Referenced by test_utils::game_config_manager::game_config_manager(), game_controller_abstract::init_language(), gui2::tlanguage_selection::post_show(), and gui2::tlanguage_selection::pre_show().

Here is the call graph for this function:

Here is the caller graph for this function:

const language_def& get_locale (  ) 

Definition at line 244 of file language.cpp.

References known_languages, preferences::language(), LOG_G, and wesnoth_setlocale().

Referenced by game_controller_abstract::init_language().

Here is the call graph for this function:

Here is the caller graph for this function:

bool init_strings ( const config cfg  ) 

Initializes certain english strings.

Definition at line 307 of file language.cpp.

References config::child_range(), and load_strings().

Referenced by game_controller::load_game_cfg().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_textdomains ( const config cfg  ) 

Initializes the list of textdomains from a configuration object.

Definition at line 284 of file language.cpp.

References t_string::add_textdomain(), config::child_range(), ERR_G, get_binary_dir_location(), get_intl_dir(), and game_config::path.

Referenced by test_utils::game_config_manager::game_config_manager(), game_controller::init_config(), game_controller::play_screenshot_mode(), and game_controller::start_editor().

Here is the call graph for this function:

Here is the caller graph for this function:

bool load_language_list (  ) 

Definition at line 90 of file language.cpp.

References config::child_range(), get_wml_location(), known_languages, N_, preprocess_file(), and read().

Referenced by BOOST_AUTO_TEST_CASE(), test_utils::game_config_manager::game_config_manager(), and game_controller_abstract::init_language().

Here is the call graph for this function:

Here is the caller graph for this function:

bool load_strings ( bool  complain  ) 

Definition at line 219 of file language.cpp.

References config::attribute_range(), DBG_G, and LOG_G.

Referenced by init_strings(), and set_language().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_language ( const language_def locale  ) 
static void wesnoth_setlocale ( int  category,
std::string const &  slocale,
std::vector< std::string > const *  alternates 
) [static]

Definition at line 122 of file language.cpp.

References DBG_G, ERR_G, LOG_G, pos, and WRN_G.

Referenced by get_locale(), and set_language().

Here is the caller graph for this function:


Variable Documentation

Definition at line 53 of file language.cpp.

Referenced by get_languages(), get_locale(), and load_language_list().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:05:27 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs