PDA

View Full Version : Turn off translation/Unicode?



squidge
12th October 2009, 09:59
Is this possible? For some projects we'll never translate any of the internal strings, and so not bother with unicode either. So QApplication::translate(x,x,x,QApplication::Unicod eUTF8) seems a little redundant. Is it possible to disable these?

axeljaeger
15th October 2009, 15:21
What is the problem you are trying to solve?

squidge
15th October 2009, 17:49
Further down the line when I need to squash the file as much as possible, I'd like to disable unicode, but I'm guessing thats going to be difficult with the designer creating such source code.

axeljaeger
15th October 2009, 17:54
See which features can be disabled in qfeatures.h and qconfig.h.

But I doubt that unicode is in one of these because it is a real core feature.

squidge
15th October 2009, 20:08
[oops, please delete]

squidge
15th October 2009, 20:08
According to the code, it can be disabled, and its seems configurable as to how featureless(featurefull?) you want it to be:



#ifdef QT_NO_TRANSLATION
// Simple versions
inline QString QCoreApplication::translate(const char *, const char *sourceText,
const char *, Encoding encoding)
{
#ifndef QT_NO_TEXTCODEC
if (encoding == UnicodeUTF8)
return QString::fromUtf8(sourceText);
#else
Q_UNUSED(encoding)
#endif
return QString::fromLatin1(sourceText);
}


But, looking at that, it'll just return whatever you pass into it, so maybe it'll "just work" after all.