Reply
Thread Tools
Posts: 90 | Thanked: 163 times | Joined on Jan 2012
#11
Originally Posted by Zeta View Post
I took a look at your code and discovered the qsTrId() function you used.

I usually use qsTr(), where you put for example directly the english text, and then it search for translations and if there is none then fallback to this english text.

But qsTrId() is different in that it works with an id to the translated text. I can see how that could be more efficient depending on the magic they put behind the qsTr() function, but means you must somehow define a default language as a fallback.
That is not too difficult from C++ (see http://doc.qt.io/archives/qt-4.8/qtr...or.html#load-2), as the "load" function returns a boolean to tell if the locale was correctly found or not, and then loading the english could be done.
For the translations, the QLocal class provides uiLanguages (the http://doc.qt.io/archives/qt-4.8/qlo...ml#uiLanguages) function which "returns an ordered list of locale names for translation purposes in preference order". There may be a way to add the english language as a low rank choice in there...

Finally, back to the load() function from QTranslator that must be used under the hood in the QML launcher, we see the logic for finding the translations files:

So maybe renaming/symlinking/copying the english translation file as "kids-mode.ts" should be enough. I see this file is already there in your repo, but with "<translation type="unfinished"></translation>" everywhere, which I suppose would not be displayed.
Thanks as per the sourcecode of sailfish the load function is used. https://github.com/sailfishos/libsai...shapp_priv.cpp
So in theory it should work. However it doesn't in practice. In the end I removed the language tag in kids-mode.ts and left everything untranslated. I then genereated the qm using:
lrelease -idbased -markuntranslated "" kids-mode.ts


Finally in the spec file I check the locale and if the translation file doesn't exist then I create the symlink.

Thanks for the advice.
 

The Following 3 Users Say Thank You to anig For This Useful Post:
Posts: 90 | Thanked: 163 times | Joined on Jan 2012
#12
New strings ready for translating on transifex.
https://www.transifex.com/x-39/kids-...ish/dashboard/
 

The Following 3 Users Say Thank You to anig For This Useful Post:
Posts: 93 | Thanked: 358 times | Joined on Jul 2016 @ Paraguay
#13
Originally Posted by anig View Post
New strings ready for translating on transifex.
https://www.transifex.com/x-39/kids-...ish/dashboard/
Hi, I'm the translator for Spanish, I don't understand the context of this string "On entering kids mode", could you please let me know when for example is shown this?
 

The Following 2 Users Say Thank You to meloferz For This Useful Post:
Posts: 90 | Thanked: 163 times | Joined on Jan 2012
#14
Originally Posted by meloferz View Post
Hi, I'm the translator for Spanish, I don't understand the context of this string "On entering kids mode", could you please let me know when for example is shown this?
It is in relation to what happens to running applications when you enter kids mode. You can choose to close them or hide them.
Attached Images
 
 

The Following 3 Users Say Thank You to anig For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:13.