OpenTTD Source 20241224-master-gf74b0cf984
|
Information about languages and their files. More...
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. | |
const LanguageMetadata * | GetLanguage (uint8_t newgrflangid) |
Get the language with the given NewGRF language ID. | |
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. | |
Information about languages and their files.
Definition in file language.h.
typedef std::vector<LanguageMetadata> LanguageList |
Type for the list of language meta data.
Definition at line 98 of file language.h.
const LanguageMetadata * GetLanguage | ( | uint8_t | newgrflangid | ) |
Get the language with the given NewGRF language ID.
newgrflangid | NewGRF languages ID to check. |
Definition at line 2072 of file strings.cpp.
References _languages.
Referenced by FillLanguageList(), and GlobalVarChangeInfo().
bool ReadLanguagePack | ( | const LanguageMetadata * | lang | ) |
Read a particular language.
lang | The metadata about the language. |
Definition at line 1937 of file strings.cpp.
References _config_language_file, _current_collator, _current_language, _current_text_dir, BuildContentTypeStringList(), BuildIndustriesLegend(), LanguageMetadata::file, FS2OTTD(), GetString(), Layouter::Initialize(), InitializeSortedCargoSpecs(), InvalidateWindowClassesData(), LanguagePackHeader::isocode, LoadedLanguagePack::langtab_num, LoadedLanguagePack::langtab_start, LoadedLanguagePack::list_separator, MacOSSetCurrentLocaleName(), LanguagePackHeader::newgrflangid, ReadFileToMem(), ReconsiderGameScriptLanguage(), SetCurrentGrfLangID(), SortIndustryTypes(), TAB_SIZE, LanguagePackHeader::text_dir, TEXT_TAB_END, WC_AIRCRAFT_LIST, WC_BUILD_VEHICLE, WC_INDUSTRY_DIRECTORY, WC_ROADVEH_LIST, WC_SHIPS_LIST, WC_STATION_LIST, and WC_TRAINS_LIST.
Referenced by InitializeLanguagePacks(), and GameOptionsWindow::OnDropdownSelect().
|
extern |
Collator for the language currently in use.
Definition at line 59 of file strings.cpp.
Referenced by ICUStringContains(), ReadLanguagePack(), and StrNaturalCompare().
|
extern |
The currently loaded language.
Definition at line 54 of file strings.cpp.
Referenced by GameOptionsWindow::BuildDropDownList(), SelectGameWindow::DrawWidget(), UnmappedChoiceList::Flush(), ICUParagraphLayoutFactory::InitializeLayouter(), SelectGameWindow::OnInit(), SelectGameWindow::OnResize(), ReadLanguagePack(), ReconsiderGameScriptLanguage(), GameOptionsWindow::SetStringParameters(), ICURun::Shape(), SurveyConfiguration(), and UniscribeItemizeString().
|
extern |
The actual list of language meta data.
Definition at line 53 of file strings.cpp.
Referenced by GameOptionsWindow::BuildDropDownList(), FillLanguageList(), GetLanguage(), InitializeLanguagePacks(), and GameOptionsWindow::OnDropdownSelect().
|
static |
The (maximum) length of a case/gender string.
Definition at line 19 of file language.h.
|
static |
Maximum number of supported cases.
Definition at line 21 of file language.h.
Referenced by LanguagePackHeader::GetCaseIndex(), GlobalVarChangeInfo(), FileStringReader::HandlePragma(), and LanguagePackHeader::IsValid().
|
static |
Maximum number of supported genders.
Definition at line 20 of file language.h.
Referenced by LanguagePackHeader::GetGenderIndex(), GlobalVarChangeInfo(), FileStringReader::HandlePragma(), and LanguagePackHeader::IsValid().