Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lstedmanfalls/translatedocument
TypeScript node project to translate documents and export translation
https://github.com/lstedmanfalls/translatedocument
pdf-files translation typescript
Last synced: 2 days ago
JSON representation
TypeScript node project to translate documents and export translation
- Host: GitHub
- URL: https://github.com/lstedmanfalls/translatedocument
- Owner: Lstedmanfalls
- Created: 2022-12-03T20:31:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T23:02:44.000Z (10 months ago)
- Last Synced: 2024-01-10T00:12:56.569Z (10 months ago)
- Topics: pdf-files, translation, typescript
- Language: TypeScript
- Homepage:
- Size: 9.84 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Backstory:
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.
# Functionality:
This app will allow a user to upload a document written in one language and download a translated version of it in another language
# Running Locally:
1. 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
2. Set PROJECT_ID env variable in .env file
- `PROJECT_ID="{project_id}"`
3. 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}"`
4. Install this project's dependencies
- `npm i`
5. Run the server locally without needing to compile to js
- `npx tsx app.ts`# TO DO Still:
- 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