vtrans is a free, self-updating, and unlimited language translating library built on top of googletrans. While googletrans gets outdated and stuck with limited languages, vtrans stays fresh by auto-updating itself every time you import it 😎
- 🔥 Auto-updates language list directly from Google Translator's site
- 🗣️ Supports extra languages like Sanskrit, Bhojpuri, etc.
- 🔃 Keeps up with Google’s latest language support
- 📡 Always fresh, always ready to translate like a beast
- ⚡ Fast and reliable
- 🌐 Auto language detection
- 📦 Bulk translations
- 🚀 HTTP/2 support
- 🧱 Same familiar structure
vtrans scrapes the latest language list from Google Translate Supported Languages and replaces the old LANGUAGES dictionary in googletrans's constants. This way, it's always up to date 💡
pip install vtransfrom vtrans import Translator
translator = Translator()
output = translator.translate("This library can translate languages", "ta")
print(output.text) # ➜ இந்த நூலகம் மொழிகளை மொழிபெயர்க்கக்கூடும்import vtrans
langs = vtrans.LANGUAGES
print(langs) # Print the full dictionary
print(len(langs)) # Number of supported languagesOn first use:
import vtrans
# Setup config file
# Checking for updates...
# Please wait...
# Update finished! 🎉
# Ready to translateimport vtrans
vtrans.config(auto_updating=False)import vtrans
vtrans.update()import vtrans
vtrans.remove_unwanted_printing()This change is saved permanently in your config file
httpx is used for requests, so HTTP/2 works out-of-the-box:
from vtrans import Translator
translator = Translator()
print(translator.translate('테스트')._response.http_version) # ➜ 'HTTP/2'texts = ['The quick brown fox', 'jumps over', 'the lazy dog']
translations = translator.translate(texts, dest='ko')
for t in translations:
print(t.origin, '->', t.text)from vtrans import Translator
translator = Translator()
print(translator.detect('この文章は日本語で書かれました。'))
# ➜ <Detected lang=ja confidence=0.64>translator = Translator(service_urls=[
'translate.google.com',
'translate.google.co.kr',
])- Max characters per translation: 15,000
- Not officially supported by Google
- Can break if Google blocks your IP (5xx errors)
- Based on googletrans, but enhanced for more power ⚙️
MIT License © 2023 S.Vigneswaran
Permission is granted, free of charge, to use, copy, modify, distribute, and sell this software with the included license text. No warranty or liability is provided.
Made with ❤️ by Vicky (S.Vigneswaran)