diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2010-04-14 10:15:43 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2010-04-14 16:32:35 (GMT) |
commit | b84be32658f053a89e589ff66913213fb0d0b8e7 (patch) | |
tree | f0834202ac1cb0d0a003d65b734ecfc106f333b3 | |
parent | a3d6d4db2c12123873b809a9605b3ab50c740294 (diff) | |
download | Qt-b84be32658f053a89e589ff66913213fb0d0b8e7.zip Qt-b84be32658f053a89e589ff66913213fb0d0b8e7.tar.gz Qt-b84be32658f053a89e589ff66913213fb0d0b8e7.tar.bz2 |
QtScript: Add test for translation disambiguation
-rw-r--r-- | tests/auto/qscriptengine/translatable.js | 2 | ||||
-rw-r--r-- | tests/auto/qscriptengine/translations/translatable_la.qm | bin | 241 -> 315 bytes | |||
-rw-r--r-- | tests/auto/qscriptengine/translations/translatable_la.ts | 6 | ||||
-rw-r--r-- | tests/auto/qscriptengine/tst_qscriptengine.cpp | 2 |
4 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qscriptengine/translatable.js b/tests/auto/qscriptengine/translatable.js index 0c948e7..30e139a 100644 --- a/tests/auto/qscriptengine/translatable.js +++ b/tests/auto/qscriptengine/translatable.js @@ -5,3 +5,5 @@ var greeting_strings = [ QT_TR_NOOP("Hello"), QT_TRANSLATE_NOOP("FooContext", "Goodbye") ]; + +qsTr("One", "not the same one"); diff --git a/tests/auto/qscriptengine/translations/translatable_la.qm b/tests/auto/qscriptengine/translations/translatable_la.qm Binary files differindex 03fcc52..301cc77 100644 --- a/tests/auto/qscriptengine/translations/translatable_la.qm +++ b/tests/auto/qscriptengine/translations/translatable_la.qm diff --git a/tests/auto/qscriptengine/translations/translatable_la.ts b/tests/auto/qscriptengine/translations/translatable_la.ts index 3f631de..4eed72d 100644 --- a/tests/auto/qscriptengine/translations/translatable_la.ts +++ b/tests/auto/qscriptengine/translations/translatable_la.ts @@ -27,6 +27,12 @@ <translation>Hallo</translation> </message> <message> + <location filename="translatable.js" line="9"/> + <source>One</source> + <comment>not the same one</comment> + <translation>Enda en</translation> + </message> + <message> <source>Goodbye</source> <translation type="obsolete">Farvel</translation> </message> diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 674e502..aa06bc9 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -4345,6 +4345,8 @@ void tst_QScriptEngine::translateScript() QCOMPARE(engine.evaluate("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8')", fileName).toString(), QString::fromLatin1("Farvel")); + QCOMPARE(engine.evaluate("qsTr('One', 'not the same one')", fileName).toString(), QString::fromLatin1("Enda en")); + QVERIFY(engine.evaluate("QT_TR_NOOP()").isUndefined()); QCOMPARE(engine.evaluate("QT_TR_NOOP('One')").toString(), QString::fromLatin1("One")); |