mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 03:33:18 +01:00
Add proxy
This commit is contained in:
parent
25733fd70a
commit
e07603b2a9
@ -80,6 +80,7 @@ namespace Nikse.SubtitleEdit.Core.Translate
|
||||
{
|
||||
var url = string.Format(TranslateUrl, sourceLanguage, targetLanguage);
|
||||
var httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
|
||||
httpWebRequest.Proxy = Utilities.GetProxy();
|
||||
httpWebRequest.ContentType = "application/json";
|
||||
httpWebRequest.Method = "POST";
|
||||
httpWebRequest.Headers.Add(SecurityHeaderName, _ocpApimSubscriptionKey);
|
||||
@ -97,16 +98,7 @@ namespace Nikse.SubtitleEdit.Core.Translate
|
||||
{
|
||||
isFirst = false;
|
||||
}
|
||||
|
||||
var t = text;
|
||||
if (sourceLanguage == "en")
|
||||
{
|
||||
t = text.Replace(" don't ", " do not ");
|
||||
t = text.Replace(" don't ", " do not ");
|
||||
t = text.Replace(" don't ", " do not ");
|
||||
}
|
||||
|
||||
jsonBuilder.Append("{ \"Text\":\"" + Json.EncodeJsonText(t) + "\"}");
|
||||
jsonBuilder.Append("{ \"Text\":\"" + Json.EncodeJsonText(text) + "\"}");
|
||||
}
|
||||
jsonBuilder.Append("]");
|
||||
string json = jsonBuilder.ToString();
|
||||
|
Loading…
Reference in New Issue
Block a user