<div dir="ltr"><div dir="ltr">i had no problem using <a href="https://wiki.qt.io/How_to_do_dynamic_translation_in_QML">https://wiki.qt.io/How_to_do_dynamic_translation_in_QML</a> after disabling default sailfishapp translations<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">пн, 27 мая 2019 г. в 11:57, jerome levreau <<a href="mailto:levreau.jerome@vostoksystem.eu">levreau.jerome@vostoksystem.eu</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I came to the same issue I while time ago, also not being able (at least easily) to dynamically choose a key/translation at run time. I found no solution to those problems, adding lupdate/xml made me crazy I gave up and made/switched to my own translation api. <br></div><div>It uses key/value with mozilla properties file and it's full dynamics, that really close to the solution on java software. You can switch language at run time too (see the sample) I'm using it on Muuzik! Mem and Footo! app. Here the git :</div><div><br></div><div><a href="https://github.com/vostoksystem/vi18n" target="_blank">https://github.com/vostoksystem/vi18n</a></div><div><br></div><div>there a pri lib and a full sailfish sample app. <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 27 mai 2019 à 09:53, Joona Petrell <<a href="mailto:joona.petrell@jolla.com" target="_blank">joona.petrell@jolla.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:rgb(0,0,0);font-size:10pt">
<div>Hi Tamas,</div>
<div><br>
</div>
<div>Dynamic translations are tricky thing to accomplish in Qt. There is some support in Qt to accomplish dynamic language change inside a Qt app, but Qt-based platforms are a different story. Currently the work effort of allow language change during runtime
for a full platform like Sailfish OS is too large to justify the investment.</div>
<div><br>
</div>
<div>Apps normally follow platform system language, which when changed unfortunately currently does a full system reboot (though could be improved to only restart the system UI / desktop environment). If you provided settings in-app to choose different language
than the system you might be able to get some kind of dynamic translation setup to work, though if you are using Silica UI components those probably pull in some translations of their own and may not work with the dynamic translation setup.<br>
</div>
<div><br>
</div>
<div>Br,</div>
<div><br>
</div>
<div>Joona</div>
<div><br>
</div>
<div style="font-family:Times New Roman;color:rgb(0,0,0);font-size:16px">
<hr>
<div id="gmail-m_-1550152426743307753gmail-m_-6261045158164969820divRpF383436" style="direction:ltr"><font size="2" face="Tahoma" color="#000000"><b>From:</b> Devel [<a href="mailto:devel-bounces@lists.sailfishos.org" target="_blank">devel-bounces@lists.sailfishos.org</a>] on behalf of Андрей Кожевников [<a href="mailto:coderusinbox@gmail.com" target="_blank">coderusinbox@gmail.com</a>]<br>
<b>Sent:</b> 27 May 2019 10:41<br>
<b>To:</b> Sailfish OS Developers<br>
<b>Subject:</b> Re: [SailfishDevel] Dynamic QML refresh (localization)<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Hello!<br>
<br>
</div>
You should not use sailfishapp translations, because you won't be able to uninstall translator for default system language:<br>
<a href="https://github.com/sailfishos/libsailfishapp/blob/master/src/sailfishapp_priv.cpp#L107" rel="noopener noreferrer" target="_blank">https://github.com/sailfishos/libsailfishapp/blob/master/src/sailfishapp_priv.cpp#L107</a><br>
<br>
</div>
<div>You can copy prf content to your pro file and install translations to different folder, not translations one, so sailfishapp wont preload default translator<br>
<a href="https://github.com/sailfishos/libsailfishapp/blob/master/data/sailfishapp_i18n.prf" rel="noopener noreferrer" target="_blank">https://github.com/sailfishos/libsailfishapp/blob/master/data/sailfishapp_i18n.prf</a><br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">вс, 26 мая 2019 г. в 23:39, Tamas Miklos <<a href="mailto:uusi@freemail.hu" rel="noopener noreferrer" target="_blank">uusi@freemail.hu</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi,<br>
<br>
<br>
Is it possible to dynamically update QML strings after a language change initiated by the user from the Settings page of my app? In QT there's a QqmlEngine::retranslate() call, but I couldn't find a way to use that from a Sailfish app. I've found the following
page as well, but it seems way too overkill to my liking :)<br>
<br>
<a href="https://wiki.qt.io/How_to_do_dynamic_translation_in_QML" rel="noreferrer" target="_blank">https://wiki.qt.io/How_to_do_dynamic_translation_in_QML</a><br>
<br>
I've also found some apps to use the PageStack replace trick to refresh an already rendered QML page after language change, but it also seems too quirky to me.<br>
<br>
Please let me know what's the best way to achieve a user-friendly way of changing language of my app on-the-fly.<br>
<br>
<br>
Thanks,<br>
Tamas (author of AIDA64 for Sailfish)<br>
<br>
_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" rel="noopener noreferrer" target="_blank">
devel-unsubscribe@lists.sailfishos.org</a></blockquote>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.sailfishos.org</a></blockquote></div>
_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.sailfishos.org</a></blockquote></div>