Por ejemplo, ¿cómo traduzco el contenido en inglés especificado al chino?
Este es el resultado de una consulta GPT3.5 y no funciona.
¡Gracias!
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); traducción = Substr(respuesta, startPos, endPos - startPos); // Muestra el resultado de la traducción Show("Texto fuente: " || sourceText); Show("Traducción: " || traducción);</SPAN>Hay muchas funciones incorrectas utilizadas en su ejemplo. Primero usaría el índice de secuencias de comandos para solucionarlos y luego volvería aquí si fuera necesario.