예를 들어, 지정된 영어 콘텐츠를 중국어로 어떻게 번역합니까?
이는 GPT3.5 쿼리의 결과이며 작동하지 않습니다.
감사해요!
url = "https://translate.google.com";
sourceText = "Hello, world!";
targetLanguage = "zh-CN"; // Chinese Simplified
// Build the HTTP request
postData = "sl=en&tl=" || urlEncode(targetLanguage) || "&text=" || urlEncode(sourceText);
headers = Associative Array("Content-Type", "application/x-www-form-urlencoded", "User-Agent", "Mozilla/5.0");
httpReq = New HTTP Request(
url,
"POST",
headers,
postData
);
// Send the HTTP request and retrieve the response
httpReq.Send();
response = httpReq.ResponseBody();
// Extract the translation
startPos = Pos(response, "<SPAN title="\">", startPos); 번역 = Substr(response, startPos, endPos - startPos); // 번역 결과 표시 Show("원본 텍스트: " || sourceText); Show("번역: " || 번역);</SPAN>귀하의 예에는 잘못된 기능이 많이 사용되었습니다. 먼저 스크립팅 인덱스를 사용하여 문제를 수정한 다음 필요한 경우 여기로 돌아옵니다.