Public
Like
1
translator
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v5View latest version
The backend server built with Hono framework providing translation API endpoints.
Serves the main application HTML page.
Returns a list of supported languages for translation.
Response:
{ "languages": [ { "code": "en", "name": "English" }, { "code": "es", "name": "Spanish" }, ... ] }
Translates text between languages.
Request:
{ "text": "Hello world", "from": "en", "to": "es" }
Response:
{ "translatedText": "Hola mundo", "detectedLanguage": "en" }
Uses Google Translate's free API endpoint for translations. Supports:
- Auto-detection of source language
- Translation between 20+ common languages
- Error handling for failed translations
- Serves frontend files from
/frontend/*
- Serves shared files from
/shared/*
- Uses Val Town's utility functions for proper file serving