OpenTTD Source 20241224-master-gee860a5c8e
LangString Struct Reference

Information about a single string. More...

#include <strgen.h>

Public Member Functions

 LangString (const std::string &name, const std::string &english, size_t index, int line)
 Create a new string.
 
void FreeTranslation ()
 Free all data related to the translation.
 

Data Fields

std::string name
 Name of the string.
 
std::string english
 English text.
 
std::string translated
 Translated text.
 
size_t index
 The index in the language file.
 
int line
 Line of string in source-file.
 
std::vector< Casetranslated_cases
 Cases of the translation.
 

Detailed Description

Information about a single string.

Definition at line 28 of file strgen.h.

Constructor & Destructor Documentation

◆ LangString()

LangString::LangString ( const std::string &  name,
const std::string &  english,
size_t  index,
int  line 
)

Create a new string.

Parameters
nameThe name of the string.
englishThe english "translation" of the string.
indexThe index in the string table.
lineThe line this string was found on.

Definition at line 53 of file strgen_base.cpp.

Member Function Documentation

◆ FreeTranslation()

void LangString::FreeTranslation ( )

Free all data related to the translation.

Definition at line 59 of file strgen_base.cpp.

References translated, and translated_cases.

Referenced by StringData::FreeTranslation().

Field Documentation

◆ english

std::string LangString::english

English text.

Definition at line 30 of file strgen.h.

Referenced by StringData::Version(), and LanguageWriter::WriteLang().

◆ index

size_t LangString::index

The index in the language file.

Definition at line 32 of file strgen.h.

◆ line

int LangString::line

Line of string in source-file.

Definition at line 33 of file strgen.h.

Referenced by LanguageWriter::WriteLang().

◆ name

std::string LangString::name

Name of the string.

Definition at line 29 of file strgen.h.

Referenced by StringData::Version(), and LanguageWriter::WriteLang().

◆ translated

std::string LangString::translated

Translated text.

Definition at line 31 of file strgen.h.

Referenced by FreeTranslation(), and LanguageWriter::WriteLang().

◆ translated_cases

std::vector<Case> LangString::translated_cases

Cases of the translation.

Definition at line 34 of file strgen.h.

Referenced by FreeTranslation(), and LanguageWriter::WriteLang().


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