MicrosoftTranslator | PHP SDK for microsoft translator API | REST library
kandi X-RAY | MicrosoftTranslator Summary
kandi X-RAY | MicrosoftTranslator Summary
Translate your texts using Microsoft's Bing Translation services HTTP API
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Method to get the tokens for a given grant type .
- Translates a text
- Get access token .
- Requests a service to the given URL .
- Get service url
MicrosoftTranslator Key Features
MicrosoftTranslator Examples and Code Snippets
Community Discussions
Trending Discussions on MicrosoftTranslator
QUESTION
I need to convert the following curl call of Microsoft Azure Cloud to Swift:
...ANSWER
Answered 2022-Feb-13 at 10:05Let's analyze your cURL command
, let's make it more readable with breaking line. If you want to make it working as such in Terminal.app, just add \
at the end of the line.
QUESTION
I have this simple code to get translation:
...ANSWER
Answered 2021-Nov-18 at 14:10Your screenshot shows an app registration configuration page in Azure Active Directory - this is something entirely different. What you want is creating a Translator resource and then take one of the keys from the "Keys and Endpoints" menu:
QUESTION
Request:
...ANSWER
Answered 2021-Jan-28 at 22:27Detect api does not support setting a preference for language when multiple languages are possible. We recommend using longer sentences to get a more accurate result.
QUESTION
My task includes creating a Blazor app where I would use Azure Translator, but I keep on getting this error:
"Severity Code Description Project File Line Suppression State Error CS1061 'object' does not contain a definition for 'SerializeObject' and no accessible extension method 'SerializeObject' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)"
Here is the code, I keep getting the error on line 28, 40, and 57.
...ANSWER
Answered 2021-Apr-24 at 11:18The problem is in this line public object JsonConvert { get; private set; }
, as you have defined it in the class, but you want to use NewtonSoft library. so you have to install the nugget package for this library and use it.
remove the line public object JsonConvert { get; private set; }
and add the namespace using Newtonsoft.Json;
to the class.
QUESTION
I want to use azure translator service with the Authorization token. There are plenty of resources explaining how to do it with subscription key but I could not found any resource explaining the use of authorization token. I can get the authorization token but when I send a request with it, the response status code is 401. This is how I send the request:
...ANSWER
Answered 2021-Apr-08 at 03:11If you want to call Text Translation API with authentication token, please refer to the following steps
- Get a token. If your service is global, the endpoint is
https://api.cognitive.microsoft.com/sts/v1.0/issueToken
QUESTION
I'm trying to setup a Custom Translator with a Phrase Dictionary for my company. I followed the official documentation and this tutorial: https://soltisweb.com/blog/detail/2019-08-13-using-a-custom-translator-with-azure-co.
When I translate it seems that it's not using my custom model, here is my setup:
1 Azure Translator:
- Location: Global
- Pricing Tier: S1
1 Worspace in Custom Translator, connected to the Azure Translator above:
- Subscription name: ****
- Subscription type: TextTranslation
- Pricing tier: S1
- Subscription region: Global
I've created one project:
- Category: Global
- Language Pair: English - Spanish
I uploaded the same Phrase Dictionary as in the tutorial (Phrase Dictionary):
EN ES one uno two dos three tres four cuatro five cinco six seis seven siete eight ocho nine nueve ten diez hi hola hello buenos diasI've generated a model and deployed it everywhere (America, Europe, Asia) without any error.
I've tried to translate "hello" with the following C# code:
...ANSWER
Answered 2021-Mar-16 at 22:14There is a possibility you are not hitting your custom model. So, let's first make small change to your API call.
&allowFallback=false to ensure if you don't hit your custom model, the call would fail instead of getting served from our standard model.
Best, Mohamed
QUESTION
I've messing with a piece of code.
I'm trying to send sentences in different languages to microsoft azure translator using python, but I can't make utf-8 work.
I spend many times look all over internet or asking into chat, so since i'm stuck, here I am.
I'm using jupyter so here it is :
...ANSWER
Answered 2020-Oct-15 at 02:11Try this :
QUESTION
I am writing a script in Python that detects the language of a provided text.
I found the following command line that works in a terminal, but I would like to use it in my script.
Command :
...ANSWER
Answered 2020-Oct-09 at 02:28The command in Command Line
is essentially sending http request
. So you just need to use the python code I provide below, just for reference.
QUESTION
Hello i am using Python 3.8.3 and try to use Azure Translation. Based on the example of (https://docs.microsoft.com/nl-nl/azure/cognitive-services/Translator/quickstart-translate?pivots=programming-language-python ) i try to re-create the example for myself and minimized the code.
I create a Azure Resource (Translate) and copied the key and the endpoint in the code. But when i run the code it returns the following error:
{ "error": { "code": 401000, "message": "The request is not authorized because credentials are missing or invalid." } }
Can someone please explain what i doing wrong and how to fix this issue!
I use herefor the following code:
...ANSWER
Answered 2020-Sep-15 at 06:35As per this doc, since you are using multiple services. It is a must to include the 2 authentication headers with your request.
QUESTION
have done the following steps:
- Generated the Translator API Key in Azure Portal.
- Tried using Ocp-Apim-Subscription-Key with Global end point - (api.cognitive.microsofttranslator.com)
- Tried using Ocp-Apim-Subscription-Region with Regional end point (api-eur.cognitive.microsofttranslator.com)
- Regenerated the security keys as well.
I have followed the quick start sample to the word - https://docs.microsoft.com/en-us/azure/cognitive-services/Translator/quickstart-translate?pivots=programming-language-csharp
However, always getting 401 as the response.
...ANSWER
Answered 2020-Jul-15 at 04:19I noticed the same errors when trying to run that sample. I was able to get this to work with a few changes.
First: Change your endpoint to https://api.cognitive.microsofttranslator.com/
.
Next: I noticed you commented out the Ocp-Apim-Subscription-Key
header. You should uncomment that, as that is required (and is correct, the way you had it).
Next: Add the Ocp-Apim-Subscription-Region
header. I see you already attempted to add that, but you tried setting it to your subscription key. Instead, set this to your Cognitive Service's specific region value (you can find this value in the portal, just under your keys and endpoint). Mine, for instance, is eastus
.
At this point, you should be able to make a successful call. I verified this with my own Cognitive Services instance.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MicrosoftTranslator
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page