たとえば、指定された英語のコンテンツを中国語に翻訳するにはどうすればよいでしょうか?
これは 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); translation = Substr(response, startPos, endPos - startPos); // 翻訳結果を表示します。 Show("Source Text: " || sourceText); Show("Translation: " || translation);</SPAN>あなたの例では、多くの間違った関数が使用されています。まずスクリプト インデックスを使用してそれらを修正し、必要に応じてここに戻ってください。