Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Announce] Kids mode

    Reply
    Page 2 of 2 | Prev |   1   2 |
    anig | # 11 | 2018-05-18, 06:39 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to anig For This Useful Post:
    imaginaryenemy, juiceme, meloferz

     
    anig | # 12 | 2018-06-29, 05:31 | Report

    New strings ready for translating on transifex.
    https://www.transifex.com/x-39/kids-...ish/dashboard/

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to anig For This Useful Post:
    imaginaryenemy, juiceme, meloferz

     
    meloferz | # 13 | 2018-07-05, 14:36 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to meloferz For This Useful Post:
    Amboss, juiceme

     
    anig | # 14 | 2018-07-05, 17:14 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Images
     
    The Following 3 Users Say Thank You to anig For This Useful Post:
    Amboss, juiceme, meloferz

     
    Page 2 of 2 | Prev |   1   2 |
vBulletin® Version 3.8.8
Normal Logout