GetLanguageNames仅返回英文名称,无论提供何种语言代码。 [英] GetLanguageNames only returning names in English, regardless of supplied language code.
问题描述
使用以下代码,该方法仅返回英文名称(应该用德语返回):
Using the following code, the method only returns names in English (it should be returning them in German):
string languageCode = " de";
string [] aryLanguageCodes = {" en"," de"," ar"," bg"," ca" ,"zn-CHS", }
TranslatorService。 LanguageServiceClient client = new TranslatorService。 LanguageServiceClient ();
HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty 跨度>();
httpRequestProperty.Method = " POST" ; httpRequestProperty.Headers.Add(" Authorization" , " Bearer "   + NBSP; AzureToken);
使用 ( OperationContextScope 范围 = new OperationContextScope (client.InnerChannel)) {
OperationContext .Current.OutgoingMessageProperties [ HttpRequestMessageProperty .Name] = httpRequestProperty;
返回 client.GetLanguageNames("" , languageCode,aryLanguageCodes);
}
string languageCode = "de";
string[] aryLanguageCodes = {"en", "de", "ar", "bg", "ca", "zn-CHS" };
TranslatorService.LanguageServiceClient client = new TranslatorService.LanguageServiceClient();
HttpRequestMessageProperty httpRequestProperty = newHttpRequestMessageProperty();
httpRequestProperty.Method = "POST"; httpRequestProperty.Headers.Add("Authorization", "Bearer " + AzureToken);
using (OperationContextScope scope = newOperationContextScope(client.InnerChannel)) {
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
return client.GetLanguageNames("", languageCode, aryLanguageCodes);
}
推荐答案
这看起来像我们在12月服务更新中引入的错误第5位。我们正在研究它。不要更改你的代码。
It looks like a bug we introduced in the service update on December 5th. We are looking into it. Don't change your code yet.
Chris Wendt
Microsoft Translator
Chris Wendt
Microsoft Translator
这篇关于GetLanguageNames仅返回英文名称,无论提供何种语言代码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!