Google translate - add a line of code - google-translate

Can anyone please guide me on adding this line of code:
$('.link-all').trigger('click');
to Google translate:
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'de,en,fr', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, multilanguagePage: true}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

Related

Google translate with flag image icons

How do I change the script so that flags are displayed instead of a drop-down field?
<div id="google_translate_element"></div>
<span>
<script type="text/javascript">
//<![CDATA[
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'pl', includedLanguages: 'pl,en,de,ru', autoDisplay: false,
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
//]]>
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</span>
How do I change the script so that flags are displayed instead of a drop-down field?

Angular: ng-view not displaying properly

I am trying to show a View using ng-view, but it's not working as it should be.
Trips.cshtml:
#section Scripts{
<script src="~/lib/angular/angular.min.js"></script>
<script src="~/lib/angular-route/angular-route.min.js"></script>
<script src="~/js/simpleControls.js"></script>
<script src="~/js/app-trips.js"></script>
<script src="~/js/tripsController.js"></script>
<script src="~/js/site.js"></script>
}
<div class="row" ng-app="app-trips">
<div ng-view></div>
App-trips.js:
(function () {
"use strict";
angular.module("app-trips", ["simpleControls", "ngRoute"])
.config(function ($routeProvider) {
$routeProvider.when("/", {
controller: "tripsController",
controllerAs: "vm",
templateUrl:" /views/tripsView.html"
});
$routeProvider.otherwise({ redirectTo: "/" });
});
})();
And I am trying to show a view tripsView.html that is in /wwwroot/views.
bower.json:
"angular" : "~1.6.5",
"angular-route" : "~1.6.5",
"jquery": "2.2.0",
"bootstrap" : "3.3.7"
tripsView.html:
<p>hello world </p>
I get an error using a diferent non connected script:
$(function (){
########## not connected stuff
})();
error: "is not a function", could this be connected? Even thought the script is working fine.

lightbox and jquery conflict

I need help regarding the script. lightbox works properly but jQuery not working. am totally confused what to do???
<script type="text/javascript" src="js2/prototype.js"></script>
<script type="text/javascript" src="js2/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js2/lightbox_s.js"></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script>jQuery.noConflict();</script>
<script>
jQuery(document).ready(function()
jQuery("#menu_btn").mouseover(function() {
jQuery("#menu").stop(true, false).animate({
'bottom': '-10px'
}, 500);
});
jQuery("#menu_btn").mouseout(function() {
jQuery("#menu").stop(true, false).animate({
'bottom': '-50px'
}, 500);
});
jQuery("#menu").mouseover(function() {
jQuery("#menu").stop(true, false).animate({
'bottom': '-10px'
}, 500);
});
jQuery("#menu").mouseout(function() {
jQuery("#menu").stop(true, false).animate({
'bottom': '-50px'
}, 500);
});
});
</script>
I do not have a choice rather I post this question... I have found same thing i.e. jQuery.noConflict() to use but its not working together.
I need help in this regard.
Thanks in advance
The noConflict is secondry.
The main issue here is that jQuery has to be loaded before you include lightbox
<script type="text/javascript" src="js2/prototype.js"></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js2/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js2/lightbox_s.js"></script>
First include jquery and include lightbox after that as the latter is dependent on the former.

Google Translate not showing Language Options

I have put Google translate code on my site, but it's not showing Language option in select field:
And the code is:
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout:
google.translate.TranslateElement.InlineLayout.HORIZONTAL, autoDisplay: false},
'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Re : google.Translate.ElementInit() callback .. autoDisplay: True or deleted should render the language options. Note that the option (language trigger value and name) are not rendered immediately after the this callback .. which is irritating if you want to switch language on a navigator.language || navigator.userLanguage result.
Here's the code i use:
<div id="google_translate_element"></div>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
autoDisplay:true,
defaultLanguage: 'en',
}, 'google_translate_element');
}
</script>

iframe google translate code?

I am using following code to add a google translator to my page header. But if I move it inside page content its not displaying anything. How to get the same translator box in iframe.
<div id="google_translate_element" class="langSwitch"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
includedLanguages: 'af,sq,ar,hy,az,eu,be,bg,ca,zh-CN,zh-TW,hr,cs,da,nl,en,et,tl,fi,fr,gl,ka,de,el,ht,iw,hi,hu,is,id,ga,it,ja,ko,la,lv,lt,mk,ms,mt,no,fa,pl,pt,ro,ru,sr,sk,sl,es,sw,sv,th,tr,uk,ur,vi,cy,yi',
gaTrack: true,
gaId: 'UA-2585500-1',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Thanks
Check your <script src, it's //translate.google.com instead of http://translate.google.com/.

Resources