Translation string - new line character
-
Did you try adding \n where you require ?
-
yes,I tried adding \n to the string in the .ts file. But it's not reflecting in the application.
-
In addition to what @J-Hilk said, from where do you pick these strings ? Are they part source files ? Did you try adding the new line there itself ?
-
In addition to what @J-Hilk said, from where do you pick these strings ? Are they part source files ? Did you try adding the new line there itself ?
-
Don't directly open the translation file. As @J-Hilk already suggested did you try open the file in linguist & hit the enter button in the "Source Text" ? After that you save your file. If not add this new line in source code only.
-
Don't directly open the translation file. As @J-Hilk already suggested did you try open the file in linguist & hit the enter button in the "Source Text" ? After that you save your file. If not add this new line in source code only.
@dheerendra how will i add the new line character in the source code directly if it is resource string ID?
-
where are you strings ? Are they in some file ? You can directly do there. How are you doing the translations ? Using linguist ?
-
where are you strings ? Are they in some file ? You can directly do there. How are you doing the translations ? Using linguist ?
@dheerendra strings are nothing but the <translation> ryt? They are not there in some other file. Not using linguist for editing the .ts file
-
@dheerendra strings are nothing but the <translation> ryt? They are not there in some other file. Not using linguist for editing the .ts file
@Sandhiya said in Translation string - new line character:
strings are nothing but the <translation> ryt? They are not there in some other file
Could you please show some source code snippet about how you're using the strings in your Qt application?
-
@Sandhiya said in Translation string - new line character:
strings are nothing but the <translation> ryt? They are not there in some other file
Could you please show some source code snippet about how you're using the strings in your Qt application?
@Pablo-J.-Rogina
QML file:
Label{
text:qsTrId("text_id")
}.ts file:
<message id = "tex_id">
<location filename="fileLocation"/>
<translation>Please file \n the text field</translation>
</message>This is the snippet of how I am using the strings
-
@Pablo-J.-Rogina
QML file:
Label{
text:qsTrId("text_id")
}.ts file:
<message id = "tex_id">
<location filename="fileLocation"/>
<translation>Please file \n the text field</translation>
</message>This is the snippet of how I am using the strings
@Sandhiya are you sure you created .qm files with
lupdate -idbased your_project.pro
This snippet is working fine
Window { visible: true width: 640 height: 480 title: qsTrId("title_id") Label { text: qsTrId("text_id") } }
when edited with Linguist, I just pressed Enter when I wanted the line break
showing in app great:
-
@Sandhiya are you sure you created .qm files with
lupdate -idbased your_project.pro
This snippet is working fine
Window { visible: true width: 640 height: 480 title: qsTrId("title_id") Label { text: qsTrId("text_id") } }
when edited with Linguist, I just pressed Enter when I wanted the line break
showing in app great:
@Pablo-J.-Rogina Yeah ..it's working fine now. I actually missed a trick there. Thanks a lot for your help.
-
where are you strings ? Are they in some file ? You can directly do there. How are you doing the translations ? Using linguist ?
@dheerendra Thanks for your help..
-
This is what we were asking you. It is as simple as hitting the enter button in source text when we require new line. Now issue is resolved move the case to solved state.
-
@Pablo-J.-Rogina Yeah ..it's working fine now. I actually missed a trick there. Thanks a lot for your help.
@Sandhiya said in Translation string - new line character:
I actually missed a trick there.
which was...? could you please describe it? As mentioned before, please don't forget to mark your post as solved.
-
@Sandhiya are you sure you created .qm files with
lupdate -idbased your_project.pro
This snippet is working fine
Window { visible: true width: 640 height: 480 title: qsTrId("title_id") Label { text: qsTrId("text_id") } }
when edited with Linguist, I just pressed Enter when I wanted the line break
showing in app great:
@Pablo-J.-Rogina Also i have same type issue which I fixed on one way to after next line character put on next line like below.
<message>
<translation>Please file
the text field</translation>
</message>Could you please explain how is it working with your solutions "lupdate -idbased your_project.pro"
-
@Pablo-J.-Rogina Also i have same type issue which I fixed on one way to after next line character put on next line like below.
<message>
<translation>Please file
the text field</translation>
</message>Could you please explain how is it working with your solutions "lupdate -idbased your_project.pro"
@Dhiru I don't understand your question in full, but the -idbased parameter is used when the original string i.e. what's enclosed in tr() method is a text id, not the full text