Translator is a small frontend application for the LibreTranslate API made from youtube tutorial for educational purposes only.
- Set up the app with Vite (before mostly use Create React App)
- TypeScript
- libraries:
- test libraries:
To use LibreTranslate API you need to pay but you can run it locally and then it is free. Here is a config line that you can change. To run the api locally you need to download an image libretranslate/libretranslate and run it in a docker container. Do that:
- Make sure you have Docker installed on your machine.
- In a
docker-compose.yml
file of the project choose languages you want to have:
version: "3"
services:
translator:
image: libretranslate/libretranslate
restart: always
ports:
- 3001:5000
environment:
LT_LOAD_ONLY: "zh,de,pl,en,es" // here change
- In a terminal navigate to the root directory of your project where the
docker-compose.yml
file is located and run the command:
docker-compose up
- Once the container is up and running, your frontend translate app can communicate with it. You can check if api works by opening your web browser and navigating to
http://localhost:3001
.
Jacek Pudysz - this repo is just a result of watching his tutorial on YouTube. I just added a few little changes myself. The course helped me a lot to organize my knowledge. I also caught some good practices. Thank you. You are the best!