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 /src/qml/compiler/qv4compiler.cpp | |
| 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 'src/qml/compiler/qv4compiler.cpp')
| -rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 34c62cc992..7a7c8f621b 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -682,6 +682,10 @@ QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Comp unit.translationTableSize = translations.size(); unit.offsetToTranslationTable = nextOffset; nextOffset += unit.translationTableSize * sizeof(CompiledData::TranslationData); + if (unit.translationTableSize != 0) { + constexpr auto spaceForTranslationContextId = sizeof(quint32_le); + nextOffset += spaceForTranslationContextId; + } nextOffset = static_cast<quint32>(QtPrivate::roundUpToMultipleOf(8, nextOffset)); |
