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! 🙂
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! 🙂
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! 🙂
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! 🙂
@edo888 I understand, thanks.
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 3 years, 2 months ago by
eclev91.