summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlocale
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-02-18 16:58:47 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-02-23 14:16:49 (GMT)
commit81fe6eac7530ad508bf54e7996cbdc9e2f0cb5d1 (patch)
treed7f2d2163f2bc1170d805da928728a1bfdf37d44 /tests/auto/qlocale
parent400195768909f52dee30abff59dd9a5e03ea63dc (diff)
downloadQt-81fe6eac7530ad508bf54e7996cbdc9e2f0cb5d1.zip
Qt-81fe6eac7530ad508bf54e7996cbdc9e2f0cb5d1.tar.gz
Qt-81fe6eac7530ad508bf54e7996cbdc9e2f0cb5d1.tar.bz2
Added UI languages property to QLocale
The return value is a sorted list of locale names that could be used for presenting data to the user (i.e. for translations). Task-number: QTBUG-7329 Reviewed-by: Zeno Albisser
Diffstat (limited to 'tests/auto/qlocale')
-rw-r--r--tests/auto/qlocale/tst_qlocale.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qlocale/tst_qlocale.cpp b/tests/auto/qlocale/tst_qlocale.cpp
index 250aac9..878a31e 100644
--- a/tests/auto/qlocale/tst_qlocale.cpp
+++ b/tests/auto/qlocale/tst_qlocale.cpp
@@ -142,6 +142,7 @@ private slots:
void ampm();
void currency();
void quoteString();
+ void uiLanguages();
private:
QString m_decimal, m_thousand, m_sdate, m_ldate, m_time;
@@ -2169,5 +2170,20 @@ void tst_QLocale::quoteString()
}
+void tst_QLocale::uiLanguages()
+{
+ const QLocale c(QLocale::C);
+ QCOMPARE(c.uiLanguages().size(), 1);
+ QCOMPARE(c.uiLanguages().at(0), QLatin1String("C"));
+
+ const QLocale en_US("en_US");
+ QCOMPARE(en_US.uiLanguages().size(), 1);
+ QCOMPARE(en_US.uiLanguages().at(0), QLatin1String("en_US"));
+
+ const QLocale ru_RU("ru_RU");
+ QCOMPARE(ru_RU.uiLanguages().size(), 1);
+ QCOMPARE(ru_RU.uiLanguages().at(0), QLatin1String("ru_RU"));
+}
+
QTEST_APPLESS_MAIN(tst_QLocale)
#include "tst_qlocale.moc"