I used this to translate the main text of the site into different languages. It did a great job until I upgraded to PHP 5.3.8. It completely destroyed my server using all the memory. What am I doing wrong? I am sure to say that I will get a lot of comments :)
try { $gt = new Gtranslate; $gt->setRequestType('curl'); $SQL = "SELECT * FROM PAGE_CONTENT WHERE live_page = '1'"; $result = mysql_query($SQL); while ($row = mysql_fetch_array($result)) { $page_id_sub = $row["page_id"]; $page_title = $row["page_title"]; $page_permalink = $row["page_permalink"]; if (empty($mylang)) { echo "<a href='/$permalink/$page_permalink.html'>$page_title</a> |"; } else { $page_trans = $gt->$mylang("$page_title"); echo "<a href='/$permalink/$page_permalink.html'>$page_trans</a> |"; } } } catch (GTranslateException $ge) { echo $ge->getMessage(); }
source share