OpenTTD Source: src/language.h File Reference

OpenTTD Source 14.1

Data Structures | Typedefs | Functions | Variables
language.h File Reference
`#include <unicode/coll.h>`
`#include "strings_type.h"`
`#include <filesystem>`

Go to the source code of this file.

## Data Structures
struct | LanguagePackHeader
| Header of a language file. More...
struct | LanguageMetadata
| Make sure the size is right. More...

## Typedefs
typedef std::vector< LanguageMetadata > | LanguageList
| Type for the list of language meta data.

## Functions
bool | ReadLanguagePack (const LanguageMetadata *lang)
| Read a particular language. More...
const LanguageMetadata * | GetLanguage (byte newgrflangid)
| Get the language with the given NewGRF language ID. More...

## Variables
static const uint8_t | CASE_GENDER_LEN = 16
| The (maximum) length of a case/gender string.
static const uint8_t | MAX_NUM_GENDERS = 8
| Maximum number of supported genders.
static const uint8_t | MAX_NUM_CASES = 16
| Maximum number of supported cases.
LanguageList | _languages
| The actual list of language meta data.
const LanguageMetadata * | _current_language
| The currently loaded language.
std::unique_ptr< icu::Collator > | _current_collator
| Collator for the language currently in use.

## Detailed Description

Information about languages and their files.

Definition in file language.h.

## Function Documentation

## ◆ GetLanguage()

const LanguageMetadata* GetLanguage | ( | byte | newgrflangid | ) |

Get the language with the given NewGRF language ID.

Parameters

  newgrflangid | NewGRF languages ID to check.

Returns
  The language's metadata, or nullptr if it is not known.

Definition at line 2044 of file strings.cpp.

References _languages.

## ◆ ReadLanguagePack()

bool ReadLanguagePack | ( | const LanguageMetadata * | lang | ) |

Read a particular language.

Parameters

  lang | The metadata about the language.

Returns
  Whether the loading went okay or not.

Definition at line 1910 of file strings.cpp.

References LanguageMetadata::file, ReadFileToMem(), and TEXT_TAB_END.