Comments (2)
These scripts were written around 5 years ago and google translate UI has changed, so they are not fully functional.
I did some review and cleanup, the translation by url still works, so as the gethtml.py script. What it does is: download the HTML, save it, pass the html file URL to google translate (for example, http://translate.google.com/translate?hl=en&sl=auto&tl=ru&u=https://math.stackexchange.com/questions/2093425/equation-of-a-plane-passing-through-intersection-of-two-planes-and-parallel-to-a), download and save the translated page.
The "core" translation feature is this function:
Lines 110 to 120 in 4d96dca
For PDFs I've did this: download PDF, convert it to html, translate html via google translate (the getpdf.py
) - this doesn't work now because I was using the form on the google translate page and it now works differently than before.
But now the translation by URL also works for PDFs (for example
http://translate.google.com/translate?hl=en&sl=auto&tl=ru&u=http://pages.mtu.edu/~fmorriso/MathType-tipstricks-full.pdf), so you can quite easily adopt the approach used for htmls (or even use the gethtml.py script directly).
Note: I am not 100% sure, but I think the automated usage of google translate may violate Google TOS. It might be OK to translate few files for your personal use in a way I did here, but you shouldn't use this approach in the commercial software, instead use the translation API: https://cloud.google.com/translate/docs/
from get-med.
Thanks, this can already help me, I just translate a few PDFs personally.
from get-med.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from get-med.