. Text within <> act as a placeholder and are // not translated by Google Translate $sToNewconvert = preg_replace("/\{(\w+)\}/", "<$1>",$sToconvert); $bDoNotConvertBack = false; if ($sToNewconvert == $sToconvert) $bDoNotConvertBack = true; $sToconvert = $sToNewconvert; $sConverted = $objGt->$sProcedure($sToconvert); $sConverted = str_replace("
","\r\n",$sConverted); if (!$bDoNotConvertBack) $sConverted = preg_replace("/\<(\w+)\>/", '{$1}',$sConverted); $sConverted = html_entity_decode(stripcslashes($sConverted)); $aOutput = array( 'error' => false, 'baselang' => $sBaselang, 'tolang' => $sTolang, 'converted' => $sConverted ); } catch (GTranslateException $ge){ // Get the error message and build the ouput array $sError = $ge->getMessage(); $aOutput = array( 'error' => true, 'baselang' => $sBaselang, 'tolang' => $sTolang, 'error' => $sError ); } $ajaxoutput = json_encode($aOutput). "\n";