Results 11 to 20 of 29

Thread: Translation Script Documentation

Threaded View

  1. Translation Script Documentation

    This tool was originally authored by Interlogic, and has been improved by DCT, f3ze, Sameer, myself, and Eric Schneider.

    This tool enables you to automatically and transparently translate your web site using either Google Translate or Yahoo Babelfish.

    Google Translate currently supports the following destination languages:

    • Arabic
    • Bulgarian
    • Catalan
    • Chinese - Simplified
    • Chinese - Traditional
    • Croatian
    • Czech
    • Danish
    • Dutch
    • English
    • Filipino
    • Finnish
    • French
    • German
    • Greek
    • Hebrew
    • Hindi
    • Indonesian
    • Italian
    • Japanese
    • Korean
    • Latvian
    • Lithuanian
    • Norwegian
    • Polish
    • Portuguese
    • Romanian
    • Russian
    • Serbian
    • Slovak
    • Slovenian
    • Spanish
    • Swedish
    • Ukrainian
    • Vietnamese

    Yahoo Babelfish currently supports the following destination languages:

    • Chinese - Simplified
    • Chinese - Traditional
    • Dutch
    • French
    • German
    • Greek
    • Italian
    • Japanese
    • Korean
    • Portuguese
    • Russian
    • Spanish

    Requirements

    • Apache (1.3 or 2.x)
    • Apache mod_rewrite
    • PHP cURL support
    • PHP safe_mode disabled

    Necessary Files

    The files necessary to make this script run are usually stored in the /translate/ directory of your web site. These files are:

    • .htaccess
    • index.php
    • translate.php
    • tr_config.php
    • tr_log.php

    Example Files

    The example files are usually stored in the /includes/ directory of your web site. These files are:

    • flags-google.shtml
    • flags-yahoo.shtml

    flags-google.shtml is a sample include file which calls the Google Translate engine.

    flags-yahoo.shtml is a sample include file which calls the Yahoo Babelfish engine.

    Graphics


    The script comes with an assortment of flag graphics. You can use these flags, replace these flags, or even use plain text links instead of these graphics.

    A complete set of national flags is available in translate/graphics/.

    A set of flags provided with older implementations of this script is available in translate/graphics-old/.

    Utilities


    • report.sh

    report.sh

    report.sh is a little script that counts the number of files in your cache for each language. The output looks like this:
    Google:

    Arabic: 1765
    German: 1723
    Spanish: 1743
    French: 1724
    Italian: 1722
    Japanese: 1723
    Korean: 1721
    Portuguese: 1726
    Russian: 1696
    Chinese Simplified: 1730
    Chinese Traditional: 1699

    Yahoo:

    German: 1716
    Spanish: 1710
    French: 1709
    Italian: 1715
    Japanese: 1712
    Korean: 1713
    Portuguese: 1727
    Russian: 1726
    Chinese Simplified: 1720
    Chinese Traditional: 1722
    Dutch: 1736
    Greek: 1707
    report.sh expects all of your files to have the .html extension. If your files have another extension, you may have to edit the script.

    Installation of the Script

    Unzip the translation script into the DocumentRoot of your Apache virtual host

    This will create these directories:

    • /lang
    • /ylang
    • /translate

    The lang and ylang directories will contain only one file each, .htaccess.

    The translate directory will contain these files:

    • .htaccess
    • index.php
    • translate.php
    • tr_config.php
    • tr_log.php
    • report.sh
    • readme.html

    The translate directory will also contain these directories:

    • g
    • y
    • graphics
    • graphics-old
    • includes


    Ensure that the permissions of the /translate/g directory are drwxrwxrwx (`chmod 777 g`)

    Ensure that the permissions of the /translate/y directory are drwxrwxrwx (`chmod 777 g`)

    Edit translate/tr_config.php so that site_url is set to the URL of your web site.

    Paste the contents of translate/includes/flags-google.shtml or translate/includes into your web page(s).

    Configuration of the Script


    The purpose of script configuration is to limit load on Yahoo and Google's translation engines, while at the same time providing visitors with the translations of your valuable content.

    • In translate/tr_config.php, set your translator_cache_days on line six to the number of days that you want a cache file to be considered "current."
    • In translate/.htaccess, configure any directories which you do not want to be translated.
    • In translate/.htaccess, configure any file extensions which you do not want to be translated.
    Last edited by Will.Spencer; 30 April, 2009 at 19:33 PM.
    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.

Similar Threads

  1. Translation Script v.2009-09-23
    By Will.Spencer in forum Translation Script Support
    Replies: 14
    Last Post: 2 January, 2011, 08:43 AM
  2. Translation Script Error 503
    By ytutun in forum Translation Script Support
    Replies: 4
    Last Post: 3 October, 2010, 22:07 PM
  3. Translation script not working
    By jagman in forum Translation Script Support
    Replies: 1
    Last Post: 5 September, 2009, 06:40 AM
  4. Translation Script Version 2.15
    By Will.Spencer in forum Translation Script Support
    Replies: 9
    Last Post: 15 April, 2009, 09:15 AM
  5. Need help with this Translation Script!
    By coder77 in forum Translation Script Support
    Replies: 1
    Last Post: 26 February, 2009, 21: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
  •