Giter Club home page Giter Club logo

google-translator's Introduction

translator

Free Google Translate API for Dart

See it in pub: https://pub.dev/packages/translator
and GitHub: https://github.com/gabrielpacheco23/google-translator

ko-fi

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/latest/

Support my work :)

ko-fi

License

MIT License

Copyright © 2021 Gabriel Pacheco

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.

google-translator's People

Contributors

amanarora9848 avatar cooloneofficial avatar fa-fifi avatar gabrielpacheco23 avatar ji3g4m6zo6 avatar konstantinullrich avatar raphaeldelio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

google-translator's Issues

Get multiple translations

Thank you for the great flutter lib!
Is there a way to get all possible translations of a single word instead of the first one only?

Null-safety migration

This package is awesome, but since Flutter 2.0 hit the stable branch now it is required to use null-safety.

Does this work in China without VPN?

Just curious if this will in China without running a VPN? China blocks all Google sites and services. But I believe the Google translate app does work without VPN. Has anyone tried this in China?

Dependency error: Please update the HTTP version.

Dependency error: Please update the HTTP version.

Resolving dependencies...
Because myapp depends on translator ^0.1.7 which depends on http ^0.13.0, http ^0.13.0 is required.
So, because myapp depends on http ^1.1.0, version solving failed.

Get default locale language

Hello,
Is it possible to get the default locale language of a device with your package ?
I want to make possible to translate an english text in a default locale language
(Example: "my english text", to: my locale language, from:"en")

Thanks you, have a nice day.

Many languages don't translate

Exception has occurred.
_AssertionError ('package:translator/src/google_translator.dart': Failed assertion: line 25 pos 14: 'Languages.isSupported(language)':
/E: Error -> Not a supported language: 'zh_Hant')

Happens to several languages.

Anyway, great Job!

MAy be you can fix it. Thanks a lot

Error with google-translator

Hello Iam trying to transltae to spanish with the following code:

this.translation = await translator.translate("Walk little walk\nSmall talk big thoughts", to: 'es'); print(translation);

and i get this:

31f76a0befe82dc3e54fc74d461a2b64Pequeña charla grandes pensamientos31f76a0befe82dc3e54fc74d461a2b64

Error when translate from English to Svenska

Hi,
Thank you for this great library.
I met this error today and I don't know how fix it? I can use other language except this.
Can you help me resolve this issues? Thank you very much.

image

Full exception:
Exception has occurred.
ClientException (Error 429:

<title>https://translate.googleapis.com/translate_a/single?client=t&sl=en&tl=sv&hl=sv&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&tk=165163.308821&q=Questions</title>


Aktivera JavaScript i webbläsaren om du vill fortsätta.
<script src="https://www.google.com/recaptcha/api.js" async defer></script> <script>var submitCallback = function(response) {document.getElementById('captcha-form').submit();};</script>


Om den här sidan

Våra system har upptäckt ovanlig trafik från ditt nätverk. Den här sidan kontrollerar att det inte är en robot, utan du, som skickar begäranden. Varför hände detta?

Den här sidan visas när Google upptäcker automatiskt att det skickas begäranden från ditt nätverk som strider mot våra användarvillkor. Blockeringen upphör strax efter det att dessa begäranden inte längre skickas. Under tiden kan du fortsätta att använda våra tjänster genom att lösa ovanstående CAPTCHA.

Den här trafiken kan ha skickats av skadlig programvara, ett plugin-program i webbläsaren eller ett skript som skickar automatiska begäranden. Om du delar nätverksanslutning ber du din administratör om hjälp. Det kan hända att trafiken skickas från en annan dator som använder samma IP-adress. Läs mer

Om du skickar begäranden snabbt eller använder avancerade söktermer som ofta används av robotar, kan det ibland hända att du behöver lösa en CAPTCHA.

IP-adress: 2402:800:6346:de58:e595:a439:c0c1:fa16
Tid: 2022-02-09T09:02:12Z
Webbadress: https://translate.googleapis.com/translate_a/single?client=t&sl=en&tl=sv&hl=sv&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&tk=165163.308821&q=Questions
)

sometimes not working for translation

Some words can be translated to the target language(for me, chinese and korean), but some words cannot be translated and return the same text as my input.
Below is my code to translate from auto to my target language:
var trans = await GoogleTranslator().translate(word, to: myLang);
For instance, i want to translate the word "San Francisco" to traditional chinese, after calling the code above, it still return "San Francisco". However, when I go Google Translate website to translate this word, it will return the correct text to me. see the link

Instance of '_Future<dynamic>' instead of text

Future translate(String input) async {
final translator = GoogleTranslator();
var result;
var translation = await translator
.translate(input, to: 'tr')
.then((value) => {result = value});
return result;
}

this scope gives me Instance of '_Future' but i want to get that translated text.

Class 'String' has no instance method '<<'. Error

E/flutter (12356): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: NoSuchMethodError: Class 'String' has no instance method '<<'.
E/flutter (12356): Receiver: "406398"
E/flutter (12356): Tried calling: <<(3)
E/flutter (12356): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
E/flutter (12356): #1 GoogleTokenGenerator.wr (package:translator/src/tokens/google_token_gen.dart:80:60)
E/flutter (12356): #2 GoogleTokenGenerator.tokenGen (package:translator/src/tokens/google_token_gen.dart:58:9)
E/flutter (12356): #3 GoogleTokenGenerator.generateToken (package:translator/src/tokens/google_token_gen.dart:14:12)
E/flutter (12356): #4 GoogleTranslator.translate (package:translator/src/google_translator.dart:46:28)

On translating large text it returns error 400

: ClientException: Error 400:
I/flutter (24345):
I/flutter (24345):
I/flutter (24345):
I/flutter (24345): <title>Error 400 (Bad Request)!!1</title>
I/flutter (24345): <style>
I/flutter (24345): {margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px} > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url

Chinese iSO code is wrong

The current package uses 'zh-Hans' for Chinese simplified and 'zh-Hant' for traditional Chinese. They should really be:
'zh-cn' and 'zh-tw' respectively. 'zh-Hans' and 'zh-Hant' are NOT supported by google translate.

Only working on debug mode

It worked very well on the device when running on Debug.
When I compiled the APK to release and install on the device I'm getting:
SocketException: Failed host lookup: 'translate.googleapis.com' (OS Error: No address associated with hostname, errno = 7)

any clue what going on?

translator return 429 or null

my code--
final translator = new GoogleTranslator();
// final input = "Здравствуйте. Ты в порядке?";
_onTextChanged(String text) {
if (text != "") {
translator.translate(text, from: 'en', to: 'ru').then((s) {
print(s);
});}

give me suggestion .. advance thanks..
I think this is due to overload..

it is working well .. but in night i am try to translate a word it shows 429 error .. but i am sends only 5-10 request in 4 hours,,
i found this.. Google Translate Api has a default billable limit of 5 requests/second/user and 200,000 requests/day.

Language not support

E/flutter (29821): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0
E/flutter (29821): #0 List.[] (dart:core-patch/growable_array.dart:177:60)
E/flutter (29821): #1 _InputScreenState.parseTheText (package:restaurant_app/input.dart:176:48)
E/flutter (29821):
E/flutter (29821): #2 _InputScreenState.build. (package:restaurant_app/input.dart:351:27)
E/flutter (29821): #3 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:183:24)
E/flutter (29821): #4 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:598:11)
E/flutter (29821): #5 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:287:5)
E/flutter (29821): #6 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:222:7)
E/flutter (29821): #7 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:476:9)
E/flutter (29821): #8 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:77:12)
E/flutter (29821): #9 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:122:9)
E/flutter (29821): #10 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
E/flutter (29821): #11 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
E/flutter (29821): #12 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
E/flutter (29821): #13 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:358:19)
E/flutter (29821): #14 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:338:22)
E/flutter (29821): #15 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:267:11)
E/flutter (29821): #16 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:295:7)
E/flutter (29821): #17 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:240:7)
E/flutter (29821): #18 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:213:7)
E/flutter (29821): #19 _rootRunUnary (dart:async/zone.dart:1206:13)
E/flutter (29821): #20 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (29821): #21 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (29821): #22 _invoke1 (dart:ui/hooks.dart:265:10)
E/flutter (29821): #23 _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5)
E/flutter (29821):

This is happened when I am going convert English to

Chinese zh
Chinese (Simplified) zh-Hans
Chinese (Traditional) zh-Hant
Chuvash cv

Every time it print two times

I just copy paste the code written in the Example but when I run the code It translate the Language but it print two times the same String.
The Code:

String input = "Dashboard";
    await translator
        .translate(input, to: 'ar')
        .then((result) => print("$input : $result"));

But I want it print only single time So, whats the error???

Should newlines be translated?

If you translate a text that contains a newline, the translation will return a "\n" instead of the actual new line.

For example, translation from Romanian to English:
"Salut!
Ce faci?"
Translates to:
"Hello!\nWhat are you doing?"

I'm not sure if this is how this should work :D

Error 429

I have just detected this issue. How to fix it?

E/flutter (13948): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Error 429: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
E/flutter (13948): <html>
E/flutter (13948): <head><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta name="viewport" content="initial-scale=1"><title>https://translate.googleapis.com/translate_a/single?client=t&amp;sl=ja&amp;tl=en&amp;hl=en&amp;dt=t&amp;ie=UTF-8&amp;oe=UTF-8&amp;otf=1&amp;ssel=0&amp;tsel=0&amp;kc=7&amp;tk=480001.90239&amp;q=%E6%97%A5%E6%9C%AC%E8%AA%9E</title></head>
E/flutter (13948): <body style="font-family: arial, sans-serif; background-color: #fff; color: #000; padding:20px; font-size:18px;" onload="e=document.getElementById('captcha');if(e){e.focus();}">
E/flutter (13948): <div style="max-width:400px;">
E/flutter (13948): <hr noshade size="1" style="color:#ccc; background-color:#ccc;"><br>
E/flutter (13948): <form id="captcha-form" action="index" method="post">
E/flutter (13948): <script src="https://www.google.com/recaptcha/api.js" async defer></script>
E/flutter (13948): <script>var submitCallback = function(response) {document.getElementById('captcha-form').submit();};</script>
E/flutter (13948): <div id="recaptcha" class="g-recaptcha" data-sitekey="6LfwuyUTAAAAAOAmoS0fdqijC2PbbdH4kjq62Y1b" data-callback="submitCallback" data-s="ml7XFO2mUZrF40tDG7IY04nswHsnq7H_HZWpHE2bwcdSmX_ExVojjIUX-POjiiCwVUh_glIEG-Yq9aeCqbZEOgWArC-953a3uaHYKnhr9AvLuFtMlAwHaVpodio70PJwgnAHi7ZiM1hyAAFtM6w4teVmZ45J4ESkD_zoPbRluJMvVRy5_t7FM7I38LpMWnmUCSifpUlRH0OtCLo_V-F3yIq1QDms5WOk3XZ1xSL9beXOPn471vZQCmc"></div>
E/flutter (13948): <input type='hidden' name='q' value='EgR2V4t9GI_x74IGIhkA8aeDS0PgvI5Gw0IpfJjZlvO9uyoegJgzMgFy'><input type="hidden" name="continue" value="https://translate.googleapis.com/translate_a/single?client=t&amp;sl=ja&amp;tl=en&amp;hl=en&amp;dt=t&amp;ie=UTF-8&amp;oe=UTF-8&amp;otf=1&amp;ssel=0&amp;tsel=0&amp;kc=7&amp;tk=480001.90239&amp;q=%E6%97%A5%E6%9C%AC%E8%AA%9E">
E/flutter (13948): </form>
E/flutter (13948): <hr noshade size="1" style="color:#ccc; background-color:#ccc;">
E/flutter (13948): 
E/flutter (13948): <div style="font-size:13px;">
E/flutter (13948): <b>About this page</b><br><br>
E/flutter (13948): 
E/flutter (13948): Our systems have detected unusual traffic from your computer network.  This page checks to see if it&#39;s really you sending the requests, and not a robot.  <a href="#" onclick="document.getElementById('infoDiv').style.display='block';">Why did this happen?</a><br><br>
E/flutter (13948): 
E/flutter (13948): <div id="infoDiv" style="display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;">
E/flutter (13948): This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the <a href="//www.google.com/policies/terms/">Terms of Service</a>. The block will expire shortly after those requests stop.  In the meantime, solving the above CAPTCHA will let you continue to use our services.<br><br>This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests.  If you share your network connection, ask your administrator for help &mdash; a different computer using the same IP address may be responsible.  <a href="//support.google.com/websearch/answer/86640">Learn more</a><br><br>Sometimes you may be asked to solve the CAPTCHA if you are using advanced terms that robots are known to use, or sending requests very quickly.
E/flutter (13948): </div>

My code functions correctly in debug mode, but it fails to work when executed in release mode.

final translator = GoogleTranslator();

void onTextChange(String val) async {
  try {
    if (val.isNotEmpty) {
      showPasteButton.value = false;
      print("change text to $val");
      await translator.translate(val, from: 'auto', to: 'ar').then((value) {
        print("translation.text : ${value.text}");
        answer.value = value.text;
        print("answer.value : ${answer.value}");
        update(["translator"]);
      }); //ar for Arabic
    } else {
      answer.value = "";
      checkClipboard();
    }
  } on SocketException {
    log("ERROR :  Network Error");
  } on Exception catch (e) {
    log("ERROR Exception :  + $e");
  } catch (e) {
    log("ERROR :  + $e");
  }
}

output log in release mode when i print hello

I/flutter (17388): change text to h
I/flutter (17388): change text to he
I/flutter (17388): change text to hel
I/flutter (17388): change text to hell
I/flutter (17388): change text to hello

I'm currently utilizing GetX for state management, although I don't believe it has a direct impact on this situation.

Translation is not working for number

I use 'my' Myanmar(Burmese) language to translate numbers.

I/flutter ( 9404): Example: နမူနာ
I/flutter ( 9404): 24: 24

24 should be ၂၄.

Thanks

Getting Null for the translated output

I am getting null for any input words. Here is the code segment:

GoogleTranslator translator = GoogleTranslator(); //using google translator

String out;
final lang = TextEditingController(); //getting text

void trans() {
translator.translate(lang.text, to: 'fr')
.then((output) {
setState(() {
out = output; //placing the translated text to the String to be used
});
print(out);
});
}

http package version outdated

Please update the http package version #61

Resolving dependencies...
Because translator >=0.1.6 depends on http ^0.13.0 and google_fonts 5.1.0 depends on http ^1.0.0, translator >=0.1.6 is incompatible with google_fonts 5.1.0.

Can i get language code from a string

How to get language code from a line of text from this package. For eg: "Hello how are you". I need the output "en" as language code from the given text. Is there any way in this package

Http dependency

would you know how to solve dependency?

Because translator >=0.1.0+5 depends on http from hosted and depends on http from git, translator >=0.1.0+5 is forbidden.
So, because depends on translator ^0.1.0+5, version solving failed.
Unable to reload your application because "flutter packages get" failed to update package dependencies.

Use on device translator under the hood

Thanks for this great addition to the community however there are some drawbacks of this, one of this is after few translations if you are on WiFi Google blocks the unusual traffic.

It will be great if you can use this plugin instead of web scrapping so that it doesn't need to bypass anything

"google_ml_kit | Flutter Package" https://pub.dev/packages/google_ml_kit

Please tell me if i can be of any help.

Getting `ClientException: Error 403` while translating HTML entities

Minimal Reproducible Code

await translator.translate('TEXT &nbsp; OTHER-TEXT', from: 'en', to: 'hi')

Log

Unhandled exception:
ClientException: Error 403: <html lang=en><meta charset=utf-8><meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"><title>Error 403 (अनुमति नहीं है)!!1</title><style nonce="wb38CoWXwDQlmusFIb2-BA">*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{color:#222;text-align:unset;margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px;}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}pre{white-space:pre-wrap;}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}</style><main id="af-error-container" role="main"><a href=//www.google.com><span id=logo aria-label=Google role=img></span></a><p><b>403.</b> <ins>यह एक गड़बड़ी है.</ins><p>माफ़ करें, लेकिन आपके पास इस पेज के इस्तेमाल की अनुमति नहीं है. <ins>हमें बस इतना ही पता है.</ins></main>, uri=https://translate.googleapis.com/translate_a/single?client=t&sl=en&tl=hi&hl=hi&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&tk=944448.547390&q=TEXT+%26nbsp%3B+OTHER-TEXT

False hits

I am getting så many false hits meaning false translations comparing to the translate.google.com?
Is there any way to fix this issue?

Language id of input text

This is a FEATURE REQUEST.
Is there a way to show the language id of the input text along with the output?

XMLHttpRequest error.

Error: XMLHttpRequest error.
    dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 909:28                get current
packages/http/src/browser_client.dart 71:22                                       <fn>
dart-sdk/lib/async/zone.dart 1687:54                                              runUnary
dart-sdk/lib/async/future_impl.dart 155:18                                        handleValue
dart-sdk/lib/async/future_impl.dart 707:44                                        handleValueCallback
dart-sdk/lib/async/future_impl.dart 736:13                                        _propagateToListeners
dart-sdk/lib/async/future_impl.dart 533:7                                         [_complete]
dart-sdk/lib/async/stream_pipe.dart 61:11                                         _cancelAndValue
dart-sdk/lib/async/stream.dart 1219:7                                             <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39  dcall
dart-sdk/lib/html/dart2js/html_dart2js.dart 37324:58                              <fn>


    at Object.createErrorWithStack (http://localhost:59913/dart_sdk.js:5372:12)
    at Object._rethrow (http://localhost:59913/dart_sdk.js:39565:16)
    at async._AsyncCallbackEntry.new.callback (http://localhost:59913/dart_sdk.js:39559:13)
    at Object._microtaskLoop (http://localhost:59913/dart_sdk.js:39386:13)
    at _startMicrotaskLoop (http://localhost:59913/dart_sdk.js:39392:13)
    at http://localhost:59913/dart_sdk.js:34875:9

Error code 429

Error code 429 is printed and null is returned when translating. Please help

some time work and some time not work !!

-//W3C//DTD HTML 4.01 Transitional//ENtext/html; charset=utf-8initial-scale=1e=document.getElementById('captcha');if(e){e.focus();}1captcha-formpostrecaptcha6LfwuyUTAAAAAOAmoS0fdqijC2PbbdH4kjq62Y1b2ShtjoBNc3yn_gjHu3-nKFLBdqVlsKgZEFFm5pZLyngdlowV0MRT-vfOoYCHuc7OON73OPD8iTYus-WJ7wZH3rUqNFg7CnnSogajoXeNJrcSzTe0ZYWzLzTYGMWiF4FFpVnYYMM2hFlFeD5yKSl17VhI12f87FM04BSLesNwDkdKSOR0FrlJfNilMz2s0xpky9YTHei49kooQ8JWvT77_HmI-1vU51gyWxpdhcrjAL8RvxI3m9kx0y4continue1font-size:13px;document.getElementById('infoDiv').style.display='block';display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;

CORS policy blocking request

I´m having this issue when running from a flutter web app:

Access to XMLHttpRequest at 'https://translate.googleapis.com/translate_a/single?client=t&sl=auto&tl=af&hl=af&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&tk=586426.967108&q=my_text_to_translate from origin 'https://theheroesbook.web.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Failed to load resource: net::ERR_FAILED

Change The Language Code for Punjabi

I have been checking this package and it was not translating to the Punjabi Language. I have checked the languages.dart file and I came to know that the language code for Punjabi(Line Number 77 in file) is different from the one documented in https://cloud.google.com/translate/docs/languages. I have locally changed it and it worked. Could you please change it in the package?
Thanks in advance!

Translator not working when APK is build

I tried to build an APK for my app and send it to one of my friend. The rest of the app functionalities are working well but the google translator is not working when an APK is built. What could be a possible solution for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.