"empty translation" does not mean "no translation"
this makes QCoreApplication::translate() consistent with QTranslator::translate(), and is semantically cleaner. users wishing to shrink their QM files can do that properly by using lrelease -removeidentical. Change-Id: I2b367314cfb985c3d130c7c6347e2742311f497a Reviewed-on: http://codereview.qt-project.org/5165 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
parent
37845c730d
commit
187ee8842b
3
dist/changes-5.0.0
vendored
3
dist/changes-5.0.0
vendored
@ -28,6 +28,9 @@ information about a particular change.
|
||||
preprocessor #define has also been removed. The build-key is obsolete
|
||||
and is no longer necessary.
|
||||
|
||||
- QCoreApplication::translate() will no longer return the source text when
|
||||
the translation is empty. Use lrelease -removeidentical for optimization.
|
||||
|
||||
****************************************************************************
|
||||
* General *
|
||||
****************************************************************************
|
||||
|
@ -1823,12 +1823,12 @@ QString QCoreApplication::translate(const char *context, const char *sourceText,
|
||||
for (it = self->d_func()->translators.constBegin(); it != self->d_func()->translators.constEnd(); ++it) {
|
||||
translationFile = *it;
|
||||
result = translationFile->translate(context, sourceText, disambiguation, n);
|
||||
if (!result.isEmpty())
|
||||
if (!result.isNull())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (result.isEmpty()) {
|
||||
if (result.isNull()) {
|
||||
#ifdef QT_NO_TEXTCODEC
|
||||
Q_UNUSED(encoding)
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user