<div dir="ltr">When running from Qt Creator the locale is always C, when clicking the app button on the emulator then the locale is right. I also run my app from the emulator through ssh with something like : LC_ALL="fr_FR.UTF-8" my_app to test different locales.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jan 12, 2014 at 12:20 PM, Unai IRIGOYEN <span dir="ltr"><<a href="mailto:u.irigoyen@gmail.com" target="_blank">u.irigoyen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, I'm replying to myself here and for reference in case someone else is<br>
disappointed. I launched the app from Jolla's app menu and found out it was<br>
translated so in fact this only happens when running from QtCreator.<br>
<span class="HOEnZb"><font color="#888888">--<br>
<br>
Unai IRIGOYEN<br>
<br>
Le dimanche 12 janvier 2014 17:54:50, vous avez écrit :<br>
</font></span><div class="im HOEnZb">> I followed those steps to try to fix my app translations but<br>
> QLocale::system() still returns "C". Am I the only one in this case?<br>
> I'm running my app on Jolla so it's not a problem with emulator.<br>
><br>
</div><div class="HOEnZb"><div class="h5">> > you can use any /usr/share/appname location. use qm file with<br>
> > QTranslator and install translator to QGuiApplication<br>
> ><br>
> > qsTr is enough<br>
> ><br>
> > you can use LC_ALL<br>
> ><br>
> > On 03.01.2014 02:26, Franck Routier (perso) wrote:<br>
> > > -----BEGIN PGP SIGNED MESSAGE-----<br>
> > > Hash: SHA1<br>
> > ><br>
> > > Ok, now I have .ts file, I did translate the strings, and produced the<br>
> > > .qm file.<br>
> > ><br>
> > > So my next questions are:<br>
> > > 1) how do I include the qm file in the rpm ? Should I put it in a<br>
> > > specific directory, or directly in /usr/share/MyApp ?<br>
> > ><br>
> > > 2) is there something special I need to do in my app to trigger the<br>
> > > magic, or is using qsTr() in the qml files sufficient to to make it<br>
> > > happen ?<br>
> > ><br>
> > > 3) Is there a way I can test if it is working from within the SDK (I<br>
> > > did not receive my device yet...) ? Should I ssh into the emulator and<br>
> > > play with LC_ALL, or is there another way ?<br>
> > ><br>
> > > Thanks in advance,<br>
> > ><br>
> > > Franck<br>
> > ><br>
> > > Le 02/01/2014 21:02, Andrey Kozhevnikov a écrit :<br>
> > >> for directly use lupdare/lrelease you need to chroot to target<br>
> > >> (inside VM):<br>
> > >><br>
> > >> sb2 -t SailfishOS-armv7hl -s sdk-install<br>
> > >><br>
> > >> On 03.01.2014 02:00, Franck Routier (perso) wrote: I finally used<br>
> > >> the lupdate binary found in the Harmattan SDK somewhere on my hard<br>
> > >> disk.<br>
> > >><br>
> > >> Also, to make it process qml files, I used this trick<br>
> > >> (<a href="https://developer.nokia.com/Community/Wiki/Lupdate_with_qml_files" target="_blank">https://developer.nokia.com/Community/Wiki/Lupdate_with_qml_files</a>),<br>
> > ><br>
> > > which consists in listing the qml files this way in the .pro file:<br>
> > >> evil_hack_to_fool_lupdate { SOURCES += \ qml/Splash.qml \<br>
> > >> qml/Login.qml \ ... }<br>
> > >><br>
> > >> Notice that running lupdate with a ts.list file as Andrey<br>
> > >> suggested failed with a message telling me the files had a "no<br>
> > >> recognized extension."<br>
> > >><br>
> > >> Ok, this did the trick for now, but I'm still wondering how this<br>
> > >> is supposed to work from within the SailfishOS SDK...<br>
> > >><br>
> > >> Best regards,<br>
> > >><br>
> > >> Franck<br>
> > >><br>
> > >> Le 02/01/2014 19:11, Andrey Kozhevnikov a écrit :<br>
> > >>>>> i'm always using self-created ts.list text file with list of<br>
> > >>>>> paths to files contains strings<br>
> > >>>>><br>
> > >>>>> and my lupdate syntax:<br>
> > >>>>><br>
> > >>>>> lupdate -verbose -ts languages/en_US.ts @ts.list<br>
> > >>>>><br>
> > >>>>> On 02.01.2014 23:44, Franck Routier (perso) wrote:<br>
> > >>>>>> Le 02/01/2014 18:37, Andrey Kozhevnikov a écrit :<br>
> > >>>>>>> its inside build machine. qmake will run lupdate/lrelease<br>
> > >>>>>>> from internal path.<br>
> > >>>>>><br>
> > >>>>>> Ok, I understand. So I have to start the MerSDK virtual<br>
> > >>>>>> machine for lupdate to work.<br>
> > >>>>>><br>
> > >>>>>> Then, shouldn't it generate some .ts file in my project ?<br>
> > >>>>>> (its the first time I use QT Linguist, still learning,<br>
> > >>>>>> thanks for your patience)<br>
> > >>>>>><br>
> > >>>>>><br>
> > >>>>>> Regards, Franck<br>
> > >>>>>> _______________________________________________<br>
> > >>>>>> SailfishOS.org Devel mailing list<br>
> > >>>>><br>
> > >>>>> _______________________________________________<br>
> > >>>>> SailfishOS.org Devel mailing list<br>
> > >>><br>
> > >>> _______________________________________________ SailfishOS.org<br>
> > >>> Devel mailing list<br>
> > >><br>
> > >> _______________________________________________ SailfishOS.org<br>
> > >> Devel mailing list<br>
> > ><br>
> > > -----BEGIN PGP SIGNATURE-----<br>
> > > Version: GnuPG v1.4.14 (GNU/Linux)<br>
> > > Comment: Using GnuPG with Thunderbird - <a href="http://www.enigmail.net/" target="_blank">http://www.enigmail.net/</a><br>
> > ><br>
> > > iQEcBAEBAgAGBQJSxcuOAAoJEGEvoAir78Ro8ucIANB8cgLDVhuh3W2vwGay83iL<br>
> > > PLA1N/Js18e6VkGR80XPCarC/vvUGPbrdag5+OhGsWGNPGjX85mUMXVde8tgVTBa<br>
> > > FA/2s8E24YJsGAATOHIPBp161uxEU6iPDFmteBa1m/5Ze34DHpc4aeye62/eagy7<br>
> > > 9l6sJdDd7C/jAdCUpHwrLBaYjkkDM2DpVgRLdQ3/Q1MksgFSwWxESrwbfsvrplcb<br>
> > > XYM5KHpCAGPnq95nAjYshkQk2Ca6/B245ZChq5OfjbMDilGWwHThQzLbcB215icM<br>
> > > 3A4RrxWNDoNcGF+wLUutLpyPAR3mzz/y6qHETWpRyXq2tFFunAaUiv7K34C8r3Y=<br>
> > > =4sHU<br>
> > > -----END PGP SIGNATURE-----<br>
> > > _______________________________________________<br>
> > > SailfishOS.org Devel mailing list<br>
> ><br>
> > _______________________________________________<br>
> > SailfishOS.org Devel mailing list<br>
_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
</div></div></blockquote></div><br></div>