summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptengine/translatable.js
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2010-04-12 14:55:37 (GMT)
committerKent Hansen <kent.hansen@nokia.com>2010-04-13 13:24:40 (GMT)
commit058ba4d19b296464f87504bdc2a2076ee1368e57 (patch)
treedf97586ad78a8402e25672eb5d187b1223160a44 /tests/auto/qscriptengine/translatable.js
parent70141f27e6151f7d7e635ef4ac99fb1f38a1f881 (diff)
downloadQt-058ba4d19b296464f87504bdc2a2076ee1368e57.zip
Qt-058ba4d19b296464f87504bdc2a2076ee1368e57.tar.gz
Qt-058ba4d19b296464f87504bdc2a2076ee1368e57.tar.bz2
Make qsTr work in global scope
Search up the call stack to find the first non-empty source URL. Also and add an autotest for the QtScript translator functions since there was none (their presence was checked, but not their behavior...). Task-number: QTBUG-9775 Reviewed-by: Olivier Goffart
Diffstat (limited to 'tests/auto/qscriptengine/translatable.js')
-rw-r--r--tests/auto/qscriptengine/translatable.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qscriptengine/translatable.js b/tests/auto/qscriptengine/translatable.js
new file mode 100644
index 0000000..0c948e7
--- /dev/null
+++ b/tests/auto/qscriptengine/translatable.js
@@ -0,0 +1,7 @@
+qsTr("One");
+qsTranslate("FooContext", "Two");
+
+var greeting_strings = [
+ QT_TR_NOOP("Hello"),
+ QT_TRANSLATE_NOOP("FooContext", "Goodbye")
+];