Skip to main content

apiverve_translator 1.2.6 copy "apiverve_translator: ^1.2.6" to clipboard
apiverve_translator: ^1.2.6 copied to clipboard

Translator is a language translation API that translates plain text or HTML into target languages using standard language codes. Submit any string with a target language code to receive the translated [...]

Translator API - Dart/Flutter Client #

Translator is a language translation API that translates plain text or HTML into target languages using standard language codes. Submit any string with a target language code to receive the translated text, both language names, and the confirmed or auto-detected source language.

pub package License: MIT

This is the Dart/Flutter client for the Translator API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_translator: ^1.2.6

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_translator/apiverve_translator.dart';

void main() async {
  final client = TranslatorClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'text': 'I\'m so excited that tomorrow is going to be sunny! Can\'t wait!',
      'source': 'en',
      'target': 'es'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response #

{
  "status": "ok",
  "error": null,
  "data": {
    "sourceLang": "en",
    "targetLang": "es",
    "translatedText": "¡Estoy tan emocionada de que mañana vaya a hacer sol! ¡Qué ganas tengo!",
    "sourceLangName": "English",
    "targetLangName": "Spanish",
    "sourceDetected": false,
    "format": "text",
    "characterCount": 62
  }
}

API Reference #

Authentication #

All requests require an API key. Get yours at apiverve.com.

License #

MIT License - see LICENSE for details.


Built with Dart for APIVerve

0
likes
130
points
69
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Translator is a language translation API that translates plain text or HTML into target languages using standard language codes. Submit any string with a target language code to receive the translated text, both language names, and the confirmed or auto-detected source language.

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_translator