Skip to content

Commit

Permalink
Minor refact
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandrofly committed Mar 4, 2016
1 parent e9efb6a commit 1292c6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/XmlContentTranslator/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ private void ListViewLanguageTagsSelectedIndexChanged(object sender, EventArgs e

var node = listViewLanguageTags.SelectedItems[0].Tag as XmlNode;
if (node != null)
toolStripStatusLabel2.Text = string.Format("{0} {1} / {2}", XmlUtils.BuildNodePath(node).Replace("#document/", ""), listViewLanguageTags.SelectedItems[0].Index + 1, listViewLanguageTags.Items.Count);
toolStripStatusLabel2.Text = string.Format("{0} {1} / {2}", XmlUtils.BuildNodePath(node).Replace("#document/", string.Empty), listViewLanguageTags.SelectedItems[0].Index + 1, listViewLanguageTags.Items.Count);
else
toolStripStatusLabel2.Text = string.Format("{0} / {1}", listViewLanguageTags.SelectedItems[0].Index + 1, listViewLanguageTags.Items.Count);
}
Expand Down Expand Up @@ -547,7 +547,7 @@ public static string TranslateTextViaScreenScraping(string input, string languag
input = input.Replace("'", "'");

//string url = String.Format("https://www.google.com/translate_t?hl=en&ie=UTF8&text={0}&langpair={1}", HttpUtility.UrlEncode(input), languagePair);
string url = String.Format("https://translate.google.com/?hl=en&eotf=1&sl={0}&tl={1}&q={2}", languagePair.Substring(0, 2), languagePair.Substring(3), HttpUtility.UrlEncode(input));
string url = string.Format("https://translate.google.com/?hl=en&eotf=1&sl={0}&tl={1}&q={2}", languagePair.Substring(0, 2), languagePair.Substring(3), HttpUtility.UrlEncode(input));

var webClient = new WebClient { Encoding = Encoding.Default };
string result = webClient.DownloadString(url);
Expand Down

0 comments on commit 1292c6e

Please sign in to comment.