패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.1

translator_plus

Dart용 무료이고 제한 없는 Google 번역 API입니다. 교육 목적의 문자열 및 텍스트 번역에 사용할 수 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
502
좋아요
19
Pub 점수
145

패키지 설치

flutter pub add translator_plus

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

translator_plus는 무료이고 제한 없이 Google 번역 기능에 접근할 수 있도록 해주는 Dart 패키지로, 개발자가 여러 언어 간에 텍스트와 문자열을 번역할 수 있게 합니다. 교육용으로 설계되었으며 Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼을 지원합니다. API 키나 복잡한 설정 없이 Flutter 앱에 번역 기능을 쉽게 통합할 수 있습니다. 국제화 개념을 배우거나 최소한의 부담으로 다국어 애플리케이션을 구축하는 데 이상적입니다.

사용 사례

  • 실시간으로 앱 콘텐츠 번역하기
  • 언어 변환을 포함하는 교육 프로젝트
  • 다국어 프로토타입 구축
  • 사용자 중심 텍스트 현지화
  • 앱에서 비영어 사용자 지원하기

주요 기능

  • API 키가 필요하지 않습니다
  • 무료 및 무제한 사용
  • 크로스 플랫폼 지원
  • 텍스트 번역을 위한 간단한 API
  • 내장된 언어 감지

적합한 대상

  • 초보자 플러터 개발자
  • 교육용 애플리케이션
  • 다국어 앱 프로토타이핑
  • 글로벌 대상 사용자를 위한 앱
  • 빠른 번역 통합이 필요한 프로젝트

고려 사항

  • 교육적 목적만을 위한 것
  • 고-traffice 생산 앱에는 권장되지 않습니다
  • Google 번역의 공개 인터페이스에 의존합니다
  • Google의 레이트 제한 또는 변경 대상일 수 있음
  • 번역 품질에 대한 제어가 제한적

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

translator_plus

Free Google Translate API for Dart

See it in pub: https://pub.dev/packages/translator_plus
and GitHub: https://github.com/HusamAwad2001/translator_plus

Usage

void main() async {
  final translator = GoogleTranslator();

  final input = "Здравствуйте. Ты в порядке?";

  translator.translate(input, from: 'ru', to: 'en').then(print);
  // prints Hello. Are you okay?
  
  var translation = await translator.translate("Dart is very cool!", to: 'pl');
  print(translation);
  // prints Dart jest bardzo fajny!

  print(await "example".translate(to: 'pt'));
  // prints exemplo
}

 

Using translate method passing the args from and to designates the language from text you're typing and the language to be translated

translator.translate("I love Brazil!", from: 'en', to: 'pt').then((s) {
    print(s);
  }); 
  // prints Eu amo o Brasil!

 

or you can omit from language and it'll auto-detect the language of source text

translator.translate("Hello", to: 'es').then(print);
// prints Hola

 

and also pass the value to a var using await

var translation = await translator.translate("I would buy a car, if I had money.", from: 'en', to: 'it');
print(translation);
// prints Vorrei comprare una macchina, se avessi i soldi.

 

The returned value is a Translation object which holds the translation stuff

var translation = await translator.translate('Translation', from: 'en', to: 'es');
print('${translation.source} (${translation.sourceLanguage}) == ${translation.text} (${translation.targetLanguage})');

// prints Translation (English) == Traducción (Spanish)

 

You can use the extension method directly on the string too

print(await "example".translate(to: 'pt'));
// prints exemplo

 

There is translateAndPrint method that prints directly

translator.translateAndPrint("This means 'testing' in chinese", to: 'zh-cn');
// prints 这意味着用中文'测试'

 

API

For full API docs take a look at https://pub.dev/documentation/translator_plus/latest/

License

MIT License

Copyright © 2023 Husam Dahliz

Disclaimer

This package is developed for educational purposes only. Do not depend on this package as it may break anytime as it is based on crawling the Google Translate website. Consider buying Official Google Translate API for other types of usage.

카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트