Hi Tamas,

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.

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,

Joona

________________________________
From: Devel [devel-boun...@lists.sailfishos.org] on behalf of Андрей Кожевников 
[coderusin...@gmail.com]
Sent: 27 May 2019 10:41
To: Sailfish OS Developers
Subject: Re: [SailfishDevel] Dynamic QML refresh (localization)

Hello!

You should not use sailfishapp translations, because you won't be able to 
uninstall translator for default system language:
https://github.com/sailfishos/libsailfishapp/blob/master/src/sailfishapp_priv.cpp#L107

You can copy prf content to your pro file and install translations to different 
folder, not translations one, so sailfishapp wont preload default translator
https://github.com/sailfishos/libsailfishapp/blob/master/data/sailfishapp_i18n.prf

вс, 26 мая 2019 г. в 23:39, Tamas Miklos 
<u...@freemail.hu<mailto:u...@freemail.hu>>:
Hi,


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 :)

https://wiki.qt.io/How_to_do_dynamic_translation_in_QML

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.

Please let me know what's the best way to achieve a user-friendly way of 
changing language of my app on-the-fly.


Thanks,
Tamas (author of AIDA64 for Sailfish)

_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to 
devel-unsubscr...@lists.sailfishos.org<mailto:devel-unsubscr...@lists.sailfishos.org>
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to