L
L
lordning9992019-11-17 22:17:40
PHP
lordning999, 2019-11-17 22:17:40

How to get the code through which Yandex Browser splits the translation of the page into parts and sends it to its translator?

Hello. Tell me how Yandex Browser splits, for example, a site page in English and sends the text to the translator in parts, but at the same time, after the translator's answer, it saves all tags, links, etc. to the page that I requested to translate. Is it possible to pull off this algorithm and make it in php? To make it possible, for example, to create an HTML form, insert a link in English into the input. page of any site, and already on the server to process the Yandex algorithm, content separation and send to the translator, get the result and replace the English. text, so that all html tags are preserved, but only the text is replaced. There may be some kind of article on Habré, let me read it for reflection. Or give some examples, it would be great to know more about it. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Immortal_pony, 2019-11-17
@lordning999

Iterates through the entire DOM tree, replacing only the text and leaving the markup intact.
Can be done, for example, using DOM Crawler

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question