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

    (@edo888)

    Please post your website address, thanks! ??

    Plugin Author edo888

    (@edo888)

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

    Thanks! ??

    Thread Starter elainewildash

    (@elainewildash)

    Hi @edo888,

    That works well – thanks. Although it keeps changing to Select Language on every page even after a language is chosen. Is there anyway to say Select Language when the site first loads and then once a langauge is chosen display that language name on each subsequent page load?

    Plugin Author edo888

    (@edo888)

    Maybe something like this, which checks if you are on original language (en) or not:

    <script>jQuery(document).ready(function($){
        var original_language = 'en'; // can be en-US, en-GB, check the lang attribute of html tag
        if($('html').attr('lang') == original_language)
            $('select.gt_selector').val('');
    });</script>

    You can also keep a track of the user interaction with the selector, but it is out of the scope of free support.

    Thanks! ??

    Thread Starter elainewildash

    (@elainewildash)

    Thanks. Is there anyway to start off showing Select Language when the site first loads?

    Plugin Author edo888

    (@edo888)

    For that you will need to alter the plugin codes which will be reset after each update.

    Thanks! ??

    Thread Starter elainewildash

    (@elainewildash)

    Thanks @edo888 I appreciate the time you’ve taken to provide the code above.

    It’s just a shame that this was changed as it was showing Select Language and then the chosen language once selected from the dropdown before the plugin update.

    Plugin Author edo888

    (@edo888)

    I was receiving multiple requests to show the selected language instead of “Select Language”, so I have decided to change that in the new version.

    If I see more demand for showing “Select Language” I’ll consider adding a configuration option to choose from.

    Thanks! ??

    Thread Starter elainewildash

    (@elainewildash)

    @edo888 I understand, thanks.

    Plugin Author edo888

    (@edo888)

    You are welcome! ??

    Just wanted to chime in that I would be in support of a configuration option like what elainewildash referenced above — would love to see that as one of the widget options in a future update!

    Yeah this would be a nice feature @edo888 to maintain the previous functionality.

    For anyone else, rather than use JS, you could filter the settings to set default_language to ''. @edo888 has not provided any filters with which to do this, but the settings are loaded via get_option, so something like this should let you do this:

    add_filter('option_GTranslate', function($data) {
        $data['default_language'] = '';
        return $data;
    }

    That’s untested. There is an isset check that could prevent that from sticking.

    • This reply was modified 1 year, 8 months ago by eclev91.
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Set Select Language as default’ is closed to new replies.