There is no plugin for this that I know about. But my guess is you can use the Spellcheck Editor to do some of the work.
It should help find all the words not in the Portuguese dictionary and you can add them to your own word list. You should end up with a file with one English word per line.
The next step depends on just how many words are in that list. If less than say twenty, I would use regular expression Find and Replace to add the spans searching for each word.
If instead of single words there are whole phases or sentences in English it gets much harder as you need to wrap the entire sentence or phrase in a single span, not one for each word.
If more than 20 or lots are in phrases and sentences, then there really is no better way than to actually proof read the entire manuscript adding in the proper spans as you go. Be sure to add lang attributes too as they should indicate the language of the English words to help with assistive technologies for those who need screen readers.
I have found that screen reading the text and just listening to know when to interrupt and edit it is easier.
So the right approach really depends on if just single words or if in phrases.
In many fiction works often only one character uses foreign phrases and so searching for references to that character can make things much easier.
It is a shame the original author did not properly mark the foreign text in some way.
Perhaps someone has written a plugin to help but I do not know of one. The closest thing I have seen is a routine that uses python function replace to work on a list of single words and wrap them in a span, followed by routine to merge spans that follow each other to deal with phrases and sentences.
Not easy to get working well. Sigil's Beta4 build has that Python Function Replace capability but someone would still have to write the code.
I wonder if this is something you could teach an AI to do?
Perhaps someone else knows a better approach.
|