Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vB Global Translator - Multiply your indexed pages & put search traffic on autopilot Details »»
vB Global Translator - Multiply your indexed pages & put search traffic on autopilot
Version: 2.4, by Dave Hybrid Dave Hybrid is offline
Developer Last Online: Dec 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.x Rating:
Released: 06-27-2009 Last Update: 07-07-2009 Installs: 67
Uses Plugins Template Edits
Additional Files  
No support by the author.

**Text Removed**

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #92  
Old 06-29-2009, 05:24 PM
Bounce's Avatar
Bounce Bounce is offline
 
Join Date: Mar 2004
Location: Edinburgh,Scotland
Posts: 919
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave Hybrid View Post
Yes, wrap them in conditionals so the flags only show on certain pages, i only put them on my showthread pages and to guests because those are the one that will pull the traffic and use the flags.

----------------------------------------

<if condition="is_member_of($bbuserinfo,1)">
<if condition="(THIS_SCRIPT == 'showthread')">
-code-
</if>
</if>
:up: that works better for me as well
Reply With Quote
  #93  
Old 06-29-2009, 05:26 PM
merkaz merkaz is offline
 
Join Date: Sep 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the database i see the " originaltext "
But the " translated " is empty ...

Reply With Quote
  #94  
Old 06-29-2009, 05:31 PM
Dave Hybrid's Avatar
Dave Hybrid Dave Hybrid is offline
 
Join Date: Mar 2007
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by merkaz View Post
In the database i see the " originaltext "
But the " translated " is empty ...

I cant check anything without a url?
Reply With Quote
  #95  
Old 06-29-2009, 06:10 PM
tpearl5's Avatar
tpearl5 tpearl5 is offline
 
Join Date: Nov 2001
Location: PA
Posts: 1,014
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm trying to figure out a way I could use this with vbSEO. Ideally the url's should be in the format site.com/xx/thread_name/ where xx is the language abbreviation. Anyone have any ideas?

Also, is there any reason that links on the translated page shouldn't be to the translated version of corresponding page? Otherwise the user would have to keep clicking their flag for each new page.
Reply With Quote
  #96  
Old 06-29-2009, 06:10 PM
T2x T2x is offline
 
Join Date: May 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey dave, very nice plugin.

I figured it out for you

Code:
<!--notranslatestart-->
Do not translate this text
<!--notranslateend-->
That is the syntax.

Change the plugin code to the following:

Code:
// Enable UTF-8 characters
if(isset($_GET['hl'])) {
 require_once("translate.php");
$output = str_replace('lang="en"', 'lang="'.$_GET['hl'].'"', $output); 
 header ('Content-type: text/html; charset=utf-8');
// Keep remainders of <style and <script tags!
    $time = time(); // Unique Tag Identifier!
    preg_match_all('|<script[^>]*>(.*?)</script>|si', $output,$scripttags, PREG_SET_ORDER);
    for($i=0;$i<count($scripttags);$i++)
    {
        $output = str_replace($scripttags[$i][0], "<a name=\"$i\"></a>",$output);
    }       
    //preg_match_all("<style[^>]*>.*</style>",$buffer,$styletags);
    preg_match_all('|<style[^>]*>(.*?)</style>|si',$output,$styletags);
    for($i=0;$i<count($styletags);$i++)
    {
        $output = str_replace($styletags[1][$i], "<a name=\"s$i\"></a>",$output);
    }
	preg_match_all('|<!--notranslatestart-->(.*?)<!--notranslateend-->|si', $output,$notranslatetags, PREG_SET_ORDER);
    for($i=0;$i<count($notranslatetags);$i++)
    {
        $output = str_replace($notranslatetags[$i][0], "<a name=\"t$i\"></a>",$output);
    }   
$output=callback($output);
// Place back remainders of <style and <script tags!
	for($i=0;$i<count($styletags);$i++)
    {
        $output = str_replace("<a name=\"t$i\"></a>", $notranslatetags[$i][0], $output);
    }
    for($i=0;$i<count($styletags);$i++)
    {
        $output = str_replace("<a name=\"s$i\"></a>", $styletags[1][$i], $output);
    }
    for($i=0;$i<count($scripttags);$i++)
    {
        $output = str_replace("<a name=\"$i\"></a>",$scripttags[$i][0] ,$output);
    }
//print_r($scripttags);
//die("c:".count($scripttags).":".count($styletags));
}
Also you are going to make google angry.

You need to add a
Code:
@curl_setopt($ch, CURLOPT_REFERER,"http://$_SERVER[SERVER_NAME]$_SERVER[VBSEO_URI]");
(this is vbseo only code)
according to google.

and adding an api key to the request doesn't hurt.

http://code.google.com/apis/ajaxsearch/signup.html

at http://code.google.com/apis/ajaxlanguage/documentation

it says:

Quote:
Flash and other Non-Javascript Environments

For Flash developers, and those developers that have a need to access the AJAX Language API from other Non-JavaScript environments, the API exposes a simple RESTful interface. In all cases, the method supported is GET, and the response format is a JSON encoded result with embedded status codes. For google.language.translate, the POST method is available. Applications that use this interface must abide by all existing terms of use. An area to pay special attention to relates to correctly identifying yourself in your requests. Applications MUST always include a valid and accurate http referer header in their requests. In addition, we ask, but not require, that each request contains a valid API Key. By providing a key, your application provides us with a secondary identification mechanism that is useful should we need to contact you in order to correct any problems.
so basically you just change the request to look like this

Quote:
@curl_setopt($ch, CURLOPT_URL, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&key=KEYHERE&langpair=".urlencode($fl.'|'.$tl)."&q=".urlencode ($text));
Reply With Quote
  #97  
Old 06-29-2009, 06:25 PM
T2x T2x is offline
 
Join Date: May 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tpearl5 View Post
I'm trying to figure out a way I could use this with vbSEO. Ideally the url's should be in the format site.com/xx/thread_name/ where xx is the language abbreviation. Anyone have any ideas?

Also, is there any reason that links on the translated page shouldn't be to the translated version of corresponding page? Otherwise the user would have to keep clicking their flag for each new page.
As far as vbseo urls, im not sure you would be able to make it work unless you changed your entire url structure and made existing urls be site.com/en/thread_name/

As for HREF rewriting, I checked the code and I believe its a feature dave is working on but currently its not in place.

The idea is to boost search traffic not to provide a comprehensive translation experience.

The google translation gadget offers a much faster translation experience for users if this is what you are looking for:

http://translate.google.com/translate_tools
Reply With Quote
  #98  
Old 06-29-2009, 06:28 PM
Dave Hybrid's Avatar
Dave Hybrid Dave Hybrid is offline
 
Join Date: Mar 2007
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tpearl5 View Post
I'm trying to figure out a way I could use this with vbSEO. Ideally the url's should be in the format site.com/xx/thread_name/ where xx is the language abbreviation. Anyone have any ideas?

Also, is there any reason that links on the translated page shouldn't be to the translated version of corresponding page? Otherwise the user would have to keep clicking their flag for each new page.
Rewrite the URLs from ?hl= to directorys using htaccess
Reply With Quote
  #99  
Old 06-29-2009, 07:45 PM
T2x T2x is offline
 
Join Date: May 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave Hybrid View Post
Rewrite the URLs from ?hl= to directorys using htaccess
good point. I just realized that that would actually be pretty easy
Reply With Quote
  #100  
Old 06-29-2009, 07:48 PM
tpearl5's Avatar
tpearl5 tpearl5 is offline
 
Join Date: Nov 2001
Location: PA
Posts: 1,014
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave Hybrid View Post
Rewrite the URLs from ?hl= to directorys using htaccess
Right, but what about words in the URL being translated?
Reply With Quote
  #101  
Old 06-29-2009, 08:14 PM
Dave Hybrid's Avatar
Dave Hybrid Dave Hybrid is offline
 
Join Date: Mar 2007
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tpearl5 View Post
Right, but what about words in the URL being translated?
You're asking if we can do that?

As far as I'm aware domain names and URLs are only allowed in English, that just the way the net is...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05184 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (9)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete