• Resolved Generosus

    (@generosus)


    Good Day,

    Three months ago, you provided the JS code noted below to dequeue your plugin’s assets on mobile devices. The JS code was for your plugin, V2.9.5. Is it still valid for V3.0.1?

    We performed a couple of tests. Results were inconclusive.

    Thank you!

    <script>
    if(window.innerWidth < 760)
        window.gt_translate_script = true;
    </script>
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    No, it is not valid, you do not need it at all.

    Thanks! ??

    Thread Starter Generosus

    (@generosus)

    Hey @edo888,

    As always, thanks for the quick reply. So, what do we use instead?

    Since we do not use the language translator on mobile devices nor tablets, we do not want your plugin’s /fc.js nor /base.js files to load on them. Preferably, none of these plugin JS files.

    Perhaps you will consider adding this as a feature in your plugin in the near future.

    Thank you!

    Plugin Author edo888

    (@edo888)

    Hi,

    You need to use the shortcode in your theme PHP to display the selector conditionally, but I do not recommend it, since you will have issues with caching, in that case you will need to keep separate cache for mobile and for desktop, which is a bigger task.

    I recommend to simply hide the language selector for the mobile version with CSS, the scripts are small and it is not a big deal.

    I haven’t seen wide demand for that feature.

    Thanks! ??

    Hi @edo888

    I use the premium and the free version.

    Just my 5 cents … There is a huge demand for speed performance and not loading unnessary script on pages as these are also shown by performance tools like gtmetrix or pagespeed. It may not be “much” but in sum with other plugins and everone is saying: My script are not neccessary for you but they are small … in sum it makes a difference of several seconds on our sites. Serveral Seconds additional loading time on mobile is a reason for quite a few people to leave the site

    @@generosus :

    Maybe your try something like perfmatters, there you can disable script for a specific site or a specific device (like mobile).

    Thread Starter Generosus

    (@generosus)

    Hey @keramikoch,

    Thanks for your comments. Indeed, we use Perfmatters. Unfortunately, GTranslate V3.0.1 incorporates a code change that does not allow us to dequeue GTranslate’s JS files at all.

    Specifically, when we disable the files and save the change, the toggles remain in the ON position.

    Have you tried it yourself? If not, kindly do so and let us know what you run into. We plan to open a ticket with Perfmatters. Will report back under a new forum topic.

    Cheerio!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Still Valid? | JS to Dequeue Files on Mobile | V3.0.1’ is closed to new replies.