Translations: Remove unnecessary warning regarding string length

This commit is contained in:
Ty Lamontagne 2021-06-29 12:55:24 -04:00 committed by lightningterror
parent e3d6e50ba0
commit fbffa1c7bc
2 changed files with 5 additions and 18 deletions

View File

@ -263,7 +263,7 @@ static const s64 _4gb = _1gb * 4;
#define pxE_dev(english) pxExpandMsg((english)) #define pxE_dev(english) pxExpandMsg((english))
extern const wxChar *__fastcall pxExpandMsg(const wxChar *englishContent); extern const wxChar *__fastcall pxExpandMsg(const wxChar *message);
extern const wxChar *__fastcall pxGetTranslation(const wxChar *message); extern const wxChar *__fastcall pxGetTranslation(const wxChar *message);
extern bool pxIsEnglish(int id); extern bool pxIsEnglish(int id);

View File

@ -24,25 +24,12 @@ bool pxIsEnglish(int id)
// pxExpandMsg -- an Iconized Text Translator // pxExpandMsg -- an Iconized Text Translator
// Was replaced by a standard implementation of wxGetTranslation // Was replaced by a standard implementation of wxGetTranslation
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
const wxChar *__fastcall pxExpandMsg(const wxChar *englishContent) const wxChar *__fastcall pxExpandMsg(const wxChar *message)
{
return wxGetTranslation(message).wc_str();
}
const wxChar *__fastcall pxGetTranslation(const wxChar *message)
{ {
return wxGetTranslation(englishContent).wc_str();
}
// ------------------------------------------------------------------------
// Alternative implementation for wxGetTranslation.
// This version performs a string length check in devel builds, which issues a warning
// if the string seems too long for gettext lookups. Longer complicated strings should
// usually be implemented used the pxMsgExpand system instead.
//
const wxChar *__fastcall pxGetTranslation(const wxChar *message)
{
if (IsDevBuild) {
if (wxStrlen(message) > 128) {
Console.Warning("pxGetTranslation: Long message detected, maybe use pxE() instead?");
Console.WriteLn(Color_Green, L"Message: %s", message);
}
}
return wxGetTranslation(message).wc_str(); return wxGetTranslation(message).wc_str();
} }