Skip to content

Commit

Permalink
Tests: fix ft_locales:testBug169305
Browse files Browse the repository at this point in the history
Without specifying context the string is not translated.
  • Loading branch information
martyone authored and pvuorela committed Oct 7, 2014
1 parent 95a5e84 commit 1e846fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/ft_locales/ft_locales.cpp
Expand Up @@ -79,25 +79,25 @@ void Ft_Locales::testBug169305()
MLocale locale0("en_US@layout-direction=auto");
locale0.installTrCatalog("foo");
MLocale::setDefault(locale0);
QCOMPARE(QObject::tr("QT_LAYOUT_DIRECTION"), QString("LTR"));
QCOMPARE(QCoreApplication::translate("QApplication", "QT_LAYOUT_DIRECTION"), QString("LTR"));
QCOMPARE(qApp->layoutDirection(), Qt::LeftToRight);
MLocale locale1("ar_SA@layout-direction=auto");
locale1.installTrCatalog("foo");
MLocale::setDefault(locale1);
QCOMPARE(QObject::tr("QT_LAYOUT_DIRECTION"), QString("RTL"));
QCOMPARE(QCoreApplication::translate("QApplication", "QT_LAYOUT_DIRECTION"), QString("RTL"));
QCOMPARE(qApp->layoutDirection(), Qt::RightToLeft);
MLocale locale2;
QCOMPARE(locale2.name(), QString("ar_SA@layout-direction=auto"));
locale2.installTrCatalog("foo");
MLocale::setDefault(locale2);
QCOMPARE(QObject::tr("QT_LAYOUT_DIRECTION"), QString("RTL"));
QCOMPARE(QCoreApplication::translate("QApplication", "QT_LAYOUT_DIRECTION"), QString("RTL"));
QCoreApplication::processEvents();
QCOMPARE(QObject::tr("QT_LAYOUT_DIRECTION"), QString("RTL"));
QCOMPARE(QCoreApplication::translate("QApplication", "QT_LAYOUT_DIRECTION"), QString("RTL"));
QCOMPARE(qApp->layoutDirection(), Qt::RightToLeft);
MLocale::setDefault(locale0);
QCOMPARE(QObject::tr("QT_LAYOUT_DIRECTION"), QString("LTR"));
QCOMPARE(QCoreApplication::translate("QApplication", "QT_LAYOUT_DIRECTION"), QString("LTR"));
QCoreApplication::processEvents();
QCOMPARE(QObject::tr("QT_LAYOUT_DIRECTION"), QString("LTR"));
QCOMPARE(QCoreApplication::translate("QApplication", "QT_LAYOUT_DIRECTION"), QString("LTR"));
QCOMPARE(qApp->layoutDirection(), Qt::LeftToRight);
}

Expand Down

0 comments on commit 1e846fc

Please sign in to comment.