FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
wizos
wizostrans
Remix of Koti_123/translator
Public
Like
trans
Home
Code
4
backend
2
frontend
5
shared
3
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
shared
/
README.md
Code
/
shared
/
README.md
Search
7/24/2025
README.md

Shared Code

This directory contains code that is shared between the frontend and backend for the advanced speech & text translation application.

Files

types.ts

Comprehensive TypeScript interfaces and types used across the application:

  • Language: Extended language definition with speech capabilities and native names
  • Voice: Voice configuration for text-to-speech
  • TranslationRequest/Response: API communication types
  • SpeechRecognitionResult: Speech recognition result structure
  • SpeechSynthesisOptions: Text-to-speech configuration

languages.ts

Complete language definitions and utility functions:

  • SUPPORTED_LANGUAGES: Array of 60+ languages with regional support
  • Regional Grouping: Languages organized by geographic regions
  • Speech Capabilities: Indicators for speech recognition and synthesis support
  • Native Scripts: Support for Devanagari, Telugu, Tamil, Arabic, and other scripts
  • Helper Functions: Utilities for filtering and finding languages

Language Support

Regional Languages

  • Indian Languages: 12+ languages including Telugu, Marathi, Tamil, Hindi, Bengali
  • Southeast Asian: Thai, Vietnamese, Indonesian, Filipino, and more
  • European: 25+ European languages with regional variants
  • Middle Eastern: Arabic, Persian, Hebrew with proper script support
  • African: Swahili, Afrikaans, Zulu, Amharic

Speech Capabilities

  • Recognition Supported: 45+ languages with speech-to-text
  • Synthesis Supported: 55+ languages with text-to-speech
  • Native Pronunciation: Authentic accents for regional languages
  • Script Rendering: Proper display of non-Latin scripts

Important Notes

Cross-Environment Compatibility

  • Code in this directory must work in both browser and server environments
  • Do not use Deno-specific APIs here as they won't work in the browser
  • Use https://esm.sh for any imports to ensure compatibility
  • All functions are pure and side-effect free

Performance Considerations

  • Language arrays are optimized for fast lookups
  • Helper functions use efficient filtering and searching
  • Types are designed to minimize bundle size
  • Regional grouping reduces UI rendering complexity

Internationalization

  • Native names are provided in original scripts
  • Language codes follow ISO 639-1 and BCP 47 standards
  • Regional variants are properly distinguished
  • Cultural context is preserved in language definitions
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.