Pirate translator is a fun application that transforms standard English text into lively pirate speak! Whether you're looking to spice up your conversations with some nautical flair or just have fin, this app has you covered. You can interact with the app via a user-friend UI or like pros using the API 🦆 🏴☠️
The user-friendly UI of Pirate Translator can be access at https://pirater.onrender.com/. Follow these steps:
-
Open the link in your browser.
-
Enter the text you want to translate into the provided text box.
-
Click the Translate button.
- The pirate translation will appear in the output box below.
- Click the output to copy the translation to your clipboard.
-
Enjoy the fun animations and pirate-inspired aesthetics while you translate!
- Pro Tip: Enable the background audio when prompted for an immersive experience.
The backend of Pirate Translator is accessible through its API hosted at https://pirater-api.onrender.com/. You can integrate this API into your own applications or scripts for programmatic access.
Description: Translates the provided text into pirate speak. Request: JSON Response: JSON
Request Format:
{
"pirate_translation": "Pirate-speak translation of your input text"
}
curl -X POST https://pirater-api.onrender.com/translate/ \
-H "Content-Type: application/json" \
-d '{"text": "Hello, how are you?"}'
Output: Ahoy, how be ye?
import requests
url = "https://pirater-api.onrender.com/translate/"
data = {"text": "Hello, how are you?"}
response = requests.post(irl, json=data)
if response.status_code == 200:
print(response.json()["pirate_translation"])
else:
print("Error;", response.status_code, response.text)
You can check if the API is running by accessing the root endpoint (GET /
)
Response: "pong"
- Backend: FastAPI
- Frontend: HTML, CSS, JavaScript
- Hosting: Render
To run the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/sayhan1610/pirater.git cd pirater
- Install dependencies:
pip install -r requirements.txt
- Run the FastAPI server:
uvicorn main:app --reload
- Fix the url in
/web/script.js
- Open
web/index.html
in your browser to access the UI.
Special thanks to Hack Club & High Seas for inspiring me to make the app.
Enjoy talking like a pirate, ya scallywag! 🦜