QmlJS: Tr::Tr

Excluding the Qml parser, which needs to remain in sync with it's copy
in Qt.

Change-Id: I22f475f265dd74687e3239c4d6916c777798a447
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-01-24 14:39:05 +01:00
parent fc8b81f2cb
commit 17b28909a9
29 changed files with 276 additions and 577 deletions

View File

@@ -21332,7 +21332,7 @@ should a repository require SSH-authentication (see documentation on SSH and the
</message>
</context>
<context>
<name>QmlJS::Check</name>
<name>::QmlJS</name>
<message>
<source>unknown value for enum</source>
<translation type="obsolete">Neznámá hodnota pro &apos;enum&apos;</translation>
@@ -21529,9 +21529,6 @@ should a repository require SSH-authentication (see documentation on SSH and the
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;int&apos; nebo &apos;real&apos;</translation>
</message>
</context>
<context>
<name>QmlJS::Interpreter::QmlXmlReader</name>
<message>
<source>The file is not module file.</source>
<translation type="obsolete">Soubor není souborem modulu.</translation>
@@ -21552,21 +21549,10 @@ should a repository require SSH-authentication (see documentation on SSH and the
<source>%1: %2</source>
<translation type="obsolete">%1: %2</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>could not find file or directory</source>
<translation type="obsolete">Soubor nebo adresář se nepodařilo najít</translation>
</message>
<message>
<source>expected two numbers separated by a dot</source>
<translation type="obsolete">Byla očekávána dvě čísla oddělená čárkou</translation>
</message>
<message>
<source>package import requires a version number</source>
<translation type="obsolete">Zavedení balíčku vyžaduje číslo verze</translation>
</message>
<message>
<source>package not found</source>
<translation type="obsolete">Balíček nenalezen</translation>
@@ -29056,7 +29042,7 @@ With cache simulation, further event counters are enabled:
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation>Byla očekávána dvě čísla oddělená čárkou</translation>
@@ -29065,13 +29051,6 @@ With cache simulation, further event counters are enabled:
<source>package import requires a version number</source>
<translation>Importování balíčku vyžaduje číslo verze</translation>
</message>
<message>
<source>file or directory not found</source>
<translation type="obsolete">Soubor nebo adresář nenalezen</translation>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -38559,7 +38538,7 @@ Pokud zvolíte nepokračovat, Qt Creator se soubor .shared nahrát nepokusí.</t
</message>
</context>
<context>
<name>FindExportedCppTypes</name>
<name>::QmlJS</name>
<message>
<source>The type will only be available in Qt Creator&apos;s QML editors when the type name is a string literal</source>
<translation type="obsolete">Tento typ bude v editoru QML Qt Creatoru viditelný jen tehdy, když je název typu řetězec znaků tvořený písmeny (literal)</translation>
@@ -49414,19 +49393,11 @@ nelze najít v cestě.</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation>Nelze najít soubor %1.</translation>
</message>
<message>
<source>Could not parse document.</source>
<translation>Nepodařilo se zpracovat dokument.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation>Očekáván dokument obsahující definici jednoho objektu.</translation>
</message>
<message>
<source>Expected expression statement after colon.</source>
<translation>Po dvojtečce očekáván výraz.</translation>
@@ -49435,16 +49406,10 @@ nelze najít v cestě.</translation>
<source>Expected expression statement to be a literal.</source>
<translation>Očekáván výraz tvořený písmeny (literal).</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice.</source>
<translation>Vlastnost je stanovena dvakrát.</translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Do not use &apos;%1&apos; as a constructor.</source>
<translation>&apos;%1&apos; se nesmí používat jako konstruktor.</translation>
@@ -55517,7 +55482,7 @@ Opravdu chcete pokračovat?</translation>
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<name>::QmlJS</name>
<message>
<source>Indexing</source>
<translation>Indexování</translation>
@@ -55526,9 +55491,6 @@ Opravdu chcete pokračovat?</translation>
<source>QML import scan</source>
<translation>Sken importování QML</translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>QML module does not contain information about components contained in plugins.

View File

@@ -28715,7 +28715,7 @@ Dette er uafhængigt af visibility-egenskaben i QML.</translation>
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation>forventede to numre adskilt af et punktum</translation>
@@ -28724,16 +28724,10 @@ Dette er uafhængigt af visibility-egenskaben i QML.</translation>
<source>package import requires a version number</source>
<translation>pakkeimport kræver et versionsnummer</translation>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;int&apos; eller &apos;real&apos;</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>File or directory not found.</source>
<translation>Fil eller mappe ikke fundet.</translation>
@@ -28764,9 +28758,6 @@ Til CMake-projekter, sørg for at QML_IMPORT_PATH-variabler er i CMakeCache.txt.
<source>QML module contains C++ plugins, currently reading type information...</source>
<translation>QML-modul indeholder C++-plugins, læser aktuelt typeinformation...</translation>
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<message>
<source>Parsing QML Files</source>
<translation>Parser QML-filer</translation>
@@ -28775,9 +28766,6 @@ Til CMake-projekter, sørg for at QML_IMPORT_PATH-variabler er i CMakeCache.txt.
<source>Scanning QML Imports</source>
<translation>Skanner QML importer</translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>QML module does not contain information about components contained in plugins.
@@ -28867,7 +28855,7 @@ Byg venligst qmldump-programmet på valgmulighedersiden Qt version.</translation
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation>Kan ikke finde filen %1.</translation>
@@ -28884,16 +28872,10 @@ Byg venligst qmldump-programmet på valgmulighedersiden Qt version.</translation
<source>Expected expression statement after colon.</source>
<translation>Ventede udsagnsudtryk efter kolon.</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice.</source>
<translation>Egenskab er defineret to gange.</translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Do not use &quot;%1&quot; as a constructor.
@@ -29214,9 +29196,6 @@ Se &quot;Checking Code Syntax&quot;-dokumentation for mere information.</transla
<source>A State cannot have a child item (%1).</source>
<translation>En tilstand kan ikke have en barne-post (%1).</translation>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -29229,10 +29208,6 @@ Se &quot;Checking Code Syntax&quot;-dokumentation for mere information.</transla
<translation>Advarsler under indlæsning af qmltypes fra %1:
%2</translation>
</message>
<message>
<source>Could not parse document.</source>
<translation>Kunne ikke parse dokument.</translation>
</message>
<message>
<source>Expected a single import.</source>
<translation>Forventede en enkelt import.</translation>
@@ -29245,10 +29220,6 @@ Se &quot;Checking Code Syntax&quot;-dokumentation for mere information.</transla
<source>Major version different from 1 not supported.</source>
<translation>Stor version som ikke er 1 understøttes ikke.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation>Forventede at dokument indeholder en enkel objekt-definition.</translation>
</message>
<message>
<source>Expected document to contain a Module {} member.</source>
<translation>Forventede at dokument indeholder et modul {}-medlem.</translation>

View File

@@ -14554,7 +14554,7 @@ Locked components cannot be modified or selected.</source>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<name>::QmlJS</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;int&apos; oder &apos;real&apos;</translation>
@@ -14982,7 +14982,7 @@ The name of the build configuration created by default for a generic project.</e
</message>
</context>
<context>
<name>QmlJS::Link</name>
<name>::QmlJS</name>
<message>
<source>File or directory not found.</source>
<translation>Datei oder Verzeichnis nicht gefunden.</translation>
@@ -15959,7 +15959,7 @@ Möchten Sie sie überschreiben?</translation>
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>Hit maximal recursion depth in AST visit.</source>
<translation type="unfinished"></translation>
@@ -16043,7 +16043,7 @@ Möchten Sie sie überschreiben?</translation>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<name>::QmlJS</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -25981,26 +25981,15 @@ wirklich löschen?</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation>Die Datei &apos;%1&apos; kann nicht gefunden werden.</translation>
</message>
<message>
<source>Could not parse document.</source>
<translation>Das Dokument konnte nicht ausgewertet werden.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation>Das Dokument sollte eine einzige Objektdefinition enthalten.</translation>
</message>
<message>
<source>Expected expression statement after colon.</source>
<translation>Nach dem Doppelpunkt wird ein Ausdruck erwartet.</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice, previous definition at %1:%2</source>
<translation>Eigenschaft ist doppelt definiert, vorherige Definition ist bei %1:%2</translation>
@@ -26603,7 +26592,7 @@ wirklich löschen?</translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<name>::QmlJS</name>
<message>
<source>Do not use &quot;%1&quot; as a constructor.
@@ -30240,7 +30229,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeiche
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<name>::QmlJS</name>
<message>
<source>Parsing QML Files</source>
<translation>Werte QML-Dateien aus</translation>
@@ -30249,9 +30238,6 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeiche
<source>Scanning QML Imports</source>
<translation>Durchsuche QML-Imports</translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>Automatic type dump of QML module failed.
Errors:
@@ -50247,7 +50233,7 @@ Teilnamen können verwendet werden, sofern sie eindeutig sind.</translation>
</message>
</context>
<context>
<name>QmlJSTools::FindExportedCppTypes</name>
<name>::QmlJS</name>
<message>
<source>The type will only be available in the QML editors when the type name is a string literal.</source>
<translation type="unfinished">Dieser Typ wird im QML Editor nur sichtbar sein, wenn der Typname ein Zeichenketten-Literal ist.</translation>

View File

@@ -20485,7 +20485,7 @@ francis : ouai assez d&apos;accord.</translatorcomment>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<name>::QmlJS</name>
<message>
<source>unknown value for enum</source>
<translation type="obsolete">Valeur inconnue pour l&apos;énumération</translation>
@@ -20682,9 +20682,6 @@ francis : ouai assez d&apos;accord.</translatorcomment>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;int&apos; ou &apos;real&apos;</translation>
</message>
</context>
<context>
<name>QmlJS::Interpreter::QmlXmlReader</name>
<message>
<source>The file is not module file.</source>
<translation type="obsolete">Le fichier n&apos;est pas un fichier de module.</translation>
@@ -20705,21 +20702,10 @@ francis : ouai assez d&apos;accord.</translatorcomment>
<source>%1: %2</source>
<translation type="obsolete">%1 : %2</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>could not find file or directory</source>
<translation type="obsolete">impossible de trouver le fichier ou le répertoire</translation>
</message>
<message>
<source>expected two numbers separated by a dot</source>
<translation type="obsolete">est attendu deux nombres séparés par un point</translation>
</message>
<message>
<source>package import requires a version number</source>
<translation type="obsolete">l&apos;importation d&apos;un paquet a besoin d&apos;un numéro de version</translation>
</message>
<message>
<source>package not found</source>
<translation type="obsolete">paquet non trouvé</translation>
@@ -25207,7 +25193,7 @@ Preselects Qt for Simulator and mobile targets if available</source>
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation>est attendu deux nombres séparés par un point</translation>
@@ -25216,10 +25202,6 @@ Preselects Qt for Simulator and mobile targets if available</source>
<source>package import requires a version number</source>
<translation>l&apos;importation d&apos;un paquet a besoin d&apos;un numéro de version</translation>
</message>
<message>
<source>file or directory not found</source>
<translation type="obsolete">Fichier ou répertoire non trouvé</translation>
</message>
</context>
<context>
<name>::ProjectExplorer</name>
@@ -28749,11 +28731,7 @@ Les version de Qt précédentes ont des limitations lors de la compilation des f
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<message>
<source>%1: %2</source>
<translation type="obsolete">%1 : %2</translation>
</message>
<name>::QmlJS</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -28782,10 +28760,6 @@ Les version de Qt précédentes ont des limitations lors de la compilation des f
<source>Expected version 1.1 or lower.</source>
<translation>La version 1.1 ou inférieure est attendue.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation>Un document ne contiennant qu&apos;une seule définition d&apos;objet est attendu.</translation>
</message>
<message>
<source>Expected document to contain a Module {} member.</source>
<translation>Un document contiennant un membre Modue {} est attendu.</translation>
@@ -37140,7 +37114,7 @@ Si vous choisissez de ne pas continuer, Qt Creator n&apos;essayera pas de charge
</message>
</context>
<context>
<name>FindExportedCppTypes</name>
<name>::QmlJS</name>
<message>
<source>The type will only be available in Qt Creator&apos;s QML editors when the type name is a string literal</source>
<translation type="obsolete">Le type sera disponible dans l&apos;éditeur QML de Qt Creator lorsque le nom du type est une chaîne de caractères</translation>
@@ -46867,15 +46841,11 @@ Les noms partiels peuvent êtres utilisé s&apos;ils ne sont pas ambigües.</tra
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation>Impossible de trouver le fichier %1.</translation>
</message>
<message>
<source>Could not parse document.</source>
<translation>Impossible d&apos;analyser le document.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation>Le document ne devrait contenir qu&apos;une seule définition d&apos;objet.</translation>
@@ -46888,16 +46858,10 @@ Les noms partiels peuvent êtres utilisé s&apos;ils ne sont pas ambigües.</tra
<source>Expected expression statement to be a literal.</source>
<translation>L&apos;expression doit être littérale.</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice.</source>
<translation>Propriété définie deux fois.</translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Do not use &apos;%1&apos; as a constructor.</source>
<translation>Ne pas utiliser &apos;%1&apos; comme un constructeur.</translation>

View File

@@ -11602,7 +11602,7 @@ will also disable the following plugins:
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation type="unfinished"></translation>
@@ -11611,9 +11611,6 @@ will also disable the following plugins:
<source>package import requires a version number</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;int&apos; ili &apos;real&apos;</translation>
@@ -11637,7 +11634,7 @@ the QML editor know about a likely URI.</source>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<name>::QmlJS</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -11792,9 +11789,6 @@ the QML editor know about a likely URI.</source>
<source>Enum should not contain getter and setters, but only &apos;string: number&apos; elements.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>File or directory not found.</source>
<translation type="unfinished"></translation>
@@ -11816,9 +11810,6 @@ For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt.
<source>QML module contains C++ plugins, currently reading type information...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<message>
<source>Parsing QML Files</source>
<translation type="unfinished"></translation>
@@ -11827,9 +11818,6 @@ For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt.
<source>Scanning QML Imports</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>QML module does not contain information about components contained in plugins.
@@ -11894,46 +11882,18 @@ Error: %2</source>
Please build the qmldump application on the Qt version options page.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::QrcParser</name>
<message>
<source>XML error on line %1, col %2: %3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The &lt;RCC&gt; root element is missing.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<message>
<source>Cannot find file %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Could not parse document.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expected expression statement after colon.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Do not use &quot;%1&quot; as a constructor.

View File

@@ -9391,7 +9391,7 @@ will also disable the following plugins:
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation>2</translation>
@@ -9408,16 +9408,10 @@ will also disable the following plugins:
<source>Nested inline components are not supported</source>
<translation></translation>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;int&apos;&apos;real&apos;</translation>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -9590,9 +9584,6 @@ will also disable the following plugins:
<source>Enum should not contain getter and setters, but only &apos;string: number&apos; elements.</source>
<translation>Enum &apos;string: number&apos; 使</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>File or directory not found.</source>
<translation></translation>
@@ -9684,19 +9675,11 @@ CMake プロジェクトでは、CMakeCache.txt 内で QML_IMPORT_PATH 変数を
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation> %1 </translation>
</message>
<message>
<source>Could not parse document.</source>
<translation></translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation></translation>
</message>
<message>
<source>Expected expression statement after colon.</source>
<translation></translation>
@@ -9705,16 +9688,10 @@ CMake プロジェクトでは、CMakeCache.txt 内で QML_IMPORT_PATH 変数を
<source>Expected expression statement to be a literal.</source>
<translation></translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice.</source>
<translation></translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Do not use &quot;%1&quot; as a constructor.
@@ -31760,7 +31737,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<name>::QmlJS</name>
<message>
<source>Parsing QML Files</source>
<translation>QML </translation>
@@ -31769,9 +31746,6 @@ To do this, you type this shortcut and a space in the Locator entry field, and t
<source>Scanning QML Imports</source>
<translation>QML import </translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>QML module does not contain information about components contained in plugins.

View File

@@ -10296,14 +10296,11 @@ wyłączy również następujące wtyczki:
</message>
</context>
<context>
<name>QmlJS::Check</name>
<name>::QmlJS</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&quot;int&quot; lub &quot;real&quot;</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>File or directory not found.</source>
<translation>Nie można odnaleźć pliku lub katalogu.</translation>
@@ -12487,7 +12484,7 @@ Identyfikatory muszą rozpoczynać się małą literą.</translation>
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation>oczekiwano dwóch liczb oddzielonych kropką</translation>
@@ -13739,7 +13736,7 @@ Local pulls are not applied to the master branch.</source>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<name>::QmlJS</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -23292,33 +23289,19 @@ Można używać nazw częściowych, jeśli są one unikalne.</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation>Brak pliku %1.</translation>
</message>
<message>
<source>Could not parse document.</source>
<translation>Błąd parsowania dokumentu.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation>Oczekiwano dokumentu zawierającego pojedynczą definicję obiektu.</translation>
</message>
<message>
<source>Expected expression statement after colon.</source>
<translation>Oczekiwano składnika wyrażenia po dwukropku.</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice.</source>
<translation>Właściwość jest zdefiniowana dwukrotnie.</translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Invalid value for enum.</source>
<translation>Niepoprawna wartość dla typu wyliczeniowego.</translation>
@@ -27039,7 +27022,7 @@ Aby uaktywnić ten filtr, wpisz w lokalizatorze powyższy skrót i po spacji pod
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<name>::QmlJS</name>
<message>
<source>Parsing QML Files</source>
<translation>Parsowanie plików QML</translation>
@@ -27048,9 +27031,6 @@ Aby uaktywnić ten filtr, wpisz w lokalizatorze powyższy skrót i po spacji pod
<source>Scanning QML Imports</source>
<translation>Skanowanie importów QML</translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>QML module does not contain information about components contained in plugins.

View File

@@ -37425,7 +37425,7 @@ This is independent of the visibility property in QML.</source>
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>Hit maximal recursion depth in AST visit</source>
<translation>Достигнута максимальная глубина рекурсии обработки AST</translation>
@@ -37434,16 +37434,10 @@ This is independent of the visibility property in QML.</source>
<source>package import requires a version number</source>
<translation>импорт пакета требует номер версии</translation>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>«int» или «real»</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>File or directory not found.</source>
<translation>Файл или каталог не найден.</translation>
@@ -37498,9 +37492,6 @@ For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt.
<source>QML module contains C++ plugins, currently reading type information...</source>
<translation>Модуль QML содержит расширения на C++, идёт чтение информации о типах...</translation>
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<message>
<source>Parsing QML Files</source>
<translation>Разбор файлов QML</translation>
@@ -37509,9 +37500,6 @@ For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt.
<source>Scanning QML Imports</source>
<translation>Сканирование импорта QML</translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>Automatic type dump of QML module failed.
Errors:
@@ -37601,7 +37589,7 @@ Please build the qmldump application on the Qt version options page.</source>
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation>Не удалось найти файл %1.</translation>
@@ -37618,16 +37606,10 @@ Please build the qmldump application on the Qt version options page.</source>
<source>Expected expression statement after colon.</source>
<translation>Ожидается выражение после запятой.</translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice.</source>
<translation>Свойство определено дважды.</translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Do not use &quot;%1&quot; as a constructor.
@@ -37960,9 +37942,6 @@ For more information, see the &quot;Checking Code Syntax&quot; documentation.</s
<source>Qt Quick Designer only supports states in the root item.</source>
<translation>Qt Quick Designer поддерживает состояния только в корневом элементе.</translation>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -37975,10 +37954,6 @@ For more information, see the &quot;Checking Code Syntax&quot; documentation.</s
<translation>Возникли следующие предупреждения при загрузке информации о типах QML из %1:
%2</translation>
</message>
<message>
<source>Could not parse document.</source>
<translation>Не удалось разобрать документ.</translation>
</message>
<message>
<source>Expected a single import.</source>
<translation>Ожидается одиночный импорт.</translation>
@@ -37991,10 +37966,6 @@ For more information, see the &quot;Checking Code Syntax&quot; documentation.</s
<source>Major version different from 1 not supported.</source>
<translation>Версия с основным номером отличным от 1 не поддерживается.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation>В документе ожидается определение ровно одного объекта.</translation>
</message>
<message>
<source>Expected document to contain a Module {} member.</source>
<translation>В документе ожидается наличие члена Module {}.</translation>

View File

@@ -14237,7 +14237,7 @@ okoljsko spremenljivko SSH_ASKPASS.</translation>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<name>::QmlJS</name>
<message>
<source>unknown value for enum</source>
<translation>neznana vrednost za oštevilčenje</translation>
@@ -14406,9 +14406,6 @@ okoljsko spremenljivko SSH_ASKPASS.</translation>
<source>ids must be lower case</source>
<translation type="obsolete">ID-ji morajo imeti same male črke</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>package not found</source>
<translation>paket ni bil najden</translation>
@@ -14421,14 +14418,6 @@ okoljsko spremenljivko SSH_ASKPASS.</translation>
<source>could not find file or directory</source>
<translation type="obsolete">datoteke ali mape ni bilo moč najti</translation>
</message>
<message>
<source>expected two numbers separated by a dot</source>
<translation type="obsolete">pričakovani sta bili dve števili ločeni s piko</translation>
</message>
<message>
<source>package import requires a version number</source>
<translation type="obsolete">uvažanje paketa zahteva številko različice</translation>
</message>
</context>
<context>
<name>Utils::FancyMainWindow</name>
@@ -20840,7 +20829,7 @@ S simulacijo predpomnilnika so omogočeni dodatni števci dogodkov:
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation>pričakovani sta bili dve števili ločeni s piko</translation>
@@ -20853,9 +20842,6 @@ S simulacijo predpomnilnika so omogočeni dodatni števci dogodkov:
<source>file or directory not found</source>
<translation>datoteke ali mape ni bilo moč najti</translation>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -30439,7 +30425,7 @@ Preverite, ali je telefon priključen in ali App TRK teče.</translation>
</message>
</context>
<context>
<name>QmlJS::Interpreter::QmlXmlReader</name>
<name>::QmlJS</name>
<message>
<source>The file is not module file.</source>
<translation type="obsolete">Datoteka ni datoteka modula.</translation>

View File

@@ -14943,7 +14943,7 @@ This is independent of the visibility property in QML.</source>
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation>очікувались два числа розділених крапкою</translation>
@@ -14952,16 +14952,10 @@ This is independent of the visibility property in QML.</source>
<source>package import requires a version number</source>
<translation>імпорт пакунка вимагає номеру версії</translation>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;int&apos; або &apos;real&apos;</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>file or directory not found</source>
<translation type="vanished">файл чи тека не знайдені</translation>
@@ -15008,9 +15002,6 @@ For qmlproject projects, use the importPaths property to add import paths.</sour
<source>QML module contains C++ plugins, currently reading type information...</source>
<translation>Модуль QML містить додатки C++, триває читання інформації про типи...</translation>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -29264,19 +29255,11 @@ cannot be found in the path.</source>
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation>Неможливо знайти файл %1.</translation>
</message>
<message>
<source>Could not parse document.</source>
<translation>Не вдалось розібрати документ.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expected expression statement after colon.</source>
<translation type="unfinished"></translation>
@@ -29285,16 +29268,10 @@ cannot be found in the path.</source>
<source>Expected expression statement to be a literal.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice.</source>
<translation>Властивість визначено двічі.</translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Invalid value for enum.</source>
<translation type="unfinished"></translation>
@@ -34750,7 +34727,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<name>::QmlJS</name>
<message>
<source>Indexing</source>
<translation type="vanished">Індексування</translation>
@@ -34767,9 +34744,6 @@ To do this, you type this shortcut and a space in the Locator entry field, and t
<source>Scanning QML Imports</source>
<translation>Сканування імпортів QML</translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>QML module does not contain information about components contained in plugins.

View File

@@ -35856,7 +35856,7 @@ Locked components cannot be modified or selected.</source>
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>package import requires a version number</source>
<translation></translation>
@@ -35869,16 +35869,10 @@ Locked components cannot be modified or selected.</source>
<source>Nested inline components are not supported</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;&apos; &apos;&apos;</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>File or directory not found.</source>
<translation type="unfinished"></translation>
@@ -35914,9 +35908,6 @@ For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt.
<source>QML module contains C++ plugins, currently reading type information... %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::ModelManagerInterface</name>
<message>
<source>Parsing QML Files</source>
<translation type="unfinished"></translation>
@@ -35925,9 +35916,6 @@ For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt.
<source>Scanning QML Imports</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::PluginDumper</name>
<message>
<source>QML module does not contain information about components contained in plugins.
@@ -36009,7 +35997,7 @@ Please build the qmldump application on the Qt version options page.</source>
</message>
</context>
<context>
<name>QmlJS::SimpleAbstractStreamReader</name>
<name>::QmlJS</name>
<message>
<source>Cannot find file %1.</source>
<translation type="unfinished"></translation>
@@ -36026,16 +36014,10 @@ Please build the qmldump application on the Qt version options page.</source>
<source>Expected expression statement after colon.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::SimpleReader</name>
<message>
<source>Property is defined twice, previous definition at %1:%2</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::StaticAnalysisMessages</name>
<message>
<source>Do not use &quot;%1&quot; as a constructor.
@@ -36390,9 +36372,6 @@ For more information, see the &quot;Checking Code Syntax&quot; documentation.</s
<source>Avoid referencing the root item in a hierarchy.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -36405,10 +36384,6 @@ For more information, see the &quot;Checking Code Syntax&quot; documentation.</s
<translation>%1qmltypes时发生警告:
%2</translation>
</message>
<message>
<source>Could not parse document.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expected a single import.</source>
<translation type="unfinished"></translation>
@@ -36421,10 +36396,6 @@ For more information, see the &quot;Checking Code Syntax&quot; documentation.</s
<source>Major version different from 1 not supported.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expected document to contain a Module {} member.</source>
<translation type="unfinished"></translation>
@@ -36777,7 +36748,7 @@ For more information, see the &quot;Checking Code Syntax&quot; documentation.</s
</message>
</context>
<context>
<name>QmlJSTools::FindExportedCppTypes</name>
<name>::QmlJS</name>
<message>
<source>The type will only be available in the QML editors when the type name is a string literal.</source>
<translation type="unfinished"></translation>

View File

@@ -12074,14 +12074,11 @@ You can choose between stashing the changes or discarding them.</source>
</message>
</context>
<context>
<name>QmlJS::Check</name>
<name>::QmlJS</name>
<message>
<source>&apos;int&apos; or &apos;real&apos;</source>
<translation>&apos;int&apos; &apos;real&apos;</translation>
</message>
</context>
<context>
<name>QmlJS::Link</name>
<message>
<source>file or directory not found</source>
<translation></translation>
@@ -15099,7 +15096,7 @@ Ids must begin with a lowercase letter.</source>
</message>
</context>
<context>
<name>QmlJS::Bind</name>
<name>::QmlJS</name>
<message>
<source>expected two numbers separated by a dot</source>
<translation></translation>
@@ -17571,7 +17568,7 @@ Local pulls are not applied to the master branch.</source>
</message>
</context>
<context>
<name>QmlJS::TypeDescriptionReader</name>
<name>::QmlJS</name>
<message>
<source>Errors while loading qmltypes from %1:
%2</source>
@@ -24042,7 +24039,7 @@ If you choose not to continue Qt Creator will not try to load the .shared file.<
</message>
</context>
<context>
<name>FindExportedCppTypes</name>
<name>::QmlJS</name>
<message>
<source>The type will only be available in Qt Creator&apos;s QML editors when the type name is a string literal</source>
<translation type="obsolete"> Qt Creator QML編輯器時可使用</translation>

View File

@@ -2,10 +2,13 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qmljsbind.h"
#include "parser/qmljsast_p.h"
#include "qmljsutils.h"
#include "qmljsdocument.h"
#include "qmljsmodelmanagerinterface.h"
#include "qmljstr.h"
#include "qmljsutils.h"
#include <QtCore/QVersionNumber>
#include <QtCore/QLibraryInfo>
@@ -164,7 +167,8 @@ ObjectValue *Bind::bindObject(UiQualifiedId *qualifiedTypeNameId, UiObjectInitia
void Bind::throwRecursionDepthError()
{
_diagnosticMessages->append(DiagnosticMessage(Severity::Error, SourceLocation(), tr("Hit maximal recursion depth in AST visit.")));
_diagnosticMessages->append(DiagnosticMessage(Severity::Error, SourceLocation(),
Tr::tr("Hit maximal recursion depth in AST visit.")));
}
void Bind::accept(Node *node)
@@ -212,7 +216,7 @@ bool Bind::visit(UiImport *ast)
}
if (!version.isValid() && (!qtVersion.isNull() && qtVersion.majorVersion() < 6)) {
_diagnosticMessages->append(
errorMessage(ast, tr("package import requires a version number")));
errorMessage(ast, Tr::tr("package import requires a version number")));
}
const QString importId = ast->importId.toString();
@@ -322,7 +326,7 @@ bool Bind::visit(UiInlineComponent *ast)
if (!_currentComponentName.isEmpty()) {
_currentComponentName += ".";
_diagnosticMessages->append(
errorMessage(ast, tr("Nested inline components are not supported")));
errorMessage(ast, Tr::tr("Nested inline components are not supported")));
}
_currentComponentName += ast->name.toString();
_rootObjectValue = nullptr;

View File

@@ -17,7 +17,6 @@ class Document;
class QMLJS_EXPORT Bind: protected AST::Visitor
{
Q_DISABLE_COPY(Bind)
Q_DECLARE_TR_FUNCTIONS(QmlJS::Bind)
public:
Bind(Document *doc, QList<DiagnosticMessage> *messages,

View File

@@ -2,9 +2,12 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qmljscheck.h"
#include "qmljsbind.h"
#include "qmljsevaluate.h"
#include "qmljstr.h"
#include "qmljsutils.h"
#include "parser/qmljsast_p.h"
#include <utils/algorithm.h>
@@ -1161,7 +1164,7 @@ bool Check::visit(UiPublicMember *ast)
const Value *init = evaluator(ast->statement);
QString preferredType;
if (init->asNumberValue())
preferredType = tr("'int' or 'real'");
preferredType = Tr::tr("'int' or 'real'");
else if (init->asStringValue())
preferredType = "'string'";
else if (init->asBooleanValue())
@@ -1216,7 +1219,7 @@ bool Check::visit(IdentifierExpression *)
// if (const Reference *ref = value_cast<Reference>(_lastValue)) {
// _lastValue = _context->lookupReference(ref);
// if (!_lastValue)
// error(ast->identifierToken, tr("could not resolve"));
// error(ast->identifierToken, Tr::tr("could not resolve"));
// }
// }
// return false;
@@ -1233,7 +1236,7 @@ bool Check::visit(FieldMemberExpression *)
// const ObjectValue *obj = _lastValue->asObjectValue();
// if (!obj) {
// error(locationFromRange(ast->base->firstSourceLocation(), ast->base->lastSourceLocation()),
// tr("does not have members"));
// Tr::tr("does not have members"));
// }
// if (!obj || ast->name.isEmpty()) {
// _lastValue = 0;
@@ -1241,7 +1244,7 @@ bool Check::visit(FieldMemberExpression *)
// }
// _lastValue = obj->lookupMember(ast->name.toString(), _context);
// if (!_lastValue)
// error(ast->identifierToken, tr("unknown member"));
// error(ast->identifierToken, Tr::tr("unknown member"));
// return false;
}

View File

@@ -18,8 +18,6 @@ class Imports;
class QMLJS_EXPORT Check: protected AST::Visitor
{
Q_DECLARE_TR_FUNCTIONS(QmlJS::Check)
typedef QSet<QString> StringSet;
public:

View File

@@ -3,8 +3,10 @@
#include "qmljsfindexportedcpptypes.h"
#include <qmljs/qmljsinterpreter.h>
#include <qmljs/qmljsdocument.h>
#include "qmljsdocument.h"
#include "qmljsinterpreter.h"
#include "qmljstr.h"
#include <cplusplus/Overview.h>
#include <cplusplus/TypeOfExpression.h>
#include <cplusplus/cppmodelmanagerbase.h>
@@ -250,7 +252,7 @@ protected:
Document::DiagnosticMessage::Warning,
_doc->filePath(),
line, column,
QmlJS::FindExportedCppTypes::tr(
QmlJS::Tr::tr(
"The type will only be available in the QML editors when the type name is a string literal."));
return false;
}
@@ -311,7 +313,7 @@ protected:
Document::DiagnosticMessage::Warning,
_doc->filePath(),
line, column,
QmlJS::FindExportedCppTypes::tr(
QmlJS::Tr::tr(
"The module URI cannot be determined by static analysis. The type will not be available\n"
"globally in the QML editor. You can add a \"// @uri My.Module.Uri\" annotation to let\n"
"the QML editor know about a likely URI."));
@@ -493,7 +495,7 @@ protected:
Document::DiagnosticMessage::Warning,
_doc->filePath(),
line, column,
QmlJS::FindExportedCppTypes::tr(
QmlJS::Tr::tr(
"must be a string literal to be available in the QML editor"));
return false;
}

View File

@@ -14,7 +14,6 @@ namespace QmlJS {
class QMLJS_EXPORT FindExportedCppTypes
{
Q_DECLARE_TR_FUNCTIONS(QmlJSTools::FindExportedCppTypes)
public:
FindExportedCppTypes(const CPlusPlus::Snapshot &snapshot);

View File

@@ -2,14 +2,17 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "parser/qmljsast_p.h"
#include "qmljsinterpreter.h"
#include "qmljsconstants.h"
#include "qmljscontext.h"
#include "qmljsevaluate.h"
#include "qmljsinterpreter.h"
#include "qmljsmodelmanagerinterface.h"
#include "qmljsscopeastpath.h"
#include "qmljsscopebuilder.h"
#include "qmljsscopechain.h"
#include "qmljstr.h"
#include "qmljstypedescriptionreader.h"
#include "qmljsvalueowner.h"
@@ -1340,13 +1343,11 @@ CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInf
error = file.errorString();
}
if (!error.isEmpty()) {
errors->append(TypeDescriptionReader::tr(
"Errors while loading qmltypes from %1:\n%2").arg(
errors->append(Tr::tr("Errors while loading qmltypes from %1:\n%2").arg(
qmlTypeFile.absoluteFilePath(), error));
}
if (!warning.isEmpty()) {
warnings->append(TypeDescriptionReader::tr(
"Warnings while loading qmltypes from %1:\n%2").arg(
warnings->append(Tr::tr("Warnings while loading qmltypes from %1:\n%2").arg(
qmlTypeFile.absoluteFilePath(), warning));
}
}

View File

@@ -4,11 +4,13 @@
#include "qmljslink.h"
#include "parser/qmljsast_p.h"
#include "qmljsdocument.h"
#include "qmljsbind.h"
#include "qmljsutils.h"
#include "qmljsmodelmanagerinterface.h"
#include "qmljsconstants.h"
#include "qmljsdocument.h"
#include "qmljsmodelmanagerinterface.h"
#include "qmljstr.h"
#include "qmljsutils.h"
#include <utils/algorithm.h>
#include <utils/filepath.h>
@@ -293,7 +295,7 @@ void LinkPrivate::populateImportedTypes(Imports *imports, const Document::Ptr &d
imports->setImportFailed();
if (info.ast()) {
error(doc, info.ast()->fileNameToken,
Link::tr("File or directory not found."));
Tr::tr("File or directory not found."));
}
break;
default:
@@ -455,7 +457,7 @@ Import LinkPrivate::importNonFile(const Document::Ptr &doc, const ImportInfo &im
error(doc,
locationFromRange(importInfo.ast()->firstSourceLocation(),
importInfo.ast()->lastSourceLocation()),
Link::tr(
Tr::tr(
"QML module not found (%1).\n\n"
"Import paths:\n"
"%2\n\n"
@@ -525,19 +527,19 @@ bool LinkPrivate::importLibrary(const Document::Ptr &doc,
if (!(optional || (toImport.flags & QmlDirParser::Import::Optional))) {
error(doc,
errorLoc,
Link::tr("Implicit import '%1' of QML module '%2' not found.\n\n"
"Import paths:\n"
"%3\n\n"
"For qmake projects, use the QML_IMPORT_PATH variable to add import "
"paths.\n"
"For Qbs projects, declare and set a qmlImportPaths property in "
"your product "
"to add import paths.\n"
"For qmlproject projects, use the importPaths property to add "
"import paths.\n"
"For CMake projects, make sure QML_IMPORT_PATH variable is in "
"CMakeCache.txt.\n")
.arg(importName,
Tr::tr("Implicit import '%1' of QML module '%2' not found.\n\n"
"Import paths:\n"
"%3\n\n"
"For qmake projects, use the QML_IMPORT_PATH variable to add import "
"paths.\n"
"For Qbs projects, declare and set a qmlImportPaths property in "
"your product "
"to add import paths.\n"
"For qmlproject projects, use the importPaths property to add "
"import paths.\n"
"For CMake projects, make sure QML_IMPORT_PATH variable is in "
"CMakeCache.txt.\n")
.arg(importName,
importInfo.name(),
Utils::transform(m_importPaths, [](const Utils::FilePath &p) {
return p.toString();
@@ -569,8 +571,9 @@ bool LinkPrivate::importLibrary(const Document::Ptr &doc,
if (!optional && errorLoc.isValid()) {
appendDiagnostic(doc, DiagnosticMessage(
Severity::ReadingTypeInfoWarning, errorLoc,
Link::tr("QML module contains C++ plugins, "
"currently reading type information... %1").arg(import->info.name())));
Tr::tr("QML module contains C++ plugins, "
"currently reading type information... %1")
.arg(import->info.name())));
import->valid = false;
}
} else if (libraryInfo.pluginTypeInfoStatus() == LibraryInfo::DumpError

View File

@@ -18,7 +18,6 @@ class LinkPrivate;
class QMLJS_EXPORT Link
{
Q_DISABLE_COPY(Link)
Q_DECLARE_TR_FUNCTIONS(QmlJS::Link)
public:
Link(Link &&) = delete;

View File

@@ -1,15 +1,17 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qmljsmodelmanagerinterface.h"
#include "qmljsbind.h"
#include "qmljsconstants.h"
#include "qmljsdialect.h"
#include "qmljsfindexportedcpptypes.h"
#include "qmljsinterpreter.h"
#include "qmljsmodelmanagerinterface.h"
#include "qmljsplugindumper.h"
#include "qmljsdialect.h"
#include "qmljsviewercontext.h"
#include "qmljstr.h"
#include "qmljsutils.h"
#include "qmljsviewercontext.h"
#include <cplusplus/cppmodelmanagerbase.h>
#include <utils/algorithm.h>
@@ -343,7 +345,7 @@ QFuture<void> ModelManagerInterface::refreshSourceFiles(const QList<Utils::FileP
addFuture(result);
if (sourceFiles.count() > 1)
addTaskInternal(result, tr("Parsing QML Files"), Constants::TASK_INDEX);
addTaskInternal(result, Tr::tr("Parsing QML Files"), Constants::TASK_INDEX);
if (sourceFiles.count() > 1 && !m_shouldScanImports) {
bool scan = false;
@@ -1209,7 +1211,7 @@ void ModelManagerInterface::maybeScan(const PathsAndLanguages &importPaths)
workingCopyInternal(), pathToScan,
this, true, true, false);
addFuture(result);
addTaskInternal(result, tr("Scanning QML Imports"), Constants::TASK_IMPORT_SCAN);
addTaskInternal(result, Tr::tr("Scanning QML Imports"), Constants::TASK_IMPORT_SCAN);
}
}

View File

@@ -2,11 +2,12 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qmljsplugindumper.h"
#include "qmljsmodelmanagerinterface.h"
#include "qmljsutils.h"
#include <qmljs/qmljsinterpreter.h>
#include <qmljs/qmljsviewercontext.h>
#include "qmljsinterpreter.h"
#include "qmljsmodelmanagerinterface.h"
#include "qmljstr.h"
#include "qmljsutils.h"
#include "qmljsviewercontext.h"
#include <utils/algorithm.h>
#include <utils/filesystemwatcher.h>
@@ -170,16 +171,16 @@ void PluginDumper::dumpAllPlugins()
static QString noTypeinfoError(const FilePath &libraryPath)
{
return PluginDumper::tr("QML module does not contain information about components contained in plugins.\n\n"
"Module path: %1\n"
"See \"Using QML Modules with Plugins\" in the documentation.").arg(
return Tr::tr("QML module does not contain information about components contained in plugins.\n\n"
"Module path: %1\n"
"See \"Using QML Modules with Plugins\" in the documentation.").arg(
libraryPath.toUserOutput());
}
static QString qmldumpErrorMessage(const FilePath &libraryPath, const QString &error)
{
return noTypeinfoError(libraryPath) + "\n\n" +
PluginDumper::tr("Automatic type dump of QML module failed.\nErrors:\n%1").
Tr::tr("Automatic type dump of QML module failed.\nErrors:\n%1").
arg(error) + QLatin1Char('\n');
}
@@ -187,19 +188,19 @@ static QString qmldumpFailedMessage(const FilePath &libraryPath, const QString &
{
QString firstLines = QStringList(error.split('\n').mid(0, 10)).join('\n');
return noTypeinfoError(libraryPath) + "\n\n" +
PluginDumper::tr("Automatic type dump of QML module failed.\n"
"First 10 lines or errors:\n"
"\n"
"%1"
"\n"
"Check General Messages for details."
).arg(firstLines);
Tr::tr("Automatic type dump of QML module failed.\n"
"First 10 lines or errors:\n"
"\n"
"%1"
"\n"
"Check General Messages for details."
).arg(firstLines);
}
static void printParseWarnings(const FilePath &libraryPath, const QString &warning)
{
ModelManagerInterface::writeWarning(
PluginDumper::tr("Warnings while parsing QML type information of %1:\n"
Tr::tr("Warnings while parsing QML type information of %1:\n"
"%2").arg(libraryPath.toUserOutput(), warning));
}
@@ -209,24 +210,24 @@ static QString qmlPluginDumpErrorMessage(QtcProcess *process)
const QString binary = process->commandLine().executable().toUserOutput();
switch (process->error()) {
case QProcess::FailedToStart:
errorMessage = PluginDumper::tr("\"%1\" failed to start: %2").arg(binary, process->errorString());
errorMessage = Tr::tr("\"%1\" failed to start: %2").arg(binary, process->errorString());
break;
case QProcess::Crashed:
errorMessage = PluginDumper::tr("\"%1\" crashed.").arg(binary);
errorMessage = Tr::tr("\"%1\" crashed.").arg(binary);
break;
case QProcess::Timedout:
errorMessage = PluginDumper::tr("\"%1\" timed out.").arg(binary);
errorMessage = Tr::tr("\"%1\" timed out.").arg(binary);
break;
case QProcess::ReadError:
case QProcess::WriteError:
errorMessage = PluginDumper::tr("I/O error running \"%1\".").arg(binary);
errorMessage = Tr::tr("I/O error running \"%1\".").arg(binary);
break;
case QProcess::UnknownError:
if (process->exitCode())
errorMessage = PluginDumper::tr("\"%1\" returned exit code %2.").arg(binary).arg(process->exitCode());
errorMessage = Tr::tr("\"%1\" returned exit code %2.").arg(binary).arg(process->exitCode());
break;
}
errorMessage += '\n' + PluginDumper::tr("Arguments: %1").arg(process->commandLine().arguments());
errorMessage += '\n' + Tr::tr("Arguments: %1").arg(process->commandLine().arguments());
if (process->error() != QProcess::FailedToStart) {
const QString stdErr = QString::fromLocal8Bit(process->readAllRawStandardError());
if (!stdErr.isEmpty()) {
@@ -344,7 +345,7 @@ QFuture<PluginDumper::QmlTypeDescription> PluginDumper::loadQmlTypeDescription(c
CppQmlTypesLoader::parseQmlTypeDescriptions(reader.data(), &objs, &apis, &deps,
&error, &warning, p.toString());
if (!error.isEmpty()) {
result.errors += tr("Failed to parse \"%1\".\nError: %2").arg(p.toUserOutput(), error);
result.errors += Tr::tr("Failed to parse \"%1\".\nError: %2").arg(p.toUserOutput(), error);
} else {
result.objects += objs.values();
result.moduleApis += apis;
@@ -546,7 +547,7 @@ void PluginDumper::prepareLibraryInfo(LibraryInfo &libInfo,
libInfo.setPluginTypeInfoStatus(LibraryInfo::TypeInfoFileDone);
} else {
printParseWarnings(libraryPath, errors.join(QLatin1Char('\n')));
errs.prepend(tr("Errors while reading typeinfo files:"));
errs.prepend(Tr::tr("Errors while reading typeinfo files:"));
libInfo.setPluginTypeInfoStatus(LibraryInfo::TypeInfoFileError, errs.join(QLatin1Char('\n')));
}
@@ -635,7 +636,7 @@ void PluginDumper::dump(const Plugin &plugin)
errorMessage = noTypeinfoError(plugin.qmldirPath);
} else {
errorMessage = qmldumpErrorMessage(plugin.qmldirPath,
tr("Could not locate the helper application for dumping type information from C++ plugins.\n"
Tr::tr("Could not locate the helper application for dumping type information from C++ plugins.\n"
"Please build the qmldump application on the Qt version options page."));
}

View File

@@ -13,6 +13,7 @@
#include "qqmljsparser_p.h"
#endif
#include "qmljstr.h"
#include "qmljsutils.h"
#include <QFile>
@@ -110,7 +111,7 @@ static Q_LOGGING_CATEGORY(simpleReaderLog, "qtc.qmljs.simpleReader", QtWarningMs
file.close();
return readFromSource(QString::fromLocal8Bit(source));
}
addError(tr("Cannot find file %1.").arg(fileName));
addError(Tr::tr("Cannot find file %1.").arg(fileName));
return false;
}
@@ -157,14 +158,14 @@ static Q_LOGGING_CATEGORY(simpleReaderLog, "qtc.qmljs.simpleReader", QtWarningMs
bool SimpleAbstractStreamReader::readDocument(AST::UiProgram * ast)
{
if (!ast) {
addError(tr("Could not parse document."));
addError(Tr::tr("Could not parse document."));
return false;
}
AST::UiObjectDefinition *uiObjectDefinition = AST::cast<AST::UiObjectDefinition *>(
ast->members->member);
if (!uiObjectDefinition) {
addError(tr("Expected document to contain a single object definition."));
addError(Tr::tr("Expected document to contain a single object definition."));
return false;
}
readChild(uiObjectDefinition);
@@ -237,7 +238,7 @@ static Q_LOGGING_CATEGORY(simpleReaderLog, "qtc.qmljs.simpleReader", QtWarningMs
AST::ExpressionStatement *expStmt = AST::cast<AST::ExpressionStatement *>(
uiScriptBinding->statement);
if (!expStmt) {
addError(tr("Expected expression statement after colon."),
addError(Tr::tr("Expected expression statement after colon."),
uiScriptBinding->statement->firstSourceLocation());
return std::make_pair(QVariant(), SourceLocation());
}
@@ -339,7 +340,7 @@ static Q_LOGGING_CATEGORY(simpleReaderLog, "qtc.qmljs.simpleReader", QtWarningMs
if (m_currentNode.toStrongRef().data()->propertyNames().contains(name)) {
auto previousSourceLoc = m_currentNode.toStrongRef().data()->property(name).nameLocation;
addError(tr("Property is defined twice, previous definition at %1:%2")
addError(Tr::tr("Property is defined twice, previous definition at %1:%2")
.arg(QString::number(previousSourceLoc.startLine),
QString::number(previousSourceLoc.startColumn)),
currentSourceLocation());

View File

@@ -18,9 +18,6 @@
#include <QVariant>
#include <QWeakPointer>
// for Q_DECLARE_TR_FUNCTIONS
#include <QCoreApplication>
namespace QmlJS {
#ifndef QT_CREATOR
@@ -84,8 +81,6 @@ using namespace QQmlJS;
class QMLJS_EXPORT SimpleAbstractStreamReader
{
Q_DECLARE_TR_FUNCTIONS(QmlJS::SimpleAbstractStreamReader)
public:
SimpleAbstractStreamReader();
virtual ~SimpleAbstractStreamReader();
@@ -124,8 +119,6 @@ private:
class QMLJS_EXPORT SimpleReader: public SimpleAbstractStreamReader
{
Q_DECLARE_TR_FUNCTIONS(QmlJS::SimpleReader)
public:
SimpleReader();
SimpleReaderNode::Ptr readFile(const QString &fileName);

View File

@@ -2,7 +2,10 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qmljsstaticanalysismessage.h"
#include "qmljsconstants.h"
#include "qmljstr.h"
#include "parser/qmljsengine_p.h"
#include "parser/qmljsdiagnosticmessage_p.h"
@@ -19,8 +22,6 @@ namespace {
class StaticAnalysisMessages
{
Q_DECLARE_TR_FUNCTIONS(QmlJS::StaticAnalysisMessages)
public:
void newMsg(Type type, Enum severity, const QString &message, int placeholders = 0)
{
@@ -40,9 +41,9 @@ public:
static inline QString msgInvalidConstructor(const char *what)
{
return StaticAnalysisMessages::tr("Do not use \"%1\" as a constructor."
"\n\nFor more information, see the"
" \"Checking Code Syntax\" documentation.")
return Tr::tr("Do not use \"%1\" as a constructor."
"\n\nFor more information, see the"
" \"Checking Code Syntax\" documentation.")
.arg(QLatin1String(what));
}
@@ -51,63 +52,63 @@ StaticAnalysisMessages::StaticAnalysisMessages()
// When changing a message or severity, update the documentation, currently
// in creator-code-syntax.qdoc, accordingly.
newMsg(ErrInvalidEnumValue, Error,
tr("Invalid value for enum."));
Tr::tr("Invalid value for enum."));
newMsg(ErrEnumValueMustBeStringOrNumber, Error,
tr("Enum value must be a string or a number."));
Tr::tr("Enum value must be a string or a number."));
newMsg(ErrNumberValueExpected, Error,
tr("Number value expected."));
Tr::tr("Number value expected."));
newMsg(ErrBooleanValueExpected, Error,
tr("Boolean value expected."));
Tr::tr("Boolean value expected."));
newMsg(ErrStringValueExpected, Error,
tr("String value expected."));
Tr::tr("String value expected."));
newMsg(ErrInvalidUrl, Error,
tr("Invalid URL."));
Tr::tr("Invalid URL."));
newMsg(WarnFileOrDirectoryDoesNotExist, Warning,
tr("File or directory does not exist."));
Tr::tr("File or directory does not exist."));
newMsg(ErrInvalidColor, Error,
tr("Invalid color."));
Tr::tr("Invalid color."));
newMsg(ErrAnchorLineExpected, Error,
tr("Anchor line expected."));
Tr::tr("Anchor line expected."));
newMsg(ErrPropertiesCanOnlyHaveOneBinding, Error,
tr("Duplicate property binding."));
Tr::tr("Duplicate property binding."));
newMsg(ErrIdExpected, Error,
tr("Id expected."));
Tr::tr("Id expected."));
newMsg(ErrInvalidId, Error,
tr("Invalid id."));
Tr::tr("Invalid id."));
newMsg(ErrDuplicateId, Error,
tr("Duplicate id."));
Tr::tr("Duplicate id."));
newMsg(ErrInvalidPropertyName, Error,
tr("Invalid property name \"%1\"."), 1);
Tr::tr("Invalid property name \"%1\"."), 1);
newMsg(ErrDoesNotHaveMembers, Error,
tr("\"%1\" does not have members."), 1);
Tr::tr("\"%1\" does not have members."), 1);
newMsg(ErrInvalidMember, Error,
tr("\"%1\" is not a member of \"%2\"."), 2);
Tr::tr("\"%1\" is not a member of \"%2\"."), 2);
newMsg(WarnAssignmentInCondition, Warning,
tr("Assignment in condition."));
Tr::tr("Assignment in condition."));
newMsg(WarnCaseWithoutFlowControl, Warning,
tr("Unterminated non-empty case block."));
Tr::tr("Unterminated non-empty case block."));
newMsg(WarnEval, Warning,
tr("Do not use 'eval'."));
Tr::tr("Do not use 'eval'."));
newMsg(WarnUnreachable, Warning,
tr("Unreachable."));
Tr::tr("Unreachable."));
newMsg(WarnWith, Warning,
tr("Do not use 'with'."));
Tr::tr("Do not use 'with'."));
newMsg(WarnComma, Warning,
tr("Do not use comma expressions."));
Tr::tr("Do not use comma expressions."));
newMsg(WarnAlreadyFormalParameter, Warning,
tr("\"%1\" already is a formal parameter."), 1);
Tr::tr("\"%1\" already is a formal parameter."), 1);
newMsg(WarnUnnecessaryMessageSuppression, Warning,
tr("Unnecessary message suppression."));
Tr::tr("Unnecessary message suppression."));
newMsg(WarnAlreadyFunction, Warning,
tr("\"%1\" already is a function."), 1);
Tr::tr("\"%1\" already is a function."), 1);
newMsg(WarnVarUsedBeforeDeclaration, Warning,
tr("var \"%1\" is used before its declaration."), 1);
Tr::tr("var \"%1\" is used before its declaration."), 1);
newMsg(WarnAlreadyVar, Warning,
tr("\"%1\" already is a var."), 1);
Tr::tr("\"%1\" already is a var."), 1);
newMsg(WarnDuplicateDeclaration, Warning,
tr("\"%1\" is declared more than once."), 1);
Tr::tr("\"%1\" is declared more than once."), 1);
newMsg(WarnFunctionUsedBeforeDeclaration, Warning,
tr("Function \"%1\" is used before its declaration."), 1);
Tr::tr("Function \"%1\" is used before its declaration."), 1);
newMsg(WarnBooleanConstructor, Warning,
msgInvalidConstructor("Boolean"));
newMsg(WarnStringConstructor, Warning,
@@ -119,124 +120,124 @@ StaticAnalysisMessages::StaticAnalysisMessages()
newMsg(WarnFunctionConstructor, Warning,
msgInvalidConstructor("Function"));
newMsg(HintAnonymousFunctionSpacing, Hint,
tr("The 'function' keyword and the opening parenthesis should be separated by a single space."));
Tr::tr("The 'function' keyword and the opening parenthesis should be separated by a single space."));
newMsg(WarnBlock, Warning,
tr("Do not use stand-alone blocks."));
Tr::tr("Do not use stand-alone blocks."));
newMsg(WarnVoid, Warning,
tr("Do not use void expressions."));
Tr::tr("Do not use void expressions."));
newMsg(WarnConfusingPluses, Warning,
tr("Confusing pluses."));
Tr::tr("Confusing pluses."));
newMsg(WarnConfusingMinuses, Warning,
tr("Confusing minuses."));
Tr::tr("Confusing minuses."));
newMsg(HintDeclareVarsInOneLine, Hint,
tr("Declare all function vars on a single line."));
Tr::tr("Declare all function vars on a single line."));
newMsg(HintExtraParentheses, Hint,
tr("Unnecessary parentheses."));
Tr::tr("Unnecessary parentheses."));
newMsg(MaybeWarnEqualityTypeCoercion, MaybeWarning,
tr("== and != may perform type coercion, use === or !== to avoid it."));
Tr::tr("== and != may perform type coercion, use === or !== to avoid it."));
newMsg(WarnConfusingExpressionStatement, Warning,
tr("Expression statements should be assignments, calls or delete expressions only."));
Tr::tr("Expression statements should be assignments, calls or delete expressions only."));
newMsg(HintDeclarationsShouldBeAtStartOfFunction, Hint,
tr("Place var declarations at the start of a function."));
Tr::tr("Place var declarations at the start of a function."));
newMsg(HintOneStatementPerLine, Hint,
tr("Use only one statement per line."));
Tr::tr("Use only one statement per line."));
newMsg(ErrUnknownComponent, Error,
tr("Unknown component."));
Tr::tr("Unknown component."));
newMsg(ErrCouldNotResolvePrototypeOf, Error,
tr("Could not resolve the prototype \"%1\" of \"%2\"."), 2);
Tr::tr("Could not resolve the prototype \"%1\" of \"%2\"."), 2);
newMsg(ErrCouldNotResolvePrototype, Error,
tr("Could not resolve the prototype \"%1\"."), 1);
Tr::tr("Could not resolve the prototype \"%1\"."), 1);
newMsg(ErrPrototypeCycle, Error,
tr("Prototype cycle, the last non-repeated component is \"%1\"."), 1);
Tr::tr("Prototype cycle, the last non-repeated component is \"%1\"."), 1);
newMsg(ErrInvalidPropertyType, Error,
tr("Invalid property type \"%1\"."), 1);
Tr::tr("Invalid property type \"%1\"."), 1);
newMsg(WarnEqualityTypeCoercion, Error,
tr("== and != perform type coercion, use === or !== to avoid it."));
Tr::tr("== and != perform type coercion, use === or !== to avoid it."));
newMsg(WarnExpectedNewWithUppercaseFunction, Error,
tr("Calls of functions that start with an uppercase letter should use 'new'."));
Tr::tr("Calls of functions that start with an uppercase letter should use 'new'."));
newMsg(WarnNewWithLowercaseFunction, Error,
tr("Use 'new' only with functions that start with an uppercase letter."));
Tr::tr("Use 'new' only with functions that start with an uppercase letter."));
newMsg(WarnNumberConstructor, Error,
msgInvalidConstructor("Function"));
newMsg(HintBinaryOperatorSpacing, Hint,
tr("Use spaces around binary operators."));
Tr::tr("Use spaces around binary operators."));
newMsg(WarnUnintentinalEmptyBlock, Error,
tr("Unintentional empty block, use ({}) for empty object literal."));
Tr::tr("Unintentional empty block, use ({}) for empty object literal."));
newMsg(HintPreferNonVarPropertyType, Hint,
tr("Use %1 instead of 'var' or 'variant' to improve performance."), 1);
Tr::tr("Use %1 instead of 'var' or 'variant' to improve performance."), 1);
newMsg(ErrMissingRequiredProperty, Error,
tr("Missing property \"%1\"."), 1);
Tr::tr("Missing property \"%1\"."), 1);
newMsg(ErrObjectValueExpected, Error,
tr("Object value expected."));
Tr::tr("Object value expected."));
newMsg(ErrArrayValueExpected, Error,
tr("Array value expected."));
Tr::tr("Array value expected."));
newMsg(ErrDifferentValueExpected, Error,
tr("%1 value expected."), 1);
Tr::tr("%1 value expected."), 1);
newMsg(ErrSmallerNumberValueExpected, Error,
tr("Maximum number value is %1."), 1);
Tr::tr("Maximum number value is %1."), 1);
newMsg(ErrLargerNumberValueExpected, Error,
tr("Minimum number value is %1."), 1);
Tr::tr("Minimum number value is %1."), 1);
newMsg(ErrMaximumNumberValueIsExclusive, Error,
tr("Maximum number value is exclusive."));
Tr::tr("Maximum number value is exclusive."));
newMsg(ErrMinimumNumberValueIsExclusive, Error,
tr("Minimum number value is exclusive."));
Tr::tr("Minimum number value is exclusive."));
newMsg(ErrInvalidStringValuePattern, Error,
tr("String value does not match required pattern."));
Tr::tr("String value does not match required pattern."));
newMsg(ErrLongerStringValueExpected, Error,
tr("Minimum string value length is %1."), 1);
Tr::tr("Minimum string value length is %1."), 1);
newMsg(ErrShorterStringValueExpected, Error,
tr("Maximum string value length is %1."), 1);
Tr::tr("Maximum string value length is %1."), 1);
newMsg(ErrInvalidArrayValueLength, Error,
tr("%1 elements expected in array value."), 1);
Tr::tr("%1 elements expected in array value."), 1);
newMsg(WarnImperativeCodeNotEditableInVisualDesigner, Warning,
tr("Imperative code is not supported in Qt Design Studio."));
Tr::tr("Imperative code is not supported in Qt Design Studio."));
newMsg(WarnUnsupportedTypeInVisualDesigner, Warning,
tr("This type (%1) is not supported in Qt Design Studio."), 1);
Tr::tr("This type (%1) is not supported in Qt Design Studio."), 1);
newMsg(WarnReferenceToParentItemNotSupportedByVisualDesigner, Warning,
tr("Reference to parent item cannot be resolved correctly by Qt Design Studio."));
Tr::tr("Reference to parent item cannot be resolved correctly by Qt Design Studio."));
newMsg(WarnUndefinedValueForVisualDesigner, Warning,
tr("This visual property binding cannot be evaluated in the local context "
"and might not show up in Qt Design Studio as expected."));
Tr::tr("This visual property binding cannot be evaluated in the local context "
"and might not show up in Qt Design Studio as expected."));
newMsg(WarnStatesOnlyInRootItemForVisualDesigner, Warning,
tr("Qt Design Studio only supports states in the root item."));
Tr::tr("Qt Design Studio only supports states in the root item."));
newMsg(ErrInvalidIdeInVisualDesigner, Error,
tr("This id might be ambiguous and is not supported in Qt Design Studio."));
Tr::tr("This id might be ambiguous and is not supported in Qt Design Studio."));
newMsg(ErrUnsupportedRootTypeInVisualDesigner, Error,
tr("This type (%1) is not supported as a root element by Qt Design Studio."), 1);
Tr::tr("This type (%1) is not supported as a root element by Qt Design Studio."), 1);
newMsg(ErrUnsupportedRootTypeInQmlUi, Error,
tr("This type (%1) is not supported as a root element of a UI file (.ui.qml)."), 1);
Tr::tr("This type (%1) is not supported as a root element of a UI file (.ui.qml)."), 1);
newMsg(ErrUnsupportedTypeInQmlUi, Error,
tr("This type (%1) is not supported in a UI file (.ui.qml)."), 1);
Tr::tr("This type (%1) is not supported in a UI file (.ui.qml)."), 1);
newMsg(ErrFunctionsNotSupportedInQmlUi, Error,
tr("Functions are not supported in a UI file (.ui.qml)."));
Tr::tr("Functions are not supported in a UI file (.ui.qml)."));
newMsg(ErrBlocksNotSupportedInQmlUi, Error,
tr("JavaScript blocks are not supported in a UI file (.ui.qml)."));
Tr::tr("JavaScript blocks are not supported in a UI file (.ui.qml)."));
newMsg(ErrBehavioursNotSupportedInQmlUi, Error,
tr("Behavior type is not supported in a UI file (.ui.qml)."));
Tr::tr("Behavior type is not supported in a UI file (.ui.qml)."));
newMsg(ErrStatesOnlyInRootItemInQmlUi, Error,
tr("States are only supported in the root item in a UI file (.ui.qml)."));
Tr::tr("States are only supported in the root item in a UI file (.ui.qml)."));
newMsg(ErrReferenceToParentItemNotSupportedInQmlUi, Error,
tr("Referencing the parent of the root item is not supported in a UI file (.ui.qml)."));
Tr::tr("Referencing the parent of the root item is not supported in a UI file (.ui.qml)."));
newMsg(ErrDoNotMixTranslationFunctionsInQmlUi, Error,
tr("Do not mix translation functions in a UI file (.ui.qml)."));
Tr::tr("Do not mix translation functions in a UI file (.ui.qml)."));
newMsg(StateCannotHaveChildItem, Error,
tr("A State cannot have a child item (%1)."), 1);
Tr::tr("A State cannot have a child item (%1)."), 1);
newMsg(WarnDuplicateImport, Warning,
tr("Duplicate import (%1)."), 1);
Tr::tr("Duplicate import (%1)."), 1);
newMsg(ErrHitMaximumRecursion, Error,
tr("Hit maximum recursion limit when visiting AST."));
Tr::tr("Hit maximum recursion limit when visiting AST."));
newMsg(ErrTypeIsInstantiatedRecursively, Error,
tr("Type cannot be instantiated recursively (%1)."), 1);
Tr::tr("Type cannot be instantiated recursively (%1)."), 1);
newMsg(WarnLogicalValueDoesNotDependOnValues, Warning,
tr("Logical value does not depend on actual values."));
Tr::tr("Logical value does not depend on actual values."));
newMsg(ErrToManyComponentChildren, Error,
tr("Components are only allowed to have a single child element."));
Tr::tr("Components are only allowed to have a single child element."));
newMsg(WarnComponentRequiresChildren, Warning,
tr("Components require a child element."));
Tr::tr("Components require a child element."));
newMsg(ErrAliasReferRoot, Error,
tr("Do not reference the root item as alias."));
Tr::tr("Do not reference the root item as alias."));
newMsg(WarnAliasReferRootHierarchy, Warning,
tr("Avoid referencing the root item in a hierarchy."));
Tr::tr("Avoid referencing the root item in a hierarchy."));
}
} // anonymous namespace

View File

@@ -9,6 +9,7 @@
#include "parser/qmljsengine_p.h"
#include "qmljsinterpreter.h"
#include "qmljstr.h"
#include "qmljsutils.h"
#include <utils/qtcassert.h>
@@ -69,18 +70,18 @@ QString TypeDescriptionReader::warningMessage() const
void TypeDescriptionReader::readDocument(UiProgram *ast)
{
if (!ast) {
addError(SourceLocation(), tr("Could not parse document."));
addError(SourceLocation(), Tr::tr("Could not parse document."));
return;
}
if (!ast->headers || ast->headers->next || !AST::cast<AST::UiImport *>(ast->headers->headerItem)) {
addError(SourceLocation(), tr("Expected a single import."));
addError(SourceLocation(), Tr::tr("Expected a single import."));
return;
}
UiImport *import = AST::cast<AST::UiImport *>(ast->headers->headerItem);
if (toString(import->importUri) != QLatin1String("QtQuick.tooling")) {
addError(import->importToken, tr("Expected import of QtQuick.tooling."));
addError(import->importToken, Tr::tr("Expected import of QtQuick.tooling."));
return;
}
@@ -88,24 +89,24 @@ void TypeDescriptionReader::readDocument(UiProgram *ast)
if (UiVersionSpecifier *uiVersion = import->version) {
version = ComponentVersion(import->version->majorVersion, import->version->minorVersion);
if (version.majorVersion() != 1) {
addError(uiVersion->majorToken, tr("Major version different from 1 not supported."));
addError(uiVersion->majorToken, Tr::tr("Major version different from 1 not supported."));
return;
}
}
if (!ast->members || !ast->members->member || ast->members->next) {
addError(SourceLocation(), tr("Expected document to contain a single object definition."));
addError(SourceLocation(), Tr::tr("Expected document to contain a single object definition."));
return;
}
UiObjectDefinition *module = AST::cast<UiObjectDefinition *>(ast->members->member);
if (!module) {
addError(SourceLocation(), tr("Expected document to contain a single object definition."));
addError(SourceLocation(), Tr::tr("Expected document to contain a single object definition."));
return;
}
if (toString(module->qualifiedTypeNameId) != QLatin1String("Module")) {
addError(SourceLocation(), tr("Expected document to contain a Module {} member."));
addError(SourceLocation(), Tr::tr("Expected document to contain a Module {} member."));
return;
}
@@ -161,12 +162,12 @@ void TypeDescriptionReader::readDependencies(UiScriptBinding *ast)
{
ExpressionStatement *stmt = AST::cast<ExpressionStatement*>(ast->statement);
if (!stmt) {
addError(ast->statement->firstSourceLocation(), tr("Expected dependency definitions"));
addError(ast->statement->firstSourceLocation(), Tr::tr("Expected dependency definitions"));
return;
}
ArrayPattern *exp = AST::cast<ArrayPattern *>(stmt->expression);
if (!exp) {
addError(stmt->expression->firstSourceLocation(), tr("Expected dependency definitions"));
addError(stmt->expression->firstSourceLocation(), Tr::tr("Expected dependency definitions"));
return;
}
for (PatternElementList *l = exp->elements; l; l = l->next) {
@@ -219,7 +220,7 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast)
}
if (fmo->className().isEmpty()) {
addError(ast->firstSourceLocation(), tr("Component definition is missing a name binding."));
addError(ast->firstSourceLocation(), Tr::tr("Component definition is missing a name binding."));
return;
}
@@ -250,7 +251,7 @@ void TypeDescriptionReader::readModuleApi(UiObjectDefinition *ast)
}
if (!apiInfo.version.isValid()) {
addError(ast->firstSourceLocation(), tr("ModuleApi definition has no or invalid version binding."));
addError(ast->firstSourceLocation(), Tr::tr("ModuleApi definition has no or invalid version binding."));
return;
}
@@ -287,7 +288,7 @@ void TypeDescriptionReader::readSignalOrMethod(UiObjectDefinition *ast, bool isM
}
if (fmm.methodName().isEmpty()) {
addError(ast->firstSourceLocation(), tr("Method or signal is missing a name script binding."));
addError(ast->firstSourceLocation(), Tr::tr("Method or signal is missing a name script binding."));
return;
}
@@ -307,7 +308,7 @@ void TypeDescriptionReader::readProperty(UiObjectDefinition *ast, FakeMetaObject
UiObjectMember *member = it->member;
UiScriptBinding *script = AST::cast<UiScriptBinding *>(member);
if (!script) {
addWarning(member->firstSourceLocation(), tr("Expected script binding."));
addWarning(member->firstSourceLocation(), Tr::tr("Expected script binding."));
continue;
}
@@ -327,7 +328,7 @@ void TypeDescriptionReader::readProperty(UiObjectDefinition *ast, FakeMetaObject
}
if (name.isEmpty() || type.isEmpty()) {
addError(ast->firstSourceLocation(), tr("Property object is missing a name or type script binding."));
addError(ast->firstSourceLocation(), Tr::tr("Property object is missing a name or type script binding."));
return;
}
@@ -342,7 +343,7 @@ void TypeDescriptionReader::readEnum(UiObjectDefinition *ast, FakeMetaObject::Pt
UiObjectMember *member = it->member;
UiScriptBinding *script = AST::cast<UiScriptBinding *>(member);
if (!script) {
addWarning(member->firstSourceLocation(), tr("Expected script binding."));
addWarning(member->firstSourceLocation(), Tr::tr("Expected script binding."));
continue;
}
@@ -365,7 +366,7 @@ void TypeDescriptionReader::readParameter(UiObjectDefinition *ast, FakeMetaMetho
UiObjectMember *member = it->member;
UiScriptBinding *script = AST::cast<UiScriptBinding *>(member);
if (!script) {
addWarning(member->firstSourceLocation(), tr("Expected script binding."));
addWarning(member->firstSourceLocation(), Tr::tr("Expected script binding."));
continue;
}
@@ -391,19 +392,19 @@ QString TypeDescriptionReader::readStringBinding(UiScriptBinding *ast)
QTC_ASSERT(ast, return QString());
if (!ast->statement) {
addError(ast->colonToken, tr("Expected string after colon."));
addError(ast->colonToken, Tr::tr("Expected string after colon."));
return QString();
}
ExpressionStatement *expStmt = AST::cast<ExpressionStatement *>(ast->statement);
if (!expStmt) {
addError(ast->statement->firstSourceLocation(), tr("Expected string after colon."));
addError(ast->statement->firstSourceLocation(), Tr::tr("Expected string after colon."));
return QString();
}
StringLiteral *stringLit = AST::cast<StringLiteral *>(expStmt->expression);
if (!stringLit) {
addError(expStmt->firstSourceLocation(), tr("Expected string after colon."));
addError(expStmt->firstSourceLocation(), Tr::tr("Expected string after colon."));
return QString();
}
@@ -415,20 +416,20 @@ bool TypeDescriptionReader::readBoolBinding(AST::UiScriptBinding *ast)
QTC_ASSERT(ast, return false);
if (!ast->statement) {
addError(ast->colonToken, tr("Expected boolean after colon."));
addError(ast->colonToken, Tr::tr("Expected boolean after colon."));
return false;
}
ExpressionStatement *expStmt = AST::cast<ExpressionStatement *>(ast->statement);
if (!expStmt) {
addError(ast->statement->firstSourceLocation(), tr("Expected boolean after colon."));
addError(ast->statement->firstSourceLocation(), Tr::tr("Expected boolean after colon."));
return false;
}
TrueLiteral *trueLit = AST::cast<TrueLiteral *>(expStmt->expression);
FalseLiteral *falseLit = AST::cast<FalseLiteral *>(expStmt->expression);
if (!trueLit && !falseLit) {
addError(expStmt->firstSourceLocation(), tr("Expected true or false after colon."));
addError(expStmt->firstSourceLocation(), Tr::tr("Expected true or false after colon."));
return false;
}
@@ -440,19 +441,19 @@ double TypeDescriptionReader::readNumericBinding(AST::UiScriptBinding *ast)
QTC_ASSERT(ast, return qQNaN());
if (!ast->statement) {
addError(ast->colonToken, tr("Expected numeric literal after colon."));
addError(ast->colonToken, Tr::tr("Expected numeric literal after colon."));
return 0;
}
ExpressionStatement *expStmt = AST::cast<ExpressionStatement *>(ast->statement);
if (!expStmt) {
addError(ast->statement->firstSourceLocation(), tr("Expected numeric literal after colon."));
addError(ast->statement->firstSourceLocation(), Tr::tr("Expected numeric literal after colon."));
return 0;
}
NumericLiteral *numericLit = AST::cast<NumericLiteral *>(expStmt->expression);
if (!numericLit) {
addError(expStmt->firstSourceLocation(), tr("Expected numeric literal after colon."));
addError(expStmt->firstSourceLocation(), Tr::tr("Expected numeric literal after colon."));
return 0;
}
@@ -464,19 +465,19 @@ ComponentVersion TypeDescriptionReader::readNumericVersionBinding(UiScriptBindin
ComponentVersion invalidVersion;
if (!ast || !ast->statement) {
addError((ast ? ast->colonToken : SourceLocation()), tr("Expected numeric literal after colon."));
addError((ast ? ast->colonToken : SourceLocation()), Tr::tr("Expected numeric literal after colon."));
return invalidVersion;
}
ExpressionStatement *expStmt = AST::cast<ExpressionStatement *>(ast->statement);
if (!expStmt) {
addError(ast->statement->firstSourceLocation(), tr("Expected numeric literal after colon."));
addError(ast->statement->firstSourceLocation(), Tr::tr("Expected numeric literal after colon."));
return invalidVersion;
}
NumericLiteral *numericLit = AST::cast<NumericLiteral *>(expStmt->expression);
if (!numericLit) {
addError(expStmt->firstSourceLocation(), tr("Expected numeric literal after colon."));
addError(expStmt->firstSourceLocation(), Tr::tr("Expected numeric literal after colon."));
return invalidVersion;
}
@@ -489,7 +490,7 @@ int TypeDescriptionReader::readIntBinding(AST::UiScriptBinding *ast)
int i = static_cast<int>(v);
if (i != v) {
addError(ast->firstSourceLocation(), tr("Expected integer after colon."));
addError(ast->firstSourceLocation(), Tr::tr("Expected integer after colon."));
return 0;
}
@@ -501,26 +502,26 @@ void TypeDescriptionReader::readExports(UiScriptBinding *ast, FakeMetaObject::Pt
QTC_ASSERT(ast, return);
if (!ast->statement) {
addError(ast->colonToken, tr("Expected array of strings after colon."));
addError(ast->colonToken, Tr::tr("Expected array of strings after colon."));
return;
}
ExpressionStatement *expStmt = AST::cast<ExpressionStatement *>(ast->statement);
if (!expStmt) {
addError(ast->statement->firstSourceLocation(), tr("Expected array of strings after colon."));
addError(ast->statement->firstSourceLocation(), Tr::tr("Expected array of strings after colon."));
return;
}
ArrayPattern *arrayLit = AST::cast<ArrayPattern *>(expStmt->expression);
if (!arrayLit) {
addError(expStmt->firstSourceLocation(), tr("Expected array of strings after colon."));
addError(expStmt->firstSourceLocation(), Tr::tr("Expected array of strings after colon."));
return;
}
for (PatternElementList *it = arrayLit->elements; it; it = it->next) {
StringLiteral *stringLit = AST::cast<StringLiteral *>(it->element->initializer);
if (!stringLit) {
addError(arrayLit->firstSourceLocation(), tr("Expected array literal with only string literal members."));
addError(arrayLit->firstSourceLocation(), Tr::tr("Expected array literal with only string literal members."));
return;
}
QString exp = stringLit->value.toString();
@@ -529,7 +530,7 @@ void TypeDescriptionReader::readExports(UiScriptBinding *ast, FakeMetaObject::Pt
ComponentVersion version(exp.mid(spaceIdx + 1));
if (spaceIdx == -1 || !version.isValid()) {
addError(stringLit->firstSourceLocation(), tr("Expected string literal to contain 'Package/Name major.minor' or 'Name major.minor'."));
addError(stringLit->firstSourceLocation(), Tr::tr("Expected string literal to contain 'Package/Name major.minor' or 'Name major.minor'."));
continue;
}
QString package;
@@ -547,19 +548,19 @@ void TypeDescriptionReader::readMetaObjectRevisions(UiScriptBinding *ast, FakeMe
QTC_ASSERT(ast, return);
if (!ast->statement) {
addError(ast->colonToken, tr("Expected array of numbers after colon."));
addError(ast->colonToken, Tr::tr("Expected array of numbers after colon."));
return;
}
ExpressionStatement *expStmt = AST::cast<ExpressionStatement *>(ast->statement);
if (!expStmt) {
addError(ast->statement->firstSourceLocation(), tr("Expected array of numbers after colon."));
addError(ast->statement->firstSourceLocation(), Tr::tr("Expected array of numbers after colon."));
return;
}
ArrayPattern *arrayLit = AST::cast<ArrayPattern *>(expStmt->expression);
if (!arrayLit) {
addError(expStmt->firstSourceLocation(), tr("Expected array of numbers after colon."));
addError(expStmt->firstSourceLocation(), Tr::tr("Expected array of numbers after colon."));
return;
}
@@ -568,19 +569,19 @@ void TypeDescriptionReader::readMetaObjectRevisions(UiScriptBinding *ast, FakeMe
for (PatternElementList *it = arrayLit->elements; it; it = it->next, ++exportIndex) {
NumericLiteral *numberLit = cast<NumericLiteral *>(it->element->initializer);
if (!numberLit) {
addError(arrayLit->firstSourceLocation(), tr("Expected array literal with only number literal members."));
addError(arrayLit->firstSourceLocation(), Tr::tr("Expected array literal with only number literal members."));
return;
}
if (exportIndex >= exportCount) {
addError(numberLit->firstSourceLocation(), tr("Meta object revision without matching export."));
addError(numberLit->firstSourceLocation(), Tr::tr("Meta object revision without matching export."));
return;
}
const double v = numberLit->value;
const int metaObjectRevision = static_cast<int>(v);
if (metaObjectRevision != v) {
addError(numberLit->firstSourceLocation(), tr("Expected integer."));
addError(numberLit->firstSourceLocation(), Tr::tr("Expected integer."));
return;
}
@@ -593,13 +594,13 @@ void TypeDescriptionReader::readEnumValues(AST::UiScriptBinding *ast, LanguageUt
if (!ast)
return;
if (!ast->statement) {
addError(ast->colonToken, tr("Expected object literal after colon."));
addError(ast->colonToken, Tr::tr("Expected object literal after colon."));
return;
}
auto *expStmt = AST::cast<ExpressionStatement *>(ast->statement);
if (!expStmt) {
addError(ast->statement->firstSourceLocation(), tr("Expected expression after colon."));
addError(ast->statement->firstSourceLocation(), Tr::tr("Expected expression after colon."));
return;
}
@@ -611,7 +612,7 @@ void TypeDescriptionReader::readEnumValues(AST::UiScriptBinding *ast, LanguageUt
continue;
}
}
addError(it->firstSourceLocation(), tr("Expected strings as enum keys."));
addError(it->firstSourceLocation(), Tr::tr("Expected strings as enum keys."));
}
} else if (auto *arrayLit = AST::cast<ArrayPattern *>(expStmt->expression)) {
for (PatternElementList *it = arrayLit->elements; it; it = it->next) {
@@ -621,10 +622,10 @@ void TypeDescriptionReader::readEnumValues(AST::UiScriptBinding *ast, LanguageUt
continue;
}
}
addError(it->firstSourceLocation(), tr("Expected strings as enum keys."));
addError(it->firstSourceLocation(), Tr::tr("Expected strings as enum keys."));
}
} else {
addError(ast->statement->firstSourceLocation(),
tr("Expected either array or object literal as enum definition."));
Tr::tr("Expected either array or object literal as enum definition."));
}
}

View File

@@ -8,9 +8,6 @@
#include <languageutils/fakemetaobject.h>
// for Q_DECLARE_TR_FUNCTIONS
#include <QCoreApplication>
QT_BEGIN_NAMESPACE
class QIODevice;
class QBuffer;
@@ -28,8 +25,6 @@ class UiScriptBinding;
class QMLJS_EXPORT TypeDescriptionReader
{
Q_DECLARE_TR_FUNCTIONS(QmlJS::TypeDescriptionReader)
public:
explicit TypeDescriptionReader(const QString &fileName, const QString &data);
~TypeDescriptionReader();

View File

@@ -8,6 +8,7 @@
#include <qmljs/qmljssimplereader.h>
#include <QCoreApplication>
#include <QString>