40 #define g_L10n L10n::GetSingleton() 86 const icu::Locale& GetCurrentLocale()
const;
98 std::string GetCurrentLocaleString()
const;
112 std::vector<std::string> GetAllLocales()
const;
128 bool SaveLocale(
const std::string& localeCode)
const;
130 bool SaveLocale(
const icu::Locale& locale)
const;
149 std::vector<std::string> GetSupportedLocaleBaseNames()
const;
167 std::vector<std::wstring> GetSupportedLocaleDisplayNames()
const;
179 std::string GetLocaleLanguage(
const std::string& locale)
const;
189 std::string GetLocaleBaseName(
const std::string& locale)
const;
201 std::string GetLocaleCountry(
const std::string& locale)
const;
211 std::string GetLocaleScript(
const std::string& locale)
const;
220 bool UseLongStrings()
const;
230 std::vector<std::wstring> GetDictionariesForLocale(
const std::string& locale)
const;
232 std::wstring GetFallbackToAvailableDictLocale(
const icu::Locale& locale)
const;
234 std::wstring GetFallbackToAvailableDictLocale(
const std::string& locale)
const;
257 std::string GetDictionaryLocale(
const std::string& configLocaleString)
const;
280 void GetDictionaryLocale(
const std::string& configLocaleString, icu::Locale& outLocale)
const;
295 void ReevaluateCurrentLocaleAndReload();
311 bool ValidateLocale(
const icu::Locale& locale)
const;
313 bool ValidateLocale(
const std::string& localeCode)
const;
323 std::string Translate(
const std::string& sourceString)
const;
337 std::string TranslateWithContext(
const std::string& context,
const std::string& sourceString)
const;
355 std::string TranslatePlural(
const std::string& singularSourceString,
const std::string& pluralSourceString,
int number)
const;
376 std::string TranslatePluralWithContext(
const std::string& context,
const std::string& singularSourceString,
const std::string& pluralSourceString,
int number)
const;
390 std::string TranslateLines(
const std::string& sourceString)
const;
408 UDate ParseDateTime(
const std::string& dateTimeString,
const std::string& dateTimeFormat,
const icu::Locale& locale)
const;
424 std::string LocalizeDateTime(
const UDate dateTime,
const DateTimeType& type,
const icu::DateFormat::EStyle& style)
const;
442 std::string FormatMillisecondsIntoDateString(
const UDate milliseconds,
const std::string& formatString,
bool useLocalTimezone)
const;
452 std::string FormatDecimalNumberIntoString(
double number)
const;
524 bool m_CurrentLocaleIsOriginalGameLocale{
false};
532 bool m_UseLongStrings{
false};
549 void LoadDictionaryForCurrentLocale();
552 #endif // INCLUDED_L10N icu::Locale m_CurrentLocale
Locale that the game is currently using.
Definition: L10n.h:504
Both date and time.
Definition: L10n.h:73
Only date.
Definition: L10n.h:74
DateTimeType
Types of dates.
Definition: L10n.h:71
i64 Status
Error handling system.
Definition: status.h:169
std::vector< icu::Locale > m_AvailableLocales
Vector with the locales that the game supports.
Definition: L10n.h:515
std::unique_ptr< tinygettext::Dictionary > m_Dictionary
Dictionary that contains the translations for the current locale and the matching English strings...
Definition: L10n.h:490
A simple dictionary class that mimics gettext() behaviour.
Definition: dictionary.hpp:34
Singleton for internationalization and localization.
Definition: L10n.h:47
Template base class for singletons.
Definition: Singleton.h:33