Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
anonymous_namespace{L10n.cpp} Namespace Reference

Functions

std::vector< icu::Locale > LoadListOfAvailableLocales ()
 Determines the list of locales that the game supports. More...
 
Status ReloadChangedFileCB (void *param, const VfsPath &path)
 
void ReadPoIntoDictionary (const std::string &poContent, tinygettext::Dictionary *dictionary)
 Loads the specified content of a PO file into the specified dictionary. More...
 
std::unique_ptr< icu::DateFormat > CreateDateTimeInstance (const L10n::DateTimeType &type, const icu::DateFormat::EStyle &style, const icu::Locale &locale)
 Creates an ICU date formatted with the specified settings. More...
 

Function Documentation

◆ CreateDateTimeInstance()

std::unique_ptr< icu::DateFormat > anonymous_namespace{L10n.cpp}::CreateDateTimeInstance ( const L10n::DateTimeType type,
const icu::DateFormat::EStyle &  style,
const icu::Locale &  locale 
)

Creates an ICU date formatted with the specified settings.

Parameters
typeWhether formatted dates must show both the date and the time, only the date or only the time.
styleICU style to format dates by default.
localeLocale that the date formatter should use to parse strings. It has no relevance for date formatting, only matters for date parsing.
Returns
ICU date formatter.

◆ LoadListOfAvailableLocales()

std::vector< icu::Locale > anonymous_namespace{L10n.cpp}::LoadListOfAvailableLocales ( )

Determines the list of locales that the game supports.

LoadListOfAvailableLocales() checks the locale codes of the translation files in the 'l10n' folder of the virtual filesystem. If it finds a translation file prefixed with a locale code followed by a dot, it determines that the game supports that locale.

◆ ReadPoIntoDictionary()

void anonymous_namespace{L10n.cpp}::ReadPoIntoDictionary ( const std::string &  poContent,
tinygettext::Dictionary *  dictionary 
)

Loads the specified content of a PO file into the specified dictionary.

Used by LoadDictionaryForCurrentLocale() to add entries to the game translations poContent Content of a PO file as a string. dictionary Dictionary where the entries from the PO file should be stored.

◆ ReloadChangedFileCB()

Status anonymous_namespace{L10n.cpp}::ReloadChangedFileCB ( void *  param,
const VfsPath path 
)