NetBuilders

You are welcome to look around. You will have to register before you can post a message, create a blog, chat live with our members, or add a site to our directory.




Reply Deluxdon
Old 14 December, 2008, 08:09 AM   #1 (permalink)
Gozer
 
Will.Spencer's Avatar
 
Location: Singapore
iTrader: (45)
Blog Entries: 1
Thanked 1,622 Times in 890 Posts
Posts: 4,958
$NetBucks: 8,564
Join Date: Dec 2008
Last Online: Today 08:07 AM
Default 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..
  Reply With Quote
Old 8 September, 2009, 16:35 PM   #2 (permalink)
Unknown Net Builder
 
iTrader: (0)
Thanked 0 Times in 0 Posts
Posts: 1
$NetBucks: 52
Join Date: Sep 2009
Last Online: 8 September, 2009 16:40 PM
Default

Sorry noob question and how to implemented?is it need php script or else? like
Code:
<?php include blablabla ?>
  Reply With Quote
Old 9 September, 2009, 02:47 AM   #3 (permalink)
Gozer
 
Will.Spencer's Avatar
 
Location: Singapore
iTrader: (45)
Blog Entries: 1
Thanked 1,622 Times in 890 Posts
Posts: 4,958
$NetBucks: 8,564
Join Date: Dec 2008
Last Online: Today 08:07 AM
Default

Quote:
Originally Posted by Momo View Post
Sorry noob question and how to implemented?is it need php script or else? like
Code:
<?php include blablabla ?>
The way I implement it can be seen in the example file "flags-google.shtml".

The implementation is really dependent upon how your web site is built.

Are your pages HTML, SHTML, PHP, etc...
  Reply With Quote
Old 11 September, 2009, 13:00 PM   #4 (permalink)
Dom Dom is offline
Unknown Net Builder
 
iTrader: (0)
Thanked 0 Times in 0 Posts
Posts: 2
$NetBucks: 4
Join Date: Sep 2009
Last Online: 23 September, 2009 13:27 PM
Default Querystring documentation

Hi Will,

Thanks for your documentation, unfortunatley I can't find any information on what to do if the page url has a querystring in it.

so this url is wrongly translated for instance

When we come to translating the url the querystring is stripped off. Am I doing something wrong?

Thanks

Dom
  Reply With Quote
Old 11 September, 2009, 18:08 PM   #5 (permalink)
Gozer
 
Will.Spencer's Avatar
 
Location: Singapore
iTrader: (45)
Blog Entries: 1
Thanked 1,622 Times in 890 Posts
Posts: 4,958
$NetBucks: 8,564
Join Date: Dec 2008
Last Online: Today 08:07 AM
Default

A new release of the translator is due next week which fixes many squirrelly bugs.

I just spoke to the developer and he says this should work fine in the new release.
  Reply With Quote
Old 12 September, 2009, 10:37 AM   #6 (permalink)
Dom Dom is offline
Unknown Net Builder
 
iTrader: (0)
Thanked 0 Times in 0 Posts
Posts: 2
$NetBucks: 4
Join Date: Sep 2009
Last Online: 23 September, 2009 13:27 PM
Default Brilliant

I will be sure to install it!

Thanks for all your help!

Dom
  Reply With Quote
Old 8 October, 2009, 01:31 AM   #7 (permalink)
Unknown Net Builder
 
iTrader: (0)
Thanked 0 Times in 0 Posts
Posts: 9
$NetBucks: 18
Join Date: Oct 2009
Last Online: 12 December, 2009 00:32 AM
Default

It don't work just refreshes the page any ideas?

the site I'm trying implement this is VitaminCA
  Reply With Quote
Old 8 October, 2009, 01:35 AM   #8 (permalink)
Gozer
 
Will.Spencer's Avatar
 
Location: Singapore
iTrader: (45)
Blog Entries: 1
Thanked 1,622 Times in 890 Posts
Posts: 4,958
$NetBucks: 8,564
Join Date: Dec 2008
Last Online: Today 08:07 AM
Default

Quote:
Originally Posted by iluxa22 View Post
It don't work just refreshes the page any ideas?
I'd start with Translation Script Troubleshooting Tips and then move on to Posting Trouble Reports (if necessary).

Quote:
Originally Posted by iluxa22 View Post
the site I'm trying implement this is VitaminCA
I haven't seen an error like this before:
Code:
Warning: Cannot modify header information - headers already sent by (output started at /homepages/24/d216192551/htdocs/store.vitaminca-old/header.php:4) in /homepages/24/d216192551/htdocs/store.vitaminca-old/classes/Cookie.php on line 252
What CMS is that site running?
  Reply With Quote
Old 8 October, 2009, 01:38 AM   #9 (permalink)
Unknown Net Builder
 
iTrader: (0)
Thanked 0 Times in 0 Posts
Posts: 9
$NetBucks: 18
Join Date: Oct 2009
Last Online: 12 December, 2009 00:32 AM
Default

Prestashop ... . i just put the code in the index.php not the header ..... uhhhh please help me!


Thank you for your support Will!!!
  Reply With Quote
Old 8 October, 2009, 01:43 AM   #10 (permalink)
Unknown Net Builder
 
iTrader: (0)
Thanked 0 Times in 0 Posts
Posts: 9
$NetBucks: 18
Join Date: Oct 2009
Last Online: 12 December, 2009 00:32 AM
Default

;however if i use Google translate from the source it works....

???
  Reply With Quote
Reply

Bookmarks

Tags
documentation, script, translation


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Translation Script v2.18 Bugfixes davesnake Translation Script Support 29 29 June, 2009 13:44 PM
Need help with this Translation Script! coder77 Translation Script Support 1 26 February, 2009 20:05 PM


All times are GMT. The time now is 11:42 AM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.1
vBAdvertise v1.0.0 Copyright ©2009, PixelFX Studios
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios