<?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[Couldn&#x27;t loading the Translation properly at runtime..!]]></title><description><![CDATA[<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/44117d39-16e4-4912-b257-cbe2a24b6fbf.png" alt="1st.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It is the first image showing selection option for the change language, when i clicked upon german language ,</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/0725061e-d7fd-4cd2-9c72-12b461312f0c.png" alt="2nd.png" class=" img-fluid img-markdown" /><br />
only some words are changing as you can see , but when i went to the next dialog of the project translation is working fine , coming back to the previous page now ,<br />
<img src="https://ddgobkiprc33d.cloudfront.net/6ff04a89-f429-46dd-9801-6258ed2aedf9.png" alt="3rd.png" class=" img-fluid img-markdown" /><br />
you can see the translation is working properly now,</p>
<p dir="auto">Why..?</p>
<p dir="auto"><strong>Translation.cpp</strong> //is like this i'm integrating the C++, as i'm using the  //QCoreApplication<br />
Translation::Translation(QQmlApplicationEngine *engines)<br />
{<br />
translator = new QTranslator;<br />
engine = engines;<br />
}</p>
<p dir="auto">void Translation::languageSelect(QString language)<br />
{<br />
qDebug()&lt;&lt;"Language"&lt;&lt;language;<br />
if(language == "German")<br />
{<br />
translator-&gt;load(":/translator/GermanTranslate_GE.qm");<br />
QCoreApplication::instance()-&gt;installTranslator(translator);<br />
engine-&gt;retranslate();<br />
}<br />
else if(language == "English")<br />
{<br />
translator-&gt;load("");<br />
QCoreApplication::instance()-&gt;installTranslator(translator);<br />
engine-&gt;retranslate();<br />
}<br />
}</p>
<p dir="auto">Qt Creator version : 5.10<br />
Platform : mac os</p>
]]></description><link>https://forum.qt.io/topic/110213/couldn-t-loading-the-translation-properly-at-runtime</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Nov 2026 12:42:23 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/110213.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 31 Dec 2019 05:57:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Couldn&#x27;t loading the Translation properly at runtime..! on Sun, 05 Jan 2020 14:44:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/rrlopez">@<bdi>rrlopez</bdi></a> ,<br />
Sorry for the late response , Thank you so much for the reply,<br />
It was a very new concept i learned , thank you for your suggestions , my translation project  is working perfectly now.</p>
]]></description><link>https://forum.qt.io/post/570529</link><guid isPermaLink="true">https://forum.qt.io/post/570529</guid><dc:creator><![CDATA[Kiranachari Shilpi]]></dc:creator><pubDate>Sun, 05 Jan 2020 14:44:43 GMT</pubDate></item><item><title><![CDATA[Reply to Couldn&#x27;t loading the Translation properly at runtime..! on Thu, 02 Jan 2020 14:32:08 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/kiranachari-shilpi">@<bdi>Kiranachari-Shilpi</bdi></a>, what I think its going on is that when you are appending the settingsMenu items to settingsModel, you are not directly creating a binding between the model and the data, hence any change on the language will not affect the settingsModel items. Javascript is not that good when you want to keep bindings on your QML, either properties or any other kind of change (like language changes in this case). I believe you would have to re-run your Component.onCompleted logic to make it re-translate and re-add the items to the settingsModel.<br />
Other way around that will not need this, is to append on the settingsMenu only the bare strings...<br />
i.e. var settingsMenu = ["Settings" , "Change Language" , “Options” , "Quit"]<br />
And on your QML file use qsTr(modelItem).</p>
]]></description><link>https://forum.qt.io/post/570087</link><guid isPermaLink="true">https://forum.qt.io/post/570087</guid><dc:creator><![CDATA[rrlopez]]></dc:creator><pubDate>Thu, 02 Jan 2020 14:32:08 GMT</pubDate></item><item><title><![CDATA[Reply to Couldn&#x27;t loading the Translation properly at runtime..! on Thu, 02 Jan 2020 12:32:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rrlopez">@<bdi>rrlopez</bdi></a> I tried with QTBUG according to this BUG working correctly in Qt 5.12 , but with number of screens and components i'm using to create ListView, i want to use different list items every time for each and every screens, as i'm facing same issue for translation as i'm posted above.</p>
<p dir="auto">Two Components are like this</p>
<p dir="auto"><strong>Component1.qml</strong>	//here i’m adding list items</p>
<hr />
<p dir="auto">Component.onCompleted{<br />
var settingsMenu = [qsTr("Settings") , qsTr("Change Language") , qsTr(“Options”) , qsTr("Quit")]</p>
<pre><code>for(var i=0;i&lt;settingsMenu.length;i++){
             component2.addmenu(settingsMenu[i]);
      	}
}
</code></pre>
<p dir="auto"><strong>Component2.qml</strong></p>
<hr />
<p dir="auto">//function call for appending the ListModel Elements<br />
Item{<br />
id:component2<br />
function addmenu(user){		<br />
settingsModel.append({menu:user});<br />
}</p>
<p dir="auto">ListView{<br />
id:settingslist<br />
width: parent.width<br />
height:parent.height<br />
delegate:Rectangle{<br />
Text{<br />
text: menu<br />
}<br />
model: settingsModel<br />
}<br />
ListModel{<br />
id:settingsModel<br />
}<br />
}</p>
<p dir="auto"><strong>Qt Version:</strong> 5.12<br />
<strong>Platform :</strong> Windows</p>
<p dir="auto">Help me to reach out from this runtime error...<br />
Thanks In advance.</p>
]]></description><link>https://forum.qt.io/post/570064</link><guid isPermaLink="true">https://forum.qt.io/post/570064</guid><dc:creator><![CDATA[Kiranachari Shilpi]]></dc:creator><pubDate>Thu, 02 Jan 2020 12:32:25 GMT</pubDate></item><item><title><![CDATA[Reply to Couldn&#x27;t loading the Translation properly at runtime..! on Wed, 01 Jan 2020 13:04:58 GMT]]></title><description><![CDATA[<p dir="auto">hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/rrlopez">@<bdi>rrlopez</bdi></a> Thank you for the information i tried this bug on both lower and 5.12 versions of Qt Creator , it was working fine in 5.12 version .</p>
]]></description><link>https://forum.qt.io/post/569910</link><guid isPermaLink="true">https://forum.qt.io/post/569910</guid><dc:creator><![CDATA[Kiranachari Shilpi]]></dc:creator><pubDate>Wed, 01 Jan 2020 13:04:58 GMT</pubDate></item><item><title><![CDATA[Reply to Couldn&#x27;t loading the Translation properly at runtime..! on Tue, 31 Dec 2019 17:48:51 GMT]]></title><description><![CDATA[<p dir="auto">I've had issues with translation before as well. Somehow, retranslate does not notify QML properly of the text changes, hence QML does not repaint all the strings correctly. There is a bug on QT that was fixed in 5.12:<br />
<a href="https://bugreports.qt.io/browse/QTBUG-68350" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt.io/browse/QTBUG-68350</a></p>
<p dir="auto">However, there is a workaround for this. You can create a Q_PROPERTY with an empty string and define all your strings in terms of that empty string.<br />
i.e.</p>
<p dir="auto">readonly property string stringOne: qsTr("stringOne") + emptyStr</p>
<p dir="auto">Where emptyStr is a Q_PROPERTY with an empty string.</p>
<p dir="auto">Every time you run the reTranslate function, update this empty string with a new empty string. This will force QML to repaint all the strings and your translation will work fine.</p>
]]></description><link>https://forum.qt.io/post/569843</link><guid isPermaLink="true">https://forum.qt.io/post/569843</guid><dc:creator><![CDATA[rrlopez]]></dc:creator><pubDate>Tue, 31 Dec 2019 17:48:51 GMT</pubDate></item></channel></rss>