diff options
author | Lucie Gérard <lucie.gerard@qt.io> | 2023-10-10 15:33:48 +0200 |
---|---|---|
committer | Lucie Gérard <lucie.gerard@qt.io> | 2023-10-26 14:12:00 +0200 |
commit | d6e0d5630a49e9614a70bf960a213b3eff03a68e (patch) | |
tree | 1ecb2d4a5064328dfd4d55c27cdf87709470cef1 /tests/auto/qml/qqmltranslation/data | |
parent | 9187e07d36db8c262b51ba7d1ce35615b31ee918 (diff) |
Add pragma syntax to support translation context
Translator pragma can be used to set the translation context
instead of having the file name used
[ChangeLog][qml][translation][Important Behavior Changes] The context
for the translation can now be controled in a given file
using pragma Translator.
Task-number: QTBUG-114528
Change-Id: I6d9d7fb81ea969a90d8637d7277bdbe96c102088
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmltranslation/data')
-rw-r--r-- | tests/auto/qml/qqmltranslation/data/pragmacontext.qml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmltranslation/data/pragmacontext.qml b/tests/auto/qml/qqmltranslation/data/pragmacontext.qml new file mode 100644 index 0000000000..e158cfe4bf --- /dev/null +++ b/tests/auto/qml/qqmltranslation/data/pragmacontext.qml @@ -0,0 +1,8 @@ +import QtQml 2.12 + +pragma Translator: contextSetWithPragma + +QtObject { + property string german1: qsTr("English in translation") + property string german2: qsTranslate("setContext","English in translation") +} |