<div dir="ltr"><div>Thanks for replying. We're currently using cx_freeze to freeze our python scripts into exe and then we use InstallShield for creating windows installer. We are also making the application compatible for Mac with Py2App. </div><div><br></div><div>It looks like decrypting the data dynamically and use loadFromData seems to be the only way for this use case. It would be great if anybody can share a minimal example of using loadFromData.</div><div><br></div>Thanks,<div>Jeba</div><div><br></div><div><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 30/04/2015 03:51, Jebagnana Das wrote:<br>
> Dear Team,<br>
><br>
> We are writing a PyQt application with multi language support.<br>
><br>
> *_Option 1:_*<br>
><br>
> We are thinking about providing the language (.qm) files separately probably<br>
> within the installation folder of our application exe due to the following reasons<br>
><br>
> 1. If any new feature is added we can release it right away without waiting<br>
> for the translated strings in 20+ languages. Later when the translation file<br>
> arrives the agent can pull the latest file from the server when it communicates<br>
><br>
> 2. If any changes or corrections are made in the existing translations it can<br>
> also be instantly applied with the above technique.<br>
><br>
> But the qm files can be editable and the user can play around with it and can<br>
> replace the original translation with some offensive language with the intent<br>
> of damaging the reputation of the product.<br>
<br>
Depending on the permissions. Maybe the user has no root rights on the PC.<br>
<br>
> *_Option 2:_*<br>
><br>
> I read about another option of converting them as a QtResource file and derive<br>
> a python resource file out of it which will be bundled within the exe itself.<br>
> The cons of this approach are<br>
><br>
> 1. We will be forced to hold the release until all the translated files arrive<br>
> from different translators<br>
><br>
> 2. If any alterations are made in the existing translations, we need to update<br>
> or provide auto-upgrade for the existing exe to reflect the changes which will<br>
> consume more server and agent bandwidth(in MBs) as opposed to updating only<br>
> the translation files(few KBs) and exe upgrdation is cumbersome and costlier<br>
> when we weigh it with all the inherent complexities involved.<br>
><br>
> Any solution for resolving this use-case would be highly appreciated.<br>
<br>
First, you're talking about "exe". You mean windows only? You want to use<br>
pyqtdeploy?<br>
<br>
QTranslator has a loadFromData which loads translations from an arbitrary<br>
string buffer. You can encrypt the .qm files and decrypt them before feeding<br>
the QTranslator(s).<br>
<br>
--<br>
             Giuseppe Corbelli<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
WASP Software Engineer, Copan Italia S.p.A<br>
Phone: +390303666318  Fax: +390302659932<br>
E-mail: <a href="mailto:giuseppe.corbelli@copanitalia.com">giuseppe.corbelli@copanitalia.com</a><br></blockquote></div></div></div></div>