vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Mini Mods - Translate a single Post in a Popup w/bablefish (https://vborg.vbsupport.ru/showthread.php?t=153637)

Scalemotorcars 07-27-2007 09:00 PM

Translate a single Post in a Popup w/bablefish
 
Heres a small modification to this thread. Credit should go to PcFreak
https://vborg.vbsupport.ru/showthrea...=babelfish.com

Make sure you read the direction on the above post. Its a simple template change to the postbits, or postbits_legacy.

The only real changes are to the image size and I added several languages as well as direct link to bablefish so readers can translate posts back to english or whatever language your forum uses.

Make sure to change out the"your.domain_here" with your absolute path of your forum

Code:

<!--start translator-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=700,height=500')">
<img src="$stylevar[imgdir_button]/tr.gif" alt="Please translate all posts to English" width="15" height="10" border="0" /></a>
<!--english-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_it','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/it.gif" alt=" Translate from English to Italian" width="15" height="10" border="0" /></a>
<!--french-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_fr','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/fr.gif" alt=" Translate from English to French" width="15" height="10" border="0" /></a>
<!--german-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_de','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/de.gif" alt=" Translate from English to German" width="15" height="10" border="0" /></a>
<!--spanish-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_es','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/es.gif" alt=" Translate from English to Spanish" width="15" height="10" border="0" /></a>
<!--dutch-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_nl','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/nl.gif" alt=" Translate from English to Dutch" width="15" height="10" border="0" /></a>
<!--end translator-->

Hope this works for you its my first Mod Post. :)

Check the screenshots below for the images and a screenshot. :up:

PoetJA-1975 07-29-2007 04:55 AM

Wow - nice mod - thanx for sharing it ;)

Jacquii.

tminus 07-31-2007 05:23 AM

I was just wondering about this 10 minutes ago! I haven't tried it yet but thank you!
Quote:

Originally Posted by MARKETPROFITS (Post 1304430)
This gets mod of the month for user friendliness.

OMG! This is amazing, so amazing that I decided to enhance this a bit and make it so the entire site is translated.

Ready? Go!

In the navbar template, look for this code:

Code:

<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>

Below it, add the following code:

Code:

<!--start translator-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=700,height=500')">
<img src="$stylevar[imgdir_button]/tr.gif" alt="Please translate all to English" width="15" height="10" border="0" /></a>
<!--english-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/showpost.php?p=$post[postid]&lp=en_it','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/it.gif" alt=" Translate from English to Italian" width="15" height="10" border="0" /></a>
<!--french-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_fr','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/fr.gif" alt=" Translate from English to French" width="15" height="10" border="0" /></a>
<!--german-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_de','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/de.gif" alt=" Translate from English to German" width="15" height="10" border="0" /></a>
<!--spanish-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_es','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/es.gif" alt=" Translate from English to Spanish" width="15" height="10" border="0" /></a>
<!--dutch-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_nl','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/nl.gif" alt=" Translate from English to Dutch" width="15" height="10" border="0" /></a>
<!--end translator-->


Save it and you are done.

It should work fine...if you doesn't, please update here as I have not tested this thoroughly.

Thanks, enjoy.

Awesome, thanks. I will be trying this too. ;)

Scalemotorcars 08-01-2007 08:28 PM

Cool. If anyone gets the full site translation working could you please post you're results. :up:

tminus 08-03-2007 03:19 AM

Quote:

Originally Posted by MARKETPROFITS (Post 1307554)
I've done it and it translates the site, but not some of the post.


It looks to be about 75% of the site is translated, with some posts being translated along the way.

Either way, it is helpful because I emailed Google about this to find out how it affects Google Adsense and their reply was along the lines of "it is a good idea because we can index your site in another language which in turn can have an affect on Google Adsense."
.........Either way, the entire site translation works.

So that means that they can enable site translation and it is automatic, or do they still have to enable it per page? I thought it just translates the page, not the 'entire site'. I was working on something else but I will have to try these out.
Edit: Tried it and it works. Thanks. I see now that it opens a new window and if you stay in it the site gets translated during navigation. Awesome.

Also, having both the post and site translation would be a solution to compensate for untranslated posts in the page/site translation.
Quote:

I have 14 languages available for translation, but the Greek characteers are not displaying correctly, but I think this is because I'm in the U.S. and the dominant language is English. Whereas, I'm sure the Greek characters would appear correctly if a country's dominant language is Greek or something similar to Greek.

Who knows, my theory could be wrong.
Don't you have to have Greek characters enabled to see it properly?
http://www.perseus.tufts.edu/Help/fonthelp.html
http://www.translatum.gr/fonts/

Other ideas would be creating a Language or Translate navbar drop down menu with icons and/or text. Some people might also prefer it in the header or footer. AJAX inline post translation would be nice too, as well as translating the page without a pop-up window. And of course a full product with settings features in admincp! Dream big I say. ;)

Edit2: Cool, thanks guys. I got it working on my navbar, postbit, header and footer. I was trying to figure out a way to have it open in the same window/tab, but no luck so far. Any ideas?

RichieBoy67 08-03-2007 01:39 PM

Quote:

Originally Posted by MARKETPROFITS (Post 1304430)
This gets mod of the month for user friendliness.

OMG! This is amazing, so amazing that I decided to enhance this a bit and make it so the entire site is translated.

Ready? Go!

In the navbar template, look for this code:

Code:

<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>

Below it, add the following code:

Code:

<!--start translator-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=700,height=500')">
<img src="$stylevar[imgdir_button]/tr.gif" alt="Please translate all to English" width="15" height="10" border="0" /></a>
<!--english-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/showpost.php?p=$post[postid]&lp=en_it','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/it.gif" alt=" Translate from English to Italian" width="15" height="10" border="0" /></a>
<!--french-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_fr','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/fr.gif" alt=" Translate from English to French" width="15" height="10" border="0" /></a>
<!--german-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_de','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/de.gif" alt=" Translate from English to German" width="15" height="10" border="0" /></a>
<!--spanish-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_es','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/es.gif" alt=" Translate from English to Spanish" width="15" height="10" border="0" /></a>
<!--dutch-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_nl','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=600,height=400')">
<img src="$stylevar[imgdir_button]/nl.gif" alt=" Translate from English to Dutch" width="15" height="10" border="0" /></a>
<!--end translator-->


Save it and you are done.

It should work fine...if you doesn't, please update here as I have not tested this thoroughly.

Thanks, enjoy.


Thanks for that!!:D

tminus 08-04-2007 07:31 AM

I found this nice free (lic:CC 2.5) flag pack (.zip 291kb) at famfamfam. It has Win & Mac, gif and png flag icons like the ones SMC posted but for every country::
http://www.famfamfam.com/lab/icons/flags/
http://img300.imageshack.us/img300/8...ewlargesy6.png

*If you are a Win user and you are wondering what the .ds_store files are, they are harmless Mac files for storing a folder's custom attributes (.ds_store@wikipedia.) Feel free to delete all .ds_store files and the Mac folder if you want.

Karabaja 08-04-2007 01:05 PM

I've placed flags next to post date-time on my board. But it would be nice if this could be in some kind of drop-down included in postbit instead of flags appearing in every post.

tminus 08-05-2007 03:22 AM

Quote:

Originally Posted by Karabaja (Post 1309657)
I've placed flags next to post date-time on my board. But it would be nice if this could be in some kind of drop-down included in postbit instead of flags appearing in every post.

I just took the product file for this other translation mod and put Market Profits code over it more or less. Now I have this in a drop menu menu on my forum in the navbar. This makes it way easier for so many reasons. The main one is that it is easier to have it compact in the navbar versus every post. Another is that you don't have to edit the navbar again if you revert the template during vB upgrades (unless there are conflicts.)

Scalemotorcars 08-07-2007 01:40 AM

NICE!!! Good to see everyone making use of this. :D


All times are GMT. The time now is 08:38 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01728 seconds
  • Memory Usage 1,789KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete