The Battle for Wesnoth  1.19.5+dev
Classes | Typedefs | Functions | Variables
language.hpp File Reference
#include "tstring.hpp"
#include "serialization/string_utils.hpp"
Include dependency graph for language.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  language_def
 
struct  symbol_table
 

Typedefs

typedef std::vector< language_deflanguage_list
 

Functions

bool & time_locale_correct ()
 
std::vector< language_defget_languages (bool all=false)
 Return a list of available translations. More...
 
void set_language (const language_def &locale)
 
const language_defget_language ()
 
bool current_language_rtl ()
 
const language_defget_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...
 
bool load_language_list ()
 
int get_min_translation_percent ()
 
void set_min_translation_percent (int percent)
 

Variables

symbol_table string_table
 

Typedef Documentation

◆ language_list

typedef std::vector<language_def> language_list

Definition at line 65 of file language.hpp.

Function Documentation

◆ current_language_rtl()

bool current_language_rtl ( )

Definition at line 54 of file language.cpp.

References get_language(), and language_def::rtl.

◆ get_language()

const language_def& get_language ( )

◆ get_languages()

std::vector<language_def> get_languages ( bool  all = false)

Return a list of available translations.

The list will normally be filtered with incomplete (according to min_translation_percent) translations removed.

Parameters
allif true, include incomplete translations
Precondition
load_language_list() has already been called

Definition at line 126 of file language.cpp.

References known_languages.

Referenced by test_utils::game_config_manager::game_config_manager(), game_launcher::init_language(), and gui2::dialogs::title_screen::update_static_labels().

◆ get_locale()

const language_def& get_locale ( )

◆ get_min_translation_percent()

int get_min_translation_percent ( )

Definition at line 143 of file language.cpp.

Referenced by gui2::dialogs::language_selection::language_selection().

◆ init_strings()

bool init_strings ( const game_config_view cfg)

Initializes certain English strings.

Definition at line 383 of file language.cpp.

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

Referenced by game_config_manager::load_game_config().

◆ init_textdomains()

void init_textdomains ( const game_config_view cfg)

◆ load_language_list()

bool load_language_list ( )

◆ set_language()

void set_language ( const language_def locale)

◆ set_min_translation_percent()

void set_min_translation_percent ( int  percent)

Definition at line 148 of file language.cpp.

Referenced by game_launcher::game_launcher().

◆ time_locale_correct()

bool& time_locale_correct ( )

Definition at line 66 of file language.cpp.

Referenced by set_language(), and wesnoth_setlocale().

Variable Documentation

◆ string_table

symbol_table string_table
extern