diff options
Diffstat (limited to 'tools/linguist/shared/translator.cpp')
-rw-r--r-- | tools/linguist/shared/translator.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index bc27daf..8a071d3 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -56,8 +56,18 @@ QT_BEGIN_NAMESPACE +#ifdef QT_BOOTSTRAPPED +QString QObject::tr(const char *sourceText, const char *, int n) +{ + QString ret = QString::fromLatin1(sourceText); + if (n >= 0) + ret.replace(QLatin1String("%n"), QString::number(n)); + return ret; +} +#endif + Translator::Translator() : - m_codecName("ISO-8859-1"), + m_codec(QTextCodec::codecForName("ISO-8859-1")), m_locationsType(AbsoluteLocations) { } @@ -703,12 +713,17 @@ void Translator::setCodecName(const QByteArray &name) if (!codec) { if (!name.isEmpty()) qWarning("No QTextCodec for %s available. Using Latin1\n", name.constData()); - m_codecName = "ISO-8859-1"; + m_codec = QTextCodec::codecForName("ISO-8859-1"); } else { - m_codecName = codec->name(); + m_codec = codec; } } +QByteArray Translator::codecName() const +{ + return m_codec->name(); +} + void Translator::dump() const { for (int i = 0; i != messageCount(); ++i) |