raw curl post
{
“from”: “en”,
“to”: “pt”,
“e”: “”,
“q”: [
“Combine video online | Make own video from any parts”
]
}
result
[
"<i>Combine video online |</i> <b>Combinar vídeo online |</b> <i>Make own video from any parts</i> <b>Faça o próprio vídeo de qualquer parte</b>"
]
WTF?
Where did html tags come from? Where does the original string come from?
चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:
Dear valued client,
We are excited to inform you that we have added a new endpoint Rapid Translate Long Text to our Fast Translator API service that allows you to translate very long texts and especially without HTML tags ( no <i>, no <b> ). Based on your recommendation, we have added this feature to help you translate large amounts of text more easily and accurately.
With this new endpoint, you can now translate very long texts up to +100 000 characters without worrying about any HTML tags interfering with the translation process. We understand how important it is for you to have a smooth and seamless translation experience, and we are confident that this new feature will meet your needs.
We appreciate your feedback and always strive to improve our service to meet your expectations. If you have any questions or feedback regarding this new feature or any other aspect of our service, please do not hesitate to contact us. We are always here to help you.
Thank you for choosing the Fast Translator API service.
Best regards,
Sibari Oussama
FYI I created a filter function for this which is required to use this api
const hasBIRegex = new RegExp(’</?(?:b|i)(?😦?: [^<>]*)>|>?)’, ‘i’)
const hasHtml = (text) => typeof text === ‘string’ && text.match(hasBIRegex) !== null
const isIRegex = new RegExp(/<i.?></i>/, ‘gi’)
// this endpoint sends back original in italics and output in bold for some reason, as a result we fix it by removing italics text and removing bold tags
const rapidApiOneFormatting = (text) => {
if (hasHtml(text)) {
let txt = text
} else {
return text
}
}
the funny thing is, rapid api, an API PLATFORM doesn’t support code in comments, so the above looks a little off in the regex parts