MicrosoftTranslator: Translate text with Microsoft Translation API

1.Introduction

Description: Extension to translate text with Microsoft Translation API
Released: 2022-05-01T18:30:00Z
Last Updated: 2022-05-01T18:30:00Z
Permissions: android.permission.INTERNET

Thanks to @Point for sponsoring the extension.

2.Blocks

image

image

3.Documentation

Docs for: MicrosoftTranslator

Events

GotError

Event raised when an error occurs
Params

functionName | text
errorMessage | text


GotLanguagesList

Event raised after getting language's list
Params

namesList | any
nativeNamesList | any
langCodesList | any


GotTranslation

Event raised after getting translation
Params

responseDictionary | dictionary


GotTranslationWithLang

Event raised after getting response of 'TranslateWithLangDetection' method
Params

language | text
score | text
responseDictionary | dictionary


LanguageDetected

Event raised after detecting language
Params

language | text
score | text
isTranslationSupported | boolean


Methods

DetectLanguage

Detects language of given text
Params

text | text


GetLanguagesList

Gets a list of all supported languages

Translate

Translates given text into target language
Params

srcLang | text

text | text

toLangList | text


TranslateWithLangDetection

Translates text with language detection
Params

text | text

toLangList | text


Properties

ResourceLocation

Sets resource location

Property Type : read-write
Accepts : text


SubscriptionKey

Sets subscription api key

Property Type : read-write
Accepts : text


4.Usages

Trasnslate text into single language
image

You can translate text into multiple languages by providing a csv list of language codes

Detect Text Language
image

Please read:

5.Downloads

Aix:
com.sunny.translation.aix (565.7 KB)

The extension is open source:

6.Liked my work?

You can donate some amount to keep me motivated. :hugs:

Hope it helps! :slightly_smiling_face:

18 Likes

Great work @vknow360 , :clap: :clap:

Throigh your open source, I learnt few more tips as well as idea in java Lang. Thanks Mr.360°

2 Likes

Nice extension
I happen to be working on an extension similar to this one :sweat_smile:

But thanks for making the extension open source

2 Likes

Another epic extension.
Congrats.
But no needs api Key???

1 Like

Subscription key is the api key.
Thank you.

Very nice. I didnt even know that microsoft has a translator service. And 2 milions free characters is a good number, specially if use together with others apis

1 Like

Actually, it is 2 million characters per hour. In a single request, you can send 10 thousand characters.
Quoting from the API reference:

Each translate request is limited to 10,000 characters, across all the target languages you are translating to. For example, sending a translate request of 3,000 characters to translate to three different languages results in a request size of 3000x3 = 9,000 characters, which satisfy the request limit. You’re charged per character, not by the number of requests. It’s recommended to send shorter requests.

4 Likes

Hello @vknow360, I would like to know if it is possible to develop an extension that translates text to speech, using Microsoft API?

Yes, it looks like possible.
If you have api key then we can continue it in PM.

1 Like