Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.6.3
-
* Windows 8.1
* Qt 5.6.3
* Visual Studio 2015
Description
lupdate behaves differently when encountering the escape sequence \n in translation comments in C++ or QML.
For example, the QML
foo.qml
import QtQuick 2.6 Item { /*% "Test\ntext" */ /*: Some translation comment\n with line break. */ property string dummyText: qsTrId("myTextId") }
produces a message in the .ts file like this:
<message id="myTextId"> <source>Test\ntext</source> <extracomment>Some translation comment\n with line break.</extracomment> <translation type="unfinished"></translation> </message>
So the \n are not interpreted but taken literally.
While the same translation comment in C++
foo.cpp
/*% "Test\ntext" */ /*: Some translation comment\n with line break. */ static QString myText = qtTrId("myTextId");
produces a message like this:
<message id="myTextId"> <source>Test text</source> <extracomment>Some translation comment with line break.</extracomment> <translation type="unfinished"></translation> </message>
So the \n are converted to line breaks.
Steps to reproduce:
- Run lupdate on the above given foo.qml or foo.cpp:
lupdate foo.qml -ts foo-qml.ts lupdate foo.cpp -ts foo-cpp.ts
Expected Behavior:
Identical translation comments should produce the same message in the .ts files.
Attachments
Issue Links
- depends on
-
QTBUG-40639 lupdate does not expand escape sequences in meta strings for qsTrId()
- Closed
- is duplicated by
-
QTBUG-67831 lupdate: line feeds in //% are passed through as escaped characters
- Closed