-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I exclude eg. code examples and/or tables from translation? #41
Comments
Here are the regexes I've tried in the HTML element mode
|
There is an issue with the "Ignore Paragraph" feature when used in this way. Unfortunately, you cannot currently control which element is recognized as a "paragraph" since the plugin determines it. With the example you provided, the plugin will extract each element with non-empty content as below:
As you can see, the extracted elements do not include Therefore, I will work on adding a feature that allows you to specify tag and class-like attributes to control which elements should not be extracted for translation, thus solving this problem. The precedence of three features is: ignore > cache > glossary. |
Thanks so much for the explanation and looking forward to the enhancement. In the meantime, I was able to write a quick ruby script which is able to strip unwanted spans/tables/anything by simply exploding the processed epub, traversing it, and simply deleting any element with |
I also found a bug after reviewing the relevant code. The regexes you provided were unable to catch the |
I've tried to use the exclude context tools to ensure the plugin doesn't try to translate code, but it doesn't seem to work. I've tried regex, all combinations I can think of. For example, with the structure
There's nothing I have been able to do to avoid all of this being submitted for translation - with nonsensical results. I have also tried using a glossary for certain programming symbols and it seems to be ignored. I would have thought that simply adding
code
as an exclude in HTML elements would do the trick, but it does nothing.Any advice?
And also, which takes precedence, the cache or the ignore/glossary settings? Another possibility is that it has cached all the (erroneous) code translations and is skipping all the rules I'm trying to add. I see it's sqlite so I actually should be able to just load it and edit - could its location be output in the job log?
The text was updated successfully, but these errors were encountered: