OpenTTD
Data Structures | Typedefs | Functions | Variables
language.h File Reference

Information about languages and their files. More...

#include "core/smallvec_type.hpp"
#include <unicode/coll.h>

Go to the source code of this file.

Data Structures

struct  LanguagePackHeader
 Header of a language file. More...
struct  LanguageMetadata
 Metadata about a single language. More...

Typedefs

typedef SmallVector
< LanguageMetadata, 4 > 
LanguageList
 Type for the list of language meta data.

Functions

 assert_compile (sizeof(LanguagePackHeader)%4==0)
 Make sure the size is right.
bool ReadLanguagePack (const LanguageMetadata *lang)
 Read a particular language.
const LanguageMetadataGetLanguage (byte newgrflangid)
 Get the language with the given NewGRF language ID.

Variables

static const uint8 CASE_GENDER_LEN = 16
 The (maximum) length of a case/gender string.
static const uint8 MAX_NUM_GENDERS = 8
 Maximum number of supported genders.
static const uint8 MAX_NUM_CASES = 16
 Maximum number of supported cases.
static const uint TAB_SIZE_OFFSET = 0
 The offset for the tab size.
static const uint TAB_SIZE_BITS = 11
 The number of bits used for the tab size.
static const uint TAB_SIZE = 1 << TAB_SIZE_BITS
 The number of values in a tab.
static const uint TAB_COUNT_OFFSET = TAB_SIZE_BITS
 The offset for the tab count.
static const uint TAB_COUNT_BITS = 5
 The number of bits used for the amount of tabs.
static const uint TAB_COUNT = 1 << TAB_COUNT_BITS
 The amount of tabs.
LanguageList _languages
 The actual list of language meta data.
const LanguageMetadata_current_language
 The currently loaded language.
Collator * _current_collator
 Collator for the language currently in use.

Detailed Description

Information about languages and their files.

Definition in file language.h.

Typedef Documentation

Type for the list of language meta data.

Definition at line 105 of file language.h.

Function Documentation

assert_compile ( sizeof(LanguagePackHeader)%  4 = =0)

Make sure the size is right.

const LanguageMetadata* GetLanguage ( byte  newgrflangid)

Get the language with the given NewGRF language ID.

Parameters
newgrflangidNewGRF languages ID to check.
Returns
The language's metadata, or NULL if it is not known.

Definition at line 1881 of file strings.cpp.

References SmallVector< T, S >::Begin(), and SmallVector< T, S >::End().

Referenced by GetLanguageList(), and GlobalVarChangeInfo().

bool ReadLanguagePack ( const LanguageMetadata lang)

Variable Documentation

const LanguageMetadata* _current_language
LanguageList _languages

The actual list of language meta data.

Definition at line 49 of file strings.cpp.

Referenced by GameOptionsWindow::BuildDropDownList(), and GameOptionsWindow::OnDropdownSelect().