The Battle for Wesnoth  1.19.27+dev
Public Member Functions | Public Attributes | List of all members
language_def Struct Reference

#include <language.hpp>

Public Member Functions

 language_def ()
 Creates the 'System Default Language' definition. More...
 
 language_def (const config &cfg)
 
bool operator== (const language_def &) const
 
bool operator< (const language_def &a) const
 
std::string short_localename () const
 

Public Attributes

std::string localename
 
std::vector< std::string > alternates
 
std::string windows_locale
 Windows has no knowledge of most POSIX locale IDs, so on that platform the OS-level setlocale() call (LC_COLLATE/LC_TIME only) uses these instead. More...
 
std::vector< std::string > windows_alternates
 
t_string language
 
std::string sort_name
 
bool rtl = false
 A right to left language? (e.g: Hebrew) More...
 
int percent = 100
 % of translated text in core po-s More...
 

Detailed Description

Definition at line 25 of file language.hpp.

Constructor & Destructor Documentation

◆ language_def() [1/2]

language_def::language_def ( )

Creates the 'System Default Language' definition.

Definition at line 114 of file language.cpp.

◆ language_def() [2/2]

language_def::language_def ( const config cfg)
explicit

Definition at line 120 of file language.cpp.

References alternates, language, and localename.

Member Function Documentation

◆ operator<()

bool language_def::operator< ( const language_def a) const
inline

Definition at line 55 of file language.hpp.

References sort_name.

◆ operator==()

bool language_def::operator== ( const language_def a) const

Definition at line 61 of file language.cpp.

References language.

◆ short_localename()

std::string language_def::short_localename ( ) const

Definition at line 66 of file language.cpp.

References utf8::index(), and localename.

Referenced by gui2::dialogs::game_version::show_manual().

Member Data Documentation

◆ alternates

std::vector<std::string> language_def::alternates

Definition at line 33 of file language.hpp.

Referenced by language_def(), and set_language().

◆ language

t_string language_def::language

Definition at line 45 of file language.hpp.

Referenced by language_def(), and operator==().

◆ localename

std::string language_def::localename

◆ percent

int language_def::percent = 100

% of translated text in core po-s

Definition at line 52 of file language.hpp.

◆ rtl

bool language_def::rtl = false

A right to left language? (e.g: Hebrew)

Definition at line 49 of file language.hpp.

◆ sort_name

std::string language_def::sort_name

Definition at line 46 of file language.hpp.

Referenced by operator<().

◆ windows_alternates

std::vector<std::string> language_def::windows_alternates

Definition at line 43 of file language.hpp.

Referenced by set_language().

◆ windows_locale

std::string language_def::windows_locale

Windows has no knowledge of most POSIX locale IDs, so on that platform the OS-level setlocale() call (LC_COLLATE/LC_TIME only) uses these instead.

Everything else — translation catalogue look-up, preferences saving, language_selection matching — always uses localename/alternates above, so languages with no real Windows locale don't collide with each other or lose their translations.

Definition at line 42 of file language.hpp.

Referenced by set_language().


The documentation for this struct was generated from the following files: