Skip to content

Instantly share code, notes, and snippets.

@aristeoibarra
Created June 10, 2023 21:19
Show Gist options
  • Save aristeoibarra/49887195d700f7a3e36e8ef43ddc2ea6 to your computer and use it in GitHub Desktop.
Save aristeoibarra/49887195d700f7a3e36e8ef43ddc2ea6 to your computer and use it in GitHub Desktop.
change language (google translate)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Translate</title>
</head>
<body>
<style type="text/css">
#goog-gt-tt {
display: none !important;
}
.goog-te-banner-frame {
display: none !important;
}
.goog-te-menu-value:hover {
text-decoration: none !important;
}
#google_translate_element2 {
display: none !important;
}
.skiptranslate {
display: none !important;
}
</style>
<button onclick="doGTranslate('es|en');return false;" title="English">
Ingles
</button>
<button onclick="doGTranslate('es|fr');return false;" title="French">
Frances
</button>
<button onclick="doGTranslate('es|zh-CN');return false;" title="Chinese">
Chino
</button>
<button onclick="doGTranslate('es|es');return false;" title="Spanish">
Español
</button>
<h1>hola</h1>
<div id="google_translate_element2"></div>
<script>
function googleTranslateElementInit2() {
new google.translate.TranslateElement({
pageLanguage: 'es',
autoDisplay: false
}, 'google_translate_element2');
}
</script>
<script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"></script>
<script>
eval(function (p, a, c, k, e, r) {
e = function (c) {
return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
};
if (!''.replace(/^/, String)) {
while (c--) r[e(c)] = k[c] || e(c);
k = [function (e) {
return r[e]
}];
e = function () {
return '\\w+'
};
c = 1
}
while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
return p
}('6 7(a,b){n{4(2.9){3 c=2.9("o");c.p(b,f,f);a.q(c)}g{3 c=2.r();a.s(\'t\'+b,c)}}u(e){}}6 h(a){4(a.8)a=a.8;4(a==\'\')v;3 b=a.w(\'|\')[1];3 c;3 d=2.x(\'y\');z(3 i=0;i<d.5;i++)4(d[i].A==\'B-C-D\')c=d[i];4(2.j(\'k\')==E||2.j(\'k\').l.5==0||c.5==0||c.l.5==0){F(6(){h(a)},G)}g{c.8=b;7(c,\'m\');7(c,\'m\')}}', 43, 43, '||document|var|if|length|function|GTranslateFireEvent|value|createEvent||||||true|else|doGTranslate||getElementById|google_translate_element2|innerHTML|change|try|HTMLEvents|initEvent|dispatchEvent|createEventObject|fireEvent|on|catch|return|split|getElementsByTagName|select|for|className|goog|te|combo|null|setTimeout|500'.split('|'), 0, {}));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment