A colleague at work needed help getting pertinent information out of a 23 page .pdf manual that was written in German.
To translate the manual into English, he was manually copying and pasting blocks of text from it into Google Translate web text input box. Google translate only allows a maximum of 3900 characters at once, so translating the entire manual would've taken quite a bit of time and effort.
This app will allow a user to upload a document written in one language and download a translated version of it in another language
- Create a Google Cloud project linked to a service account that has access to Cloud Translation API
- See https://cloud.google.com/translate/docs/setup for more info
- Set PROJECT_ID env variable in .env file
PROJECT_ID="{project_id}"
- Set auth env variable in console to point to locally stored service account pem. Will need to set for each new terminal session.
export GOOGLE_APPLICATION_CREDENTIALS="{path_to_key}"
- Install this project's dependencies
npm i
- Run the server locally without needing to compile to js
npx tsx app.ts
- Add ability to translate from a word document as well
- Add a frontend that lets a user upload a document via a form, displays the translated page count, lets the user select the start and end page with num picker, and lets the user download the translated word doc
- Finish writing unit tests for services