Results 1 to 4 of 4

Thread: Translation Script Troubleshooting Tips

  1. #1
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Posts
    5,033
    Blog Entries
    1
    Thanks
    1,010
    Thanked 2,327 Times in 1,258 Posts

    Translation Script Troubleshooting Tips

    Check your PHP Configuration

    Create a file called version.php on your web site with the following code in it:
    Code:
    <?php phpinfo(); ?>
    Load this page in your web browser to set details of your PHP configuration.

    The Translation Script requires safe_mode to be set to off and it requires cURL support to be enabled.

    Enable Debugging Options in translate/tr_config.php

    tr_config.php has two options for debugging:

    Code:
    $params['write_raw_content'] = 0; //writes data received from translator server for debuggging purposes
    This saves .RAW files in your cache directories. These files are the raw data that we get back from the translation engines, before any fixups are applied. These files take up a lot of space; Don't leave this enabled unless you need it. This is useful for debugging the content of translated pages.

    Code:
    $print_error_text = 0;  //Control the printing of error text (0/1)
    This enables enhanced error messages on translation failures. This can be very useful when translations are not working. Your site visitors can see these messages also, so it's best not to leave this enabled.

    Enable Logging Options in translate/tr_config.php

    The script has many levels of error logging. These are configured by setting the log_level variable in the file translate/tr_config.php.
    Code:
    $log_level = TRLOG_DEBUG;  //logging level (LOG_NEVER,LOG_ERROR,LOG_WARN,LOG_INFO,LOG_DEBUG,LOG_TRACE)
    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir

    This error message usually means that PHP safe_mode is enabled. If you are the admin of your server, disable safe_mode. If you are not the admin, as the admin (usually your hosting company) to disable safe_mode. If they refuse, look for a more responsive hosting company.

    We are experiencing a temporary problem with the foreign language section. Please try again later. We apologize for the inconvenience.
    Scuzi / Perdon / Pardon / Das is Nicht Gud / Sori / Nay canne doo tha laddy

    This error usually means that the script is working, but you've overloaded the translation servers and they've blocked your web servers IP address.

    This can happen a lot before you fill your translation cache.

    You can get more information about this error by enabling $print_error_text as described above.

    What To Do If You are Blocked by Google Translate

    If you send too many requests too quickly to Google Translate, the IP address of your server will be blocked.

    To reduce the number of requests you send to Google Translate, increase the $translator_cache_days variable in translate/tr_config.php.

    Once your servers IP is blocked, it normally only stays blocked for a few days. You will have to wait it out or switch the outbound IP address of your server.

    What To Do If You are Blocked by Yahoo Babelfish

    Yahoo uses IP addresses instead of DNS entries in a lot of their Babelfish code. These IP addresses change, depending upon what part of the world your web server is in. If Yahoo Babelfish isn't working for you, you may have to change the Babelfish IP address listed in translate/translate.php.

    In addition, Yahoo has also sometimes blocked requests coming from the same IP address as the web site where the pages are served. A web server with one IP address will use that IP address for incoming (web) traffic and outgoing (translation) traffic. Yahoo Babelfish translation may not work at all on a web server with one IP address. If your web server has two or more IP addresses, you can use the primary IP address as the outgoing IP address and publish another IP address at the incoming IP address.

    Enabling Debugging for Apache mod_rewrite

    Some translation script issues are the result of issues with mod_rewite. It is possible to enable enhanced mod_rewrite logging by placing the following lines in the Apache configuration for your vhost:
    RewriteLog "location_where_you_want_the_rewrite_log_store d"
    RewriteLogLevel 9
    Last edited by Will.Spencer; 25 April, 2009 at 00:23 AM.
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  2. #2
    yagami is offline Unknown Net Builder
    Join Date
    Oct 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Will.Spencer View Post

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir

    This error message usually means that PHP safe_mode is enabled. If you are the admin of your server, disable safe_mode. If you are not the admin, as the admin (usually your hosting company) to disable safe_mode. If they refuse, look for a more responsive hosting company.
    No need too change the hosting company if you got this warning. You can simply mute the waring by prefixing the curl_setopt call with an '@'like this:

    Around line 57 :
    Code:
    //submit the translation request
            $ch = curl_init();
            logger(TRLOG_TRACE,"after curl_init");
            @curl_setopt($ch, CURLOPT_URL, $resource);
            @curl_setopt($ch, CURLOPT_PROXY, $translate_proxy);
            @curl_setopt($ch, CURLOPT_HEADER, 0);
            @curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // Return into a variable
            @curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 
            @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
            @curl_setopt($ch, CURLOPT_USERAGENT, $params['user_agent']);
    It works great for me.

    By the way, thank you for this great script .

    PS : Sorry for my bad english

  3. #3
    megatwins is offline Unknown Net Builder
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I put the script on my online gaming website and it seems to work perfectly on my homepage, however when translating one of my pages with flash games embedded on it the background appears white and the game itself will not show up.

    Here is my homepage: onlinegames4free.me
    and here is a gamepage with translation: Online-pelejä ilmaiseksi - pelaa ilmaisia online-pelejä - Bejeweled Blitz

    Is it possible that its just not a strong enough or fast enough server to handle pages with .swf objects? Im on a shared server with hostgator. would a dedicated server cure this? or is their anything I can do to tweak the code?

  4. #4
    megatwins is offline Unknown Net Builder
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If someone can fix this for me and get it to work on my websites Ill give them $20.
    Right now I only have it on my gf's site which you can view at freegamesforest.com

Similar Threads

  1. Replies: 0
    Last Post: 23 August, 2010, 00:44 AM
  2. Translation script not working
    By jagman in forum Translation Script Support
    Replies: 1
    Last Post: 5 September, 2009, 06:40 AM
  3. Translation Script v2.18 Bugfixes
    By davesnake in forum Translation Script Support
    Replies: 29
    Last Post: 29 June, 2009, 13:44 PM
  4. Need Help Configure Translation Script
    By sagarshah in forum Translation Script Support
    Replies: 7
    Last Post: 24 April, 2009, 09:34 AM
  5. Need help with this Translation Script!
    By coder77 in forum Translation Script Support
    Replies: 1
    Last Post: 26 February, 2009, 20:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •