![]() translateTextSingular('Hello World', 'de', sourceLang: 'en') ![]() Optionally you can pass the source language as well. DeepL detects the source language automatically. The basic text translation takes one or more texts and a target language to return the translated text. In production code, the authentication key should not be hard-coded, but instead fetched from a configuration file or environment variable.Īdd further arguments to the constructor: Translator translator = Translator( This example is for demonstration purposes only. Pass it via Translator constructor: Translator translator = Translator(authKey: '') A auth_key from DeepL is required to send requests. Translator translator = Translator(authKey: '') Īwait anslateTextSingular('Hello World', 'de') Īwait anslateTextList(, 'de') Īll requests to the DeepL API go via a Translator object. The required argument authKey is a string containing your API authentication key as found in your DeepL Pro Account.īe careful not to expose your key, for example when sharing source code.Īn example using async/await: import 'package:deepl_dart/deepl_dart.dart' Import the package and construct a Translator. In the dependencies: section of your pubspec.yaml, add the following line: dependencies: ![]() You can translate up to 500,000characters/month for free. To get a key, please create an account here. To use the package, you'll need an API authentication key. We intend to support all API functions with the library, though support for new features may be added to the library after they’re added to the API. The DeepL library offers a convenient way for applications written for to interact with the DeepL API. This opens a whole universe of opportunities for developers: any translation product you can imagine can now be built on top of DeepL's best-in-class translation technology. ![]() The DeepL API is a language translation API that allows other computer programs to send texts and documents to DeepL's servers and receive high-quality translations. This package is heavily inspired by the official Node.js Client Library for the DeepL API: Issues here are answered by maintainers and other community members on GitHub on a best-effort basis. ![]() This package is maintained by volunteers but is not a supported DeepL product and not maintained by DeepL SE. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |