<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[translate in qml and C++]]></title><description><![CDATA[<p dir="auto">Hello good day, I have a question about what is happening to me, I am using a QML application that receives the label texts from C++, and I want to translate these texts, I apply my .ts and .qm file and only the QML texts are translated ( I added qsTr("text")), in C++ I have placed tr and QT_TR_NOOP but none sends me the translated, my labels are in their original language. What could I do? Thank you very much for your time and have a nice day!!!</p>
]]></description><link>https://forum.qt.io/topic/140391/translate-in-qml-and-c</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 09:28:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/140391.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Oct 2022 17:10:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to translate in qml and C++ on Tue, 01 Nov 2022 19:00:32 GMT]]></title><description><![CDATA[<p dir="auto">Hello, in case it helps someone in the future, I was able to solve it by changing the way of installing the translation, since I have several classes and it was not applied to any of them.<br />
I changed the app.installTranslator(&amp;_translator);<br />
by: QCoreApplication::installTranslator(&amp;_translator);</p>
]]></description><link>https://forum.qt.io/post/734738</link><guid isPermaLink="true">https://forum.qt.io/post/734738</guid><dc:creator><![CDATA[Pueablo]]></dc:creator><pubDate>Tue, 01 Nov 2022 19:00:32 GMT</pubDate></item><item><title><![CDATA[Reply to translate in qml and C++ on Sat, 29 Oct 2022 19:34:15 GMT]]></title><description><![CDATA[<p dir="auto">Did you already check this <a href="https://doc.qt.io/qt-6/qtqml-qml-i18n-example.html" target="_blank" rel="noopener noreferrer nofollow ugc">example</a> ?</p>
<p dir="auto">The translation handling is not the same between Qt Quick and pure C++ applications.</p>
]]></description><link>https://forum.qt.io/post/734497</link><guid isPermaLink="true">https://forum.qt.io/post/734497</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 29 Oct 2022 19:34:15 GMT</pubDate></item><item><title><![CDATA[Reply to translate in qml and C++ on Fri, 28 Oct 2022 20:12:41 GMT]]></title><description><![CDATA[<p dir="auto">sorry, in the main.cpp file followed by "QQmlApplicationEngine engine;"</p>
<p dir="auto">QQmlApplicationEngine engine;<br />
QTranslator _translator;<br />
_translator.load(":/traducciones/ingles");<br />
app.installTranslator(&amp;_translator);</p>
]]></description><link>https://forum.qt.io/post/734432</link><guid isPermaLink="true">https://forum.qt.io/post/734432</guid><dc:creator><![CDATA[Pueablo]]></dc:creator><pubDate>Fri, 28 Oct 2022 20:12:41 GMT</pubDate></item><item><title><![CDATA[Reply to translate in qml and C++ on Fri, 28 Oct 2022 19:40:05 GMT]]></title><description><![CDATA[<p dir="auto">That does not answer my original question, when/how are you loading the translator ?</p>
]]></description><link>https://forum.qt.io/post/734430</link><guid isPermaLink="true">https://forum.qt.io/post/734430</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 28 Oct 2022 19:40:05 GMT</pubDate></item><item><title><![CDATA[Reply to translate in qml and C++ on Fri, 28 Oct 2022 19:30:58 GMT]]></title><description><![CDATA[<p dir="auto">hello, in C++ I do it with tr("text to translate") and in qml I do it with qsTr("text to translate"). The .ts file does detect the text for me, only that when applying the translation the text is in the original language.</p>
<p dir="auto">Something to add is that I added the text to a component in C++ and then send it to QML to print.</p>
]]></description><link>https://forum.qt.io/post/734427</link><guid isPermaLink="true">https://forum.qt.io/post/734427</guid><dc:creator><![CDATA[Pueablo]]></dc:creator><pubDate>Fri, 28 Oct 2022 19:30:58 GMT</pubDate></item><item><title><![CDATA[Reply to translate in qml and C++ on Fri, 28 Oct 2022 18:51:50 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">How are you changing the language of your application.</p>
]]></description><link>https://forum.qt.io/post/734422</link><guid isPermaLink="true">https://forum.qt.io/post/734422</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 28 Oct 2022 18:51:50 GMT</pubDate></item></channel></rss>