<?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[QTranslator do not work at all]]></title><description><![CDATA[<p dir="auto">os : windows 10 64 bits<br />
Qt : 5.9.4, vc2017 64bits</p>
<ol start="0">
<li>Wrap the text by tr or QObject::tr.</li>
<li>Generate the ts file,</li>
<li>Translate almost every words of the ts file(some of them are left empty).</li>
<li>Run lrelease to generate qm file</li>
<li>Load the qm file as following</li>
</ol>
<pre><code>QTranslator custom_translator_;
qDebug()&lt;&lt;__func__&lt;&lt;a.applicationDirPath();
if(custom_translator_.load("english_to_turkish.qm", a.applicationDirPath())){
    qDebug()&lt;&lt;__func__&lt;&lt;"can load english to turkish";
    if(a.installTranslator(&amp;custom_translator_)){
        qDebug()&lt;&lt;__func__&lt;&lt;"can install translator";
    }else{
        qDebug()&lt;&lt;__func__&lt;&lt;"cannot install translator";
    }
}else{
    qDebug()&lt;&lt;__func__&lt;&lt;"cannot load english to turkish";
}
</code></pre>
<p dir="auto">The return values tell me qm file can be loaded and installed, but none of the text are translated to Turkish, every words remain as English. Any possible wrong I commit? Thanks</p>
]]></description><link>https://forum.qt.io/topic/95433/qtranslator-do-not-work-at-all</link><generator>RSS for Node</generator><lastBuildDate>Fri, 23 Oct 2026 01:03:28 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/95433.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Oct 2018 06:33:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QTranslator do not work at all on Wed, 10 Oct 2018 07:00:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a> Yes.</p>
<p dir="auto">I find out the issue, the problem is life time, I put the QTranslator in a class, and that class is enclosed by {}, that is why the text did not translated, a stupid bug.</p>
]]></description><link>https://forum.qt.io/post/486101</link><guid isPermaLink="true">https://forum.qt.io/post/486101</guid><dc:creator><![CDATA[tham]]></dc:creator><pubDate>Wed, 10 Oct 2018 07:00:13 GMT</pubDate></item><item><title><![CDATA[Reply to QTranslator do not work at all on Wed, 10 Oct 2018 06:43:38 GMT]]></title><description><![CDATA[<p dir="auto">Do you install your translations before instantiating the GUI or after?</p>
]]></description><link>https://forum.qt.io/post/486096</link><guid isPermaLink="true">https://forum.qt.io/post/486096</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Wed, 10 Oct 2018 06:43:38 GMT</pubDate></item></channel></rss>