The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
language.cpp File Reference
#include "global.hpp"
#include "filesystem.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.

Macros

#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 & time_locale_correct ()
 
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. More...
 
bool init_strings (const config &cfg)
 Initializes certain English strings. More...
 

Variables

static language_list known_languages
 
symbol_table string_table
 

Macro Definition Documentation

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

Definition at line 40 of file language.cpp.

Referenced by load_strings(), and wesnoth_setlocale().

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

Definition at line 43 of file language.cpp.

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

Definition at line 41 of file language.cpp.

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

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

Definition at line 42 of file language.cpp.

Referenced by init_textdomains(), and wesnoth_setlocale().

Function Documentation

bool current_language_rtl ( )

Definition at line 55 of file language.cpp.

References get_language(), and language_def::rtl.

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

const language_def& get_language ( )

Definition at line 251 of file language.cpp.

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

language_list get_languages ( )
const language_def& get_locale ( )
bool init_strings ( const config cfg)

Initializes certain English strings.

Definition at line 316 of file language.cpp.

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

Referenced by game_config_manager::load_game_config().

void init_textdomains ( const config cfg)
bool load_language_list ( )
bool load_strings ( bool  complain)

Definition at line 228 of file language.cpp.

References DBG_G, and LOG_G.

Referenced by init_strings(), and set_language().

void set_language ( const language_def locale)
bool& time_locale_correct ( )

Definition at line 67 of file language.cpp.

Referenced by set_language(), util::strftime(), and wesnoth_setlocale().

static void wesnoth_setlocale ( int  category,
std::string const &  slocale,
std::vector< std::string > const *  alternates 
)
static

Definition at line 126 of file language.cpp.

References DBG_G, i, LOG_G, pos, time_locale_correct(), and WRN_G.

Referenced by set_language().

Variable Documentation

language_list known_languages
static

Definition at line 51 of file language.cpp.

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

symbol_table string_table