Go to the documentation of this file.
14 #include <unicode/coll.h>
25 static const uint32_t
IDENT = 0x474E414C;
71 if (strcmp(gender_str, this->genders[i]) == 0)
return i;
84 if (strcmp(case_str, this->cases[i]) == 0)
return i;
94 std::filesystem::path
file;
@ TEXT_TAB_END
End of language files.
std::unique_ptr< icu::Collator > _current_collator
Collator for the language currently in use.
std::vector< LanguageMetadata > LanguageList
Type for the list of language meta data.
std::vector< NumberAbbreviation > NumberAbbreviations
Lookup for abbreviated formats for different powers of ten.
int64_t threshold
The threshold from which this abbreviation holds.
static const uint8_t MAX_NUM_CASES
Maximum number of supported cases.
std::optional< std::string > ParseNumberFormatSeparators(NumberFormatSeparators &separators, std::string_view format, size_t length=DIGITS_IN_UINT64_T)
Parse the NumberFormatSeparators out of the given format string, with the expected number of digits.
static const uint8_t MAX_NUM_GENDERS
Maximum number of supported genders.
const LanguageMetadata * _current_language
The currently loaded language.
Container for the power to abbreviation mapping for formatting short numbers.
NumberFormatSeparators format
Format separators to use for this specific power.
static const uint8_t CASE_GENDER_LEN
The (maximum) length of a case/gender string.
constexpr int DIGITS_IN_UINT64_T
The number digits available in a uint64_t.
const LanguageMetadata * GetLanguage(byte newgrflangid)
Get the language with the given NewGRF language ID.
LanguageList _languages
The actual list of language meta data.
std::optional< std::string > ParseNumberAbbreviations(NumberAbbreviations &abbreviations, std::string_view input)
Parse the NumberAbbreviations out of the given input string.
bool ReadLanguagePack(const LanguageMetadata *lang)
Read a particular language.
std::array< std::string, DIGITS_IN_UINT64_T > NumberFormatSeparators
Table with the text to place after each of the digits of a number.