OpenTTD Source  20241108-master-g80f628063a
LanguagePackHeader Struct Reference

Header of a language file. More...

#include <language.h>

Inheritance diagram for LanguagePackHeader:
LanguageMetadata LanguagePack

Public Member Functions

bool IsValid () const
 Check whether the header is a valid header for OpenTTD. More...
 
bool IsReasonablyFinished () const
 Check whether a translation is sufficiently finished to offer it to the public.
 
uint8_t GetGenderIndex (const char *gender_str) const
 Get the index for the given gender. More...
 
uint8_t GetCaseIndex (const char *case_str) const
 Get the index for the given case. More...
 

Data Fields

uint32_t ident
 32-bits identifier
 
uint32_t version
 32-bits of auto generated version info which is basically a hash of strings.h
 
char name [32]
 the international name of this language
 
char own_name [32]
 the localized name of this language
 
char isocode [16]
 the ISO code for the language (not country code)
 
uint16_t offsets [TEXT_TAB_END]
 the offsets
 
char digit_group_separator [8]
 Thousand separator used for anything not currencies.
 
char digit_group_separator_currency [8]
 Thousand separator used for currencies.
 
char digit_decimal_separator [8]
 Decimal separator.
 
uint16_t missing
 number of missing strings.
 
uint8_t plural_form
 plural form index
 
uint8_t text_dir
 default direction of the text
 
uint16_t winlangid
 Windows language ID: Windows cannot and will not convert isocodes to something it can use to determine whether a font can be used for the language or not. More...
 
uint8_t newgrflangid
 newgrf language id
 
uint8_t num_genders
 the number of genders of this language
 
uint8_t num_cases
 the number of cases of this language
 
uint8_t pad [3]
 pad header to be a multiple of 4
 
char genders [MAX_NUM_GENDERS][CASE_GENDER_LEN]
 the genders used by this translation
 
char cases [MAX_NUM_CASES][CASE_GENDER_LEN]
 the cases used by this translation
 

Static Public Attributes

static const uint32_t IDENT = 0x474E414C
 Identifier for OpenTTD language files, big endian for "LANG".
 

Detailed Description

Header of a language file.

Definition at line 24 of file language.h.

Member Function Documentation

◆ GetCaseIndex()

uint8_t LanguagePackHeader::GetCaseIndex ( const char *  case_str) const
inline

Get the index for the given case.

Parameters
case_strThe string representation of the case.
Returns
The index of the case, or MAX_NUM_CASES when the case is unknown.

Definition at line 81 of file language.h.

References MAX_NUM_CASES.

◆ GetGenderIndex()

uint8_t LanguagePackHeader::GetGenderIndex ( const char *  gender_str) const
inline

Get the index for the given gender.

Parameters
gender_strThe string representation of the gender.
Returns
The index of the gender, or MAX_NUM_GENDERS when the gender is unknown.

Definition at line 68 of file language.h.

References MAX_NUM_GENDERS.

◆ IsValid()

bool LanguagePackHeader::IsValid ( ) const

Check whether the header is a valid header for OpenTTD.

Returns
true iff the header is deemed valid.

Definition at line 1881 of file strings.cpp.

References ident.

Referenced by GetLanguageFileHeader().

Field Documentation

◆ winlangid

uint16_t LanguagePackHeader::winlangid

Windows language ID: Windows cannot and will not convert isocodes to something it can use to determine whether a font can be used for the language or not.

As a result of that we need to pass the language id via strgen to OpenTTD to tell what language it is in "Windows". The ID is the 'locale identifier' on: http://msdn.microsoft.com/en-us/library/ms776294.aspx windows language id

Definition at line 51 of file language.h.

Referenced by UniscribeItemizeString().


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