-1
저는 웹 서비스 응답을 영어에서 스페인어, 프랑스어 등의 다른 언어로 번역해야한다는 요구 사항이 있습니다. 여기서는 영어로 된 내 웹 서비스 응답으로 mysql 데이터를 가져 오므로 변환해야합니다. Google 번역기를 사용하지 않고 특정 언어로 번역 할 수 있습니다. 내게 귀중한 제안을 해줄 수 있습니까?PHP webservice 언어 번역기
저는 웹 서비스 응답을 영어에서 스페인어, 프랑스어 등의 다른 언어로 번역해야한다는 요구 사항이 있습니다. 여기서는 영어로 된 내 웹 서비스 응답으로 mysql 데이터를 가져 오므로 변환해야합니다. Google 번역기를 사용하지 않고 특정 언어로 번역 할 수 있습니다. 내게 귀중한 제안을 해줄 수 있습니까?PHP webservice 언어 번역기
는 YoutApiIDHere 대신 API의 ID를 넣어 :
<?php
echo translate('Hello World', 'en', 'fr');
function translate($text, $from, $to) {
$data = file_get_contents('http://api.bing.net/json.aspx?AppId=YoutApiIDHere&Sources=Translation&Version=2.2&Translation.SourceLanguage=' . $from . '&Translation.TargetLanguage=' . $to . '&Query=' . urlencode($text));
$translated = json_decode($data);
if (sizeof($translated) > 0) {
if (isset($translated->SearchResponse->Translation->Results[0]->TranslatedTerm)) {
return $translated->SearchResponse->Translation->Results[0]->TranslatedTerm;
} else {
return false;
}
} else {
return false;
}
}
?>
무엇 빙 http://www.som3on3.com/programming/php/php-bing-translate-api/에 대해? –
@Bogdan Burim, $ translator = 'Welcome to PHP'와 같은 텍스트를 변환 할 수있는 코드 스 니펫을 제공 해줄 수 있습니까? 그래서 여기에이 $ translator 값을 특정 언어로 변환해야합니다. 나는 PHP 환경에 처음이다. –
@ BogdanBurim, 유료 버전 API라고 생각합니다. 오픈 소스가 필요합니다. –