diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-03 13:28:16 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-06 13:54:42 +0200 |
commit | 20d73ef1bf23569b09ca862f6c5e5971098613d6 (patch) | |
tree | 88f3aa79ab7827281b3e244ad18c10397f3e2f72 /tests/auto/linguist/lrelease/tst_lrelease.cpp | |
parent | e446729d99bebaf7fac0110fcf22fc867d7229cb (diff) | |
download | qt4-tools-20d73ef1bf23569b09ca862f6c5e5971098613d6.tar.gz |
support for id-based translations
unlike in an earlier attempt, ids are textual this time.
the developer is able to provide a template for the string. when lupdate
and lrelease are integrated into the build process, this makes it
possible to avoid a round-trip to a dedicated string designer during the
early development stage.
Requirement-id: QT-435
Diffstat (limited to 'tests/auto/linguist/lrelease/tst_lrelease.cpp')
-rw-r--r-- | tests/auto/linguist/lrelease/tst_lrelease.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/linguist/lrelease/tst_lrelease.cpp b/tests/auto/linguist/lrelease/tst_lrelease.cpp index 512987d770..ff90b3cc2d 100644 --- a/tests/auto/linguist/lrelease/tst_lrelease.cpp +++ b/tests/auto/linguist/lrelease/tst_lrelease.cpp @@ -55,6 +55,7 @@ private slots: void translate(); void mixedcodecs(); void compressed(); + void idbased(); void dupes(); private: @@ -191,6 +192,18 @@ void tst_lrelease::compressed() } +void tst_lrelease::idbased() +{ + QVERIFY(!QProcess::execute("lrelease -idbased testdata/idbased.ts")); + + QTranslator translator; + QVERIFY(translator.load("testdata/idbased.qm")); + qApp->installTranslator(&translator); + + QCOMPARE(qtTrId("test_id"), QString::fromAscii("This is a test string.")); + QCOMPARE(qtTrId("untranslated_id"), QString::fromAscii("This has no translation.")); +} + void tst_lrelease::dupes() { QProcess proc; |