Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › QML dynamic translation causes app to resize

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #21752

    Marek

    Hi Felgo

    I have prepared small app to show the problem, it is visible on Android (tested on Android 7.0)

    When I do QQMlEngine->retranslate application changes its size, like a half of the screen

    before: https://github.com/frankipl/translate-test/blob/master/before_translate.png

    after: https://github.com/frankipl/translate-test/blob/master/after_translate.png

    Here is app source code

    https://github.com/frankipl/translate-test

    I’m not sure, maybe this is Qt related, or I’m doing something wrong.

    Please help

    Best,

    Marek

    #21789

    Marek

    Hi Felgo,

    Could you please take a look at this problem ?

    I have created similar application using just Qt (5.12.3) and I have no problem with dynamic translations, application does not resize.

    Code is available here: https://github.com/frankipl/translate-qt-test

    Best,

    Marek

    #21879

    Christian
    Felgo Team

    Hi Marek,

    I have just tested your example project on my device (LG V10) and an Android emulator (Android 8.0) and your problem did not occur, the app did not change size.

    Please provide more information for us: What device are you testing on? What Android OS version? Which Felgo SDK version (newest is 3.2.0 with Qt 5.12.3)?

    Also, Felgo provides another way to use re-translation, as mentioned in the docs: https://felgo.com/doc/howto-multi-language/#localize-your-app-or-game

    You can add

    + translation.language

    to a binding, which is an empty property but it causes the property binding to re-evaluate when the language changes. Then you don’t need to call the retranslate() function.

    Cheers,
    Chris

    #22123

    Marek

    Hi Christian

    Sorry for late reply. I have tested just now (I added CONFIG += c++14 and NOSTDLIB for Android) to pro file

    https://github.com/frankipl/translate-test

    Problem still exists.

    I’m testing on phone Zenfone 3 Max 5.2 with Android 7.0 I have Felgo 3.2.0-1 release 2019-08-01 NDK android-ndk-r20

    My friend was also testing this on his Felgo installation and with Android 9 and result is the same.

    When I use Felgo way to translate (you have described) and do not call retranslate then it works

    Best,

    Marek

    #22738

    Tim Schon Wieder

    Hi Marek, hi Felgo team,

    I do have the same problem. It only occurs on some devices but not others as I can see in the Google Play Pre-Launch Report. I can’t recognize any patterns in the brand or Android version (beside others, it works on an S9 with Android 8.0 and Mate 9 with 7.0 but not on an Moto Z with 7.0 nor on a Pixel 2 or 3 with 8.1 or 9.0).

    Is it somehow possible to use QQmlApplicationEngine::retranslate() anyway? If not, could you explain why not?

    Best

    Tim

    #22739

    Marek

    Hi Tim

    I don’t know the cause of the problem, I just did translations with the method described by Christian. Since then I have made 3 applications using that method and didn’t have any problems. It requires you to add translation.language property to each qsTr() but otherwise it works.

    Best,

    Marek

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.