[Scummvm-devel] Translations and OSystem::logMessage()
criezy at scummvm.org
Thu Aug 8 00:34:19 CEST 2013
OSystem::logMessage() doesn't work well with non-ASCII messages, at least for the stdout/stderr part (for the part where it writes in a file if the system uses the correct encoding to open the file it should be OK I suppose, although on Windows I am not convinced the conversion to UTF).
Currently we do use the TranslationManager to translate messages that are passed to logMessage(). This is the case for example in AdvancedMetaEngine::reportUnknown(). That leads to messages were the non-ASCII characters are messed up (and I have seen reports on the tracker with such messed up messages, e.g. http://sourceforge.net/tracker/?func=detail&aid=3611492&group_id=37116&atid=418820).
So that lead me to a question: Should we limit the use of the TranslationManager to messages that are displayed in our GUI?
My answer to that would be yes as I thing messages that are important and that we want to be translated should be displayed in our GUI anyway. If there is a consensus for that I will remove use of the TranslationsManager for messages that are not displayed in our GUI.
In the case of this reportUnknown() though I am wondering if we should not display it both untranslated in logMessage() and translated in a GUI dialog, and since we have OSystem::displayLogFile() and kFeatureDisplayLogFile we could have a button to open the log in that dialog on systems that support it (I would prefer a button to copy to clipboard but that would require adding that to OSystem and at least the SDL backend).
More information about the Scummvm-devel