language.cpp File Reference

#include "global.hpp"
#include "config.hpp"
#include "filesystem.hpp"
#include "foreach.hpp"
#include "game_config.hpp"
#include "gettext.hpp"
#include "language.hpp"
#include "log.hpp"
#include "preferences.hpp"
#include "util.hpp"
#include "serialization/parser.hpp"
#include "serialization/preprocessor.hpp"
#include "wesconfig.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <stdexcept>

Include dependency graph for language.cpp:

Go to the source code of this file.

Functions

static bool has_locale (const char *s)
 Tests one locale to be available.
static bool has_language (const std::string &language)
 Test the locale for a language and it's utf-8 variations.
std::string languagedef_name (const language_def &def)
bool current_language_rtl ()
bool load_language_list ()
std::vector< language_defget_languages ()
static void wesnoth_setlocale (int category, std::string const &slocale, std::vector< std::string > const *alternates)
bool 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.

Variables

language_def current_language
string_map strings_
static std::vector< language_defknown_languages
symbol_table string_table


Function Documentation

bool current_language_rtl (  ) 

Definition at line 85 of file language.cpp.

References get_language(), and language_def::rtl.

Referenced by gui::menu::draw_row(), and show_intro_part_helper().

const language_def& get_language (  ) 

std::vector<language_def> get_languages (  ) 

Definition at line 161 of file language.cpp.

References known_languages.

Referenced by map_editor::change_language(), main(), and gui2::tlanguage_selection::show().

const language_def& get_locale (  ) 

Definition at line 296 of file language.cpp.

References lg::general, lg::info, known_languages, preferences::language(), LOG_STREAM, and wesnoth_setlocale().

Referenced by main().

static bool has_language ( const std::string &  language  )  [static]

Test the locale for a language and it's utf-8 variations.

Definition at line 54 of file language.cpp.

References has_locale().

Referenced by language_def::available().

static bool has_locale ( const char *  s  )  [static]

Tests one locale to be available.

Definition at line 42 of file language.cpp.

Referenced by has_language().

void init_textdomains ( const config cfg  ) 

Initializes the list of textdomains from a configuration object.

Definition at line 331 of file language.cpp.

References t_string::add_textdomain(), config::child_range(), get_binary_file_location(), get_intl_dir(), name, and game_config::path.

Referenced by main().

std::string languagedef_name ( const language_def def  ) 

Definition at line 80 of file language.cpp.

References language_def::language.

Referenced by map_editor::change_language().

bool load_language_list (  ) 

Definition at line 137 of file language.cpp.

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

Referenced by main().

bool 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 166 of file language.cpp.

References game_config::path.

Referenced by get_locale(), and set_language().


Variable Documentation

Definition at line 74 of file language.cpp.

Referenced by get_language(), set_language(), and gui2::tlanguage_selection::show().

std::vector<language_def> known_languages [static]

Definition at line 78 of file language.cpp.

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

string_map strings_ [static]

Definition at line 75 of file language.cpp.

Referenced by symbol_table::operator[](), and set_language().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs