pronto/bin/google_translate.php File Reference

Go to the source code of this file.

Functions

 post ($url, $params)
 utf8_strrev ($str, $reverse_numbers=false)

Variables

if($_SERVER['argc']< 2) $MESSAGES_FILE = $_SERVER['argv'][1]
 if (!is_readable($MESSAGES_FILE))
 $LANGUAGE_CODE = str_replace('_','-',$LANGUAGE_CODE)
 $params
foreach($MESSAGES as $k=> $v) $r = post('http://www.google.com/translate_t', $params)
 $headers = array()
 $hdrtext = substr($r, 0, strpos($r, "\r\n\r\n"))
foreach(explode("\r\n",
$hdrtext) as $hdr) 
$parts = explode(';', $headers['Content-Type'])
 $parts2 = explode('=', $parts[1])
 $charset = trim($parts2[1])
if(empty($matches[2])) $outfile = file_get_contents($MESSAGES_FILE)
 $words = explode("<br>", $matches[2])
foreach($words as $word) $fp = fopen($MESSAGES_FILE, 'w')

Function Documentation

post ( url,
params 
)

Definition at line 35 of file google_translate.php.

References $fp, and $params.

utf8_strrev ( str,
reverse_numbers = false 
)

Taken from http://ca3.php.net/strrev Reverses a UTF8 string, but doesn't reverse numbers

Definition at line 65 of file google_translate.php.


Variable Documentation

$charset = trim($parts2[1])

Definition at line 129 of file google_translate.php.

foreach ($words as $word) $fp = fopen($MESSAGES_FILE, 'w')

Definition at line 163 of file google_translate.php.

Referenced by DB_Base::execute(), generate(), post(), and Cache_File::set().

$hdrtext = substr($r, 0, strpos($r, "\r\n\r\n"))

Definition at line 118 of file google_translate.php.

$headers = array()

Definition at line 117 of file google_translate.php.

$LANGUAGE_CODE = str_replace('_','-',$LANGUAGE_CODE)

Definition at line 102 of file google_translate.php.

Referenced by I18N::get_languages(), and I18N::set_language().

if ($_SERVER['argc']< 2) $MESSAGES_FILE = $_SERVER['argv'][1]

Definition at line 95 of file google_translate.php.

if (empty($matches[2])) $outfile = file_get_contents($MESSAGES_FILE)

Definition at line 141 of file google_translate.php.

$params
foreach (explode("\r\n", $hdrtext) as $hdr) $parts = explode(';', $headers['Content-Type'])

Definition at line 127 of file google_translate.php.

Referenced by tpHtml::composite_url().

$parts2 = explode('=', $parts[1])

Definition at line 128 of file google_translate.php.

$r = post('http://www.google.com/translate_t', $params)

Definition at line 114 of file google_translate.php.

Referenced by DB_ODBC::get_insert_id(), and DB_MSSQL::get_insert_id().

$words = explode("<br>", $matches[2])

Definition at line 144 of file google_translate.php.

if(!is_readable($MESSAGES_FILE))

Definition at line 97 of file google_translate.php.


Generated on Wed Jan 13 09:21:02 2010 for Pronto Framework by  doxygen 1.6.1