#include "filesystem.hpp"
#include "gettext.hpp"
#include "language.hpp"
#include "log.hpp"
#include "preferences/general.hpp"
#include "serialization/parser.hpp"
#include "serialization/preprocessor.hpp"
#include "game_config_manager.hpp"
#include <stdexcept>
#include <clocale>
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 () |
void | set_min_translation_percent (int percent) |
static void | wesnoth_setlocale (int category, const std::string &slocale, std::vector< std::string > const *alternates) |
void | set_language (const language_def &locale) |
const language_def & | get_language () |
const language_def & | get_locale () |
void | init_textdomains (const game_config_view &cfg) |
Initializes the list of textdomains from a configuration object. More... | |
bool | init_strings (const game_config_view &cfg) |
Initializes certain English strings. More... | |
Variables | |
static language_list | known_languages |
symbol_table | string_table |
#define DBG_G LOG_STREAM(debug, lg::general()) |
Definition at line 38 of file language.cpp.
Referenced by load_strings(), and wesnoth_setlocale().
#define ERR_G LOG_STREAM(err, lg::general()) |
Definition at line 41 of file language.cpp.
#define LOG_G LOG_STREAM(info, lg::general()) |
Definition at line 39 of file language.cpp.
Referenced by get_locale(), load_strings(), and wesnoth_setlocale().
#define WRN_G LOG_STREAM(warn, lg::general()) |
Definition at line 40 of file language.cpp.
Referenced by init_textdomains(), and wesnoth_setlocale().
bool current_language_rtl | ( | ) |
Definition at line 54 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 316 of file language.cpp.
Referenced by current_language_rtl(), intf_get_language(), and gui2::dialogs::language_selection::pre_show().
language_list get_languages | ( | ) |
Definition at line 116 of file language.cpp.
References known_languages, and sort().
Referenced by test_utils::game_config_manager::game_config_manager(), game_launcher::init_language(), gui2::dialogs::language_selection::post_show(), and gui2::dialogs::language_selection::pre_show().
const language_def& get_locale | ( | ) |
Definition at line 318 of file language.cpp.
References i, known_languages, preferences::language(), LOG_G, and translation::set_language().
Referenced by translation::dgettext(), translation::dsngettext(), translation::egettext(), game_launcher::init_language(), and translation::strftime().
bool init_strings | ( | const game_config_view & | cfg | ) |
Initializes certain English strings.
Definition at line 379 of file language.cpp.
References game_config_view::child_range(), and load_strings().
Referenced by game_config_manager::load_game_config().
void init_textdomains | ( | const game_config_view & | cfg | ) |
Initializes the list of textdomains from a configuration object.
Definition at line 356 of file language.cpp.
References t_string::add_textdomain(), game_config_view::child_range(), filesystem::get_binary_dir_location(), filesystem::get_intl_dir(), name, game_config::path, t, and WRN_G.
Referenced by test_utils::game_config_manager::game_config_manager(), game_config_manager::init_game_config(), game_launcher::play_screenshot_mode(), and game_launcher::start_editor().
bool load_language_list | ( | ) |
Definition at line 93 of file language.cpp.
References config::child_range(), filesystem::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_launcher::init_language().
bool load_strings | ( | bool | complain | ) |
Definition at line 293 of file language.cpp.
Referenced by init_strings(), and set_language().
void set_language | ( | const language_def & | locale | ) |
Definition at line 276 of file language.cpp.
References language_def::alternates, load_strings(), language_def::localename, translation::set_language(), time_locale_correct(), and wesnoth_setlocale().
void set_min_translation_percent | ( | int | percent | ) |
Definition at line 133 of file language.cpp.
References language_def::percent.
Referenced by game_launcher::game_launcher().
bool& time_locale_correct | ( | ) |
Definition at line 66 of file language.cpp.
Referenced by set_language(), and wesnoth_setlocale().
|
static |
Definition at line 198 of file language.cpp.
References DBG_G, i, LOG_G, time_locale_correct(), and WRN_G.
Referenced by set_language().
|
static |
Definition at line 50 of file language.cpp.
Referenced by get_languages(), get_locale(), and load_language_list().
symbol_table string_table |
Definition at line 64 of file language.cpp.
Referenced by attack_info(), gui2::dialogs::game_load::evaluate_summary_string(), help::unit_topic_generator::operator()(), gui2::dialogs::unit_attack::pre_show(), gui2::unit_preview_pane::print_attack_details(), gui2::dialogs::attack_predictions::set_data(), and unit_alignment().