Sign inSign up

alebast/simple-translate

By alebast

โ€ขUpdated about 1 month ago

My google translate container based on the browser extension of the same name

Image
0

9.5K

alebast/simple-translate repository overview

๐Ÿ“– Overview

This Docker image runs a lightweight translation service based on the Simple Translate browser extension.

Itโ€™s designed for Calibre users who want to translate selected words or text directly from the Lookup / Search selected word feature with EPUB3 books created with Storyteller โ€” an application that synchronizes eBooks with audiobooks by highlighting the currently spoken sentence.

With this container running, you can instantly translate a selected word or sentence from your synchronized eBook, without leaving Calibre.

๐ŸŽฏ Typical Workflow

Use Storyteller to create an EPUB3 eBook synced with its audiobook.

Open the EPUB3 file in Calibre.

Select any word (or sentence) thatโ€™s being highlighted as spoken.

Press L to trigger Calibreโ€™s Lookup / Search selected word feature.

The selected text is sent to this service and translated.

This image runs a lightweight translation service based on the Simple Translate browser extension.

With this container running, you can send a request like:

http://simple-translate:5001/translate?q={word}&sl=ru&tl=esโ 

โ€ฆ and receive the translation instantly.

๐Ÿš€ Features

๐ŸŒ Multiple languages โ€” source (sl) and target (tl) languages are configurable via query parameters

๐Ÿณ Containerized โ€” easy to deploy with Docker or Docker Compose

๐Ÿ“š Seamless Calibre integration for EPUB3 books with audio synchronization

โšก Fast & lightweight โ€” minimal dependencies

๐Ÿ›  How to Run

docker run -d \
  --name simple-translate \
  -p 5001:5001 \
  alebast/simple-translate

Now your translation endpoint will be available at:

http://localhost:5001/translate?q=hello&sl=en&tl=esโ 

๐Ÿ“š Calibre Setup

In Calibre, do:

  Lookup/search selected word [L]

Add a new search engine:

  Name: Simple Translate (RU โ†’ ES)
  URL: http://simple-translate:5001/translate?q={word}&sl=ru&tl=es

โš™ Parameters

Query Parameter	Description	              Example
q	        The text or word to translate  q=hello
sl	        Source language code	      sl=en
tl	        Target language code	      tl=es

๐Ÿ“ฆ Docker Compose Example

services:
  simple-translate:
    image: alebast/simple-translate
    container_name: simple-translate
    ports:
      - "5001:5001"
    restart: unless-stopped

Tag summary

Content type

Image

Digest

sha256:c5092ff3dโ€ฆ

Size

29.8 MB

Last updated

about 1 month ago

docker pull alebast/simple-translate