Question on translations and .ts files
Solved
General and Desktop
-
My current .ts file looks like
<context> <name>A</name> <message> <location filename="A.qml" line="10"/> <source>History</source> <translation>Historique</translation> </message>
I note that qsTr("History")
- translates fine in A.qml, line 10
- translates fine in A.qml, any other line
- does not translate in B.qml (there is no entry yet in the .ts file for B)
Is this expected behavior?
-
@Marc_Van_Daele said in Question on translations and .ts files:
Is this expected behavior?
yes it is,
each source file (c++ or qml) has it's own
context
blockby running
lupdate
on your project, a context block will be created forb
. Then there will be an automatic check for similar heuristics, and the translation in A will be detected and preselected for you.IIRC running
lrelease
now will result inA
andB
being correctly translated, even without confirming the preselected translation before via (Qt)Linguist -
Thanks for confirming and explaining!