Translate API - Ruby SDK
Official Ruby SDK for Translate API.
🚀 Quick Start (For Beginners)
Step 1: Get Your API Key
- Go to https://translate-api.com
- Click "Login" or "Get Started"
- Create an account (it's free to start!)
- Go to your Dashboard
- Click "Create API Key"
- Copy your API key - you'll need it!
Step 2: Install the SDK
Open your terminal and run:
gem install translate_apiStep 3: Use It!
require 'translate_api'
# Replace 'your-api-key' with your actual API key from translate-api.com
client = TranslateAPI::Client.new('your-api-key')
# Translate to one language
result = client.translate('Hello world', 'es')
puts result['translations']['es'] # Output: "Hola mundo"
# Translate to multiple languages at once
result = client.translate('Hello world', ['es', 'fr', 'de'])
puts result['translations']
# Output: {"es"=>"Hola mundo", "fr"=>"Bonjour le monde", "de"=>"Hallo Welt"}📖 Full API Reference
Constructor
client = TranslateAPI::Client.new(api_key, base_url: 'https://translate-api.com/v1')translate(text, target_language)
Translate text to one or more languages.
translate_batch(items)
Translate multiple texts at once.
🌍 Supported Languages
Visit translate-api.com/documentation for a full list.
❓ Need Help?
- Documentation: translate-api.com/documentation
- Support: support@translate-api.com
📝 License
MIT License