Neural machine translation powered by Google Cloud Translation. Add translation capabilities to your app—translate documents, communications, and evidence across 100+ languages with automatic language detection.
Quick start
import Casedev from 'casedev';
const client = new Casedev({ apiKey: process.env.CASEDEV_API_KEY });
// Translate text to Spanish
const result = await client.translate.v1.translate({
q: 'The deposition will be held on Monday at 10:00 AM.',
target: 'es'
});
console.log(result.data.translations[0].translatedText);
// "La deposición se llevará a cabo el lunes a las 10:00 AM."
Endpoints
Features
- 100+ Languages — Support for all major world languages including Chinese, Spanish, Arabic, Hindi, and more.
- Auto-Detection — Automatically detect source language when not specified.
- Batch Translation — Translate multiple strings in a single request for efficiency.
- HTML Preservation — Preserve HTML formatting during translation.
- Neural Machine Translation — State-of-the-art NMT models for high-quality translations.
Pricing
| Service | Cost |
|---|
| Translation | $0.03 per 1,000 characters |
| Language Detection | $0.03 per 1,000 characters |
| Supported Languages | Free |
Example: A 10,000 character legal document costs $0.30 to translate.
Common use cases
Multilingual discovery
Translate foreign-language documents discovered during litigation:
const foreignDoc = await fetchDocumentText();
const result = await client.translate.v1.translate({
q: foreignDoc,
target: 'en', // Translate to English
format: 'text'
});
Client communications
Translate client correspondence in their preferred language:
const languages = ['es', 'zh', 'ar']; // Spanish, Chinese, Arabic
for (const lang of languages) {
const translated = await client.translate.v1.translate({
q: emailContent,
target: lang
});
// Send localized email
}
Evidence processing
Detect and translate multilingual evidence:
// First detect the language
const detection = await client.translate.v1.detect({
q: evidenceText
});
const sourceLanguage = detection.data.detections[0][0].language;
// Then translate if not English
if (sourceLanguage !== 'en') {
const translated = await client.translate.v1.translate({
q: evidenceText,
source: sourceLanguage,
target: 'en'
});
}