OpenTTD Source: GameStrings Struct Reference

OpenTTD Source 15.0-beta1

Public Member Functions | Data Fields
GameStrings Struct Reference

Container for all the game strings. More...

`#include <game_text.hpp>`

## Public Member Functions
void | Compile ()
| Compile the language.
| GameStrings (const GameStrings &)=delete
| GameStrings (GameStrings &&)=delete
GameStrings & | operator= (const GameStrings &)=delete
GameStrings & | operator= (GameStrings &&)=delete

## Data Fields
uint | version
| The version of the language strings.
LanguageStrings * | cur_language
| The current (compiled) language.
std::vector< LanguageStrings > | raw_strings
| The raw strings per language, first must be English/the master language!.
std::vector< LanguageStrings > | compiled_strings
| The compiled strings per language, first must be English/the master language!.
StringList | string_names
| The names of the compiled strings.
StringParamsList | string_params
| The parameters for the strings.

## Detailed Description

Container for all the game strings.

Definition at line 50 of file game_text.hpp.

## Member Function Documentation

## ◆ Compile()

void GameStrings::Compile | ( |  | ) |

Compile the language.

Definition at line 284 of file game_text.cpp.

References compiled_strings, StringData::FreeTranslation(), StringReader::ParseFile(), raw_strings, string_names, string_params, version, StringData::Version(), HeaderWriter::WriteHeader(), and LanguageWriter::WriteLang().

Referenced by GSTRChunkHandler::Load(), and LoadTranslations().

## Field Documentation

## ◆ compiled_strings

std::vector<LanguageStrings> GameStrings::compiled_strings

The compiled strings per language, first must be English/the master language!.

Definition at line 55 of file game_text.hpp.

Referenced by Compile(), and ReconsiderGameScriptLanguage().

## ◆ cur_language

LanguageStrings* GameStrings::cur_language

The current (compiled) language.

Definition at line 52 of file game_text.hpp.

Referenced by GetGameStringPtr(), and ReconsiderGameScriptLanguage().

## ◆ raw_strings

std::vector<LanguageStrings> GameStrings::raw_strings

The raw strings per language, first must be English/the master language!.

Definition at line 54 of file game_text.hpp.

Referenced by LanguageScanner::AddFile(), Compile(), GSTRChunkHandler::Load(), LoadTranslations(), and GSTRChunkHandler::Save().

## ◆ string_names

StringList GameStrings::string_names

The names of the compiled strings.

Definition at line 56 of file game_text.hpp.

Referenced by Compile(), GetGameStringName(), and RegisterGameTranslation().

## ◆ string_params

StringParamsList GameStrings::string_params

The parameters for the strings.

Definition at line 57 of file game_text.hpp.

Referenced by Compile(), and GetGameStringParams().

## ◆ version

uint GameStrings::version

The version of the language strings.

Definition at line 51 of file game_text.hpp.

Referenced by Compile().

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

- src/game/game_text.hpp
- src/game/game_text.cpp