• Resolved hastibe

    (@hastibe)


    When the website loads, is there a way to have the widget (“Dropdown” look) still display the “Select language label” instead of the default language (e.g. “English”), like it did in the previous version?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    You can possibly do that with additional javascript in page footer: jQuery('select.gt_selector').val('');

    It will select “Select Language” option instead of showing current selected language.

    Thanks! ??

    Thread Starter hastibe

    (@hastibe)

    Thanks for the quick response! I’m using a GeneratePress child theme and copied the GeneratePress footer.php to my child theme’s folder, but no matter where I paste your code into the footer.php file, either nothing happens, or the widget disappears all together. Any additional guidance about what lines to add the code to would be terrific!

    Also, for a future update, I’d suggest making it default to show the “Select Language” label instead of displaying the name of the current language when the page loads (before the widget has been interacted with), as someone looking to change the language of the site will probably be looking for something that says “Select Language” instead of something that is displaying the name of the current language.

    Thread Starter hastibe

    (@hastibe)

    Hmm, so I was able to add the javascript snippet to my page footer by creating a .js file with it in the js folder under my child theme and then adding the code under the section on “Enqueueing Scripts”, here, to my child theme’s functions.php file to load the script, but your javascript snippet didn’t result in the “Change Language” label being displayed instead of the current language (though I can see the script being loaded just before the closing </body> tag in my site’s page source, i.e. <script src='https://my-website.com/wp-content/themes/generatepress_child/js/gtranslate-customization.js?ver=1.0.0' id='my-script-js'></script>).

    Let me know if I’m doing something wrong, or if maybe the javascript snippet isn’t working after all?

    Seeing the same issue. Site used to show “Select Language” but now shows “English”. It makes more sense for it to say Select Language.

    Tried the code above in footer and in js file but it has not effect.

    i have the same issues, the problem is when I select the language it translates but the name of the language does not remain as the selected language it stays in the default language.

    Plugin Author edo888

    (@edo888)

    @hastibe Please post your website address, so I can check what you have.

    Thanks! ??

    Plugin Author edo888

    (@edo888)

    Try to place <script>jQuery(document).ready(function($){$('select.gt_selector').val('')});</script> before </body>

    Thanks! ??

    Thread Starter hastibe

    (@hastibe)

    That did the trick when I added it to the footer.php file of my child theme — thank you so much!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Way to have “Select language label” display by default?’ is closed to new replies.