Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/i18n/L10n.cpp
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | icu::DateFormat* CreateDateTimeInstance(const L10n::DateTimeType& type, const icu::DateFormat::EStyle& style, const icu::Locale& locale) | ||||
case L10n::DateTime: | case L10n::DateTime: | ||||
default: | default: | ||||
return icu::SimpleDateFormat::createDateTimeInstance(style, style, locale); | return icu::SimpleDateFormat::createDateTimeInstance(style, style, locale); | ||||
} | } | ||||
} | } | ||||
} // anonymous namespace | } // anonymous namespace | ||||
void L10n::DictionaryDeleter::operator()(tinygettext::Dictionary* dictionary) | |||||
{ | |||||
delete dictionary; | |||||
} | |||||
L10n::L10n() | L10n::L10n() | ||||
: m_Dictionary(new tinygettext::Dictionary()) | : m_Dictionary(std::make_unique<tinygettext::Dictionary>()) | ||||
{ | { | ||||
// Determine whether or not to print tinygettext messages to the standard | // Determine whether or not to print tinygettext messages to the standard | ||||
// error output, which it tinygettext's default behavior, but not ours. | // error output, which it tinygettext's default behavior, but not ours. | ||||
bool tinygettext_debug = false; | bool tinygettext_debug = false; | ||||
CFG_GET_VAL("tinygettext.debug", tinygettext_debug); | CFG_GET_VAL("tinygettext.debug", tinygettext_debug); | ||||
if (!tinygettext_debug) | if (!tinygettext_debug) | ||||
{ | { | ||||
tinygettext::Log::log_info_callback = 0; | tinygettext::Log::log_info_callback = 0; | ||||
▲ Show 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | Status L10n::ReloadChangedFile(const VfsPath& path) | ||||
if (g_GUI) | if (g_GUI) | ||||
g_GUI->ReloadAllPages(); | g_GUI->ReloadAllPages(); | ||||
return INFO::OK; | return INFO::OK; | ||||
} | } | ||||
void L10n::LoadDictionaryForCurrentLocale() | void L10n::LoadDictionaryForCurrentLocale() | ||||
{ | { | ||||
m_Dictionary.reset(new tinygettext::Dictionary()); | m_Dictionary = std::make_unique<tinygettext::Dictionary>(); | ||||
VfsPaths filenames; | VfsPaths filenames; | ||||
if (m_UseLongStrings) | if (m_UseLongStrings) | ||||
{ | { | ||||
if (vfs::GetPathnames(g_VFS, L"l10n/", L"long.*.po", filenames) < 0) | if (vfs::GetPathnames(g_VFS, L"l10n/", L"long.*.po", filenames) < 0) | ||||
return; | return; | ||||
} | } | ||||
else | else | ||||
Show All 17 Lines |
Wildfire Games · Phabricator