Changeset View
Changeset View
Standalone View
Standalone View
source/i18n/scripting/JSInterface_L10n.cpp
Show All 18 Lines | |||||
#include "JSInterface_L10n.h" | #include "JSInterface_L10n.h" | ||||
#include "i18n/L10n.h" | #include "i18n/L10n.h" | ||||
#include "lib/utf8.h" | #include "lib/utf8.h" | ||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
// TODO: country-code to language name | |||||
// Returns a translation of the specified English string into the current language. | // Returns a translation of the specified English string into the current language. | ||||
std::wstring JSI_L10n::Translate(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& sourceString) | std::wstring JSI_L10n::Translate(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& sourceString) | ||||
{ | { | ||||
return wstring_from_utf8(g_L10n.Translate(utf8_from_wstring(sourceString))); | return wstring_from_utf8(g_L10n.Translate(utf8_from_wstring(sourceString))); | ||||
} | } | ||||
// Returns a translation of the specified English string, for the specified context. | // Returns a translation of the specified English string, for the specified context. | ||||
std::wstring JSI_L10n::TranslateWithContext(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& context, const std::wstring& sourceString) | std::wstring JSI_L10n::TranslateWithContext(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& context, const std::wstring& sourceString) | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator