Page 1 of 1
[BBCode] Google translate
Posted: 12 Dec 2011, 12:49
by Terr0r
Google translate BBCode
Written by Terr0r
BBCode usage
HTML replacement
Code: Select all
<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
multilanguagePage: true,
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Help line
Code: Select all
Google Translate :[ggtranslate][/ggtranslate]
Example
Demo
Screenshot
Link
Enjoy!
Greets Terr0r
Google translate BBCode
Posted: 12 Dec 2011, 14:12
by Tigerman75
Thanks Terror
[BBCode] Google translate
Posted: 15 Dec 2011, 05:00
by Solidjeuh
Terr0r wrote:Google translate BBCode
Written by Terr0r
Code: Select all
<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
multilanguagePage: true,
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Very nice .. written ... SIMPLE
Code: Select all
<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
multilanguagePage: true,
layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
http://xenforo.com/community/threads/ad ... -xf.12422/
[BBCode] Google translate
Posted: 15 Dec 2011, 08:39
by doktornotor
Well, you cannot invent anything in this area,
http://translate.google.com/translate_tools
This would make more sense somewhere in page header, above breadcrumbs or so, rather than making it a bbcode.
[BBCode] Google translate
Posted: 15 Dec 2011, 17:35
by Arnevb
So all he did is making up the other fields:
[ggtranslate][/ggtranslate]? :O
"Written By Terr0r"... What? You didn't wrote that? Google did?
[BBCode] Google translate
Posted: 15 Dec 2011, 18:23
by doktornotor
Well, to make something productive out of this, this is what I put on
my forum.
On prosilver, this should fit next to the navlinks stuff, i.e.
Open: overall_header.html
Find:
Code: Select all
<li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="return fontsizeup(event);" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
Add before:
Code: Select all
<li class="rightside"><span id="google_translate_element"></span></li>
<script type="text/javascript">
// <![CDATA[
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
autoDisplay: false,
gaTrack: true,
gaId: 'UA-XXXXXXXX-Y',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
// ]]>
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Best place for subsilver2 seems to be right above
<!-- INCLUDE breadcrumbs.html -->
in
overall_header.html
.
Code: Select all
<div><span style="float: {S_CONTENT_FLOW_BEGIN};" id="google_translate_element"></span></div>
<script type="text/javascript">
// <![CDATA[
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
autoDisplay: false,
gaTrack: true,
gaId: 'UA-XXXXXXXX-Y',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
// ]]>
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
P.S. If you are using GA, replace the
UA-XXXXXXXX-Y
as needed, if not, remove that line and change the previous one to
gaTrack: false
.