diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg index 3d81e114f2..121d4a8ec0 100644 --- a/binaries/data/config/default.cfg +++ b/binaries/data/config/default.cfg @@ -332,6 +332,9 @@ profiler2.gpu.intel.enable = true ; Allow GL_INTEL_performance_queries ; > JS DEBUGGER jsdebugger.enable = false ; Enable Javascript debugging. The Debugger is currently broken and can't be enabled until the SpiderMonkey upgrade is done and the debugger is updated for the new API. +; > TINYGETTEXT DEBUGGING +tinygettext.debug = false ; Enable Tinygettext debugging information. If true, Tinygettext prints error messages each time that a translation for an English string is not found. + ; > QUICKSAVE hotkey.quicksave = "Shift+F5" hotkey.quickload = "Shift+F8" diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp index 1d1e0b7503..990613d329 100644 --- a/source/i18n/L10n.cpp +++ b/source/i18n/L10n.cpp @@ -45,6 +45,17 @@ L10n& L10n::Instance() L10n::L10n() : currentLocaleIsOriginalGameLocale(false), useLongStrings(false), dictionary(new tinygettext::Dictionary()) { + // Determine whether or not to print tinygettext messages to the standard + // error output, which it tinygettext’s default behavior, but not ours. + bool tinygettext_debug = false; + CFG_GET_VAL("tinygettext.debug", Bool, tinygettext_debug); + if (!tinygettext_debug) + { + tinygettext::Log::log_info_callback = 0; + tinygettext::Log::log_warning_callback = 0; + tinygettext::Log::log_error_callback = 0; + } + LoadListOfAvailableLocales(); ReevaluateCurrentLocaleAndReload(); } diff --git a/source/lib/external_libraries/tinygettext.h b/source/lib/external_libraries/tinygettext.h index 20df3fefa4..4130c7cf67 100644 --- a/source/lib/external_libraries/tinygettext.h +++ b/source/lib/external_libraries/tinygettext.h @@ -35,6 +35,7 @@ #include #include +#include #if MSC_VERSION # pragma warning(pop) diff --git a/source/third_party/tinygettext/src/log.cpp b/source/third_party/tinygettext/src/log.cpp index 68e7e440a4..a3c11d2b9f 100644 --- a/source/third_party/tinygettext/src/log.cpp +++ b/source/third_party/tinygettext/src/log.cpp @@ -29,7 +29,7 @@ Log::log_callback_t Log::log_error_callback = &Log::default_log_callback; void Log::default_log_callback(const std::string& str) { -// std::cerr << "tinygettext: " << str; + std::cerr << "tinygettext: " << str; } void