mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Minor fix in Google translate
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@473 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
a39385dd81
commit
b2897ea4fb
1
src/Forms/GoogleOrMicrosoftTranslate.Designer.cs
generated
1
src/Forms/GoogleOrMicrosoftTranslate.Designer.cs
generated
@ -176,6 +176,7 @@
|
||||
this.Name = "GoogleOrMicrosoftTranslate";
|
||||
this.Text = "GoogleOrMicrosoftTranslate";
|
||||
this.Shown += new System.EventHandler(this.GoogleOrMicrosoftTranslate_Shown);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GoogleOrMicrosoftTranslate_KeyDown);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -2,12 +2,14 @@
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System.Drawing;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
public sealed partial class GoogleOrMicrosoftTranslate : Form
|
||||
{
|
||||
public string TranslatedText { get; set; }
|
||||
private string _googleText = null;
|
||||
|
||||
public GoogleOrMicrosoftTranslate()
|
||||
{
|
||||
@ -18,7 +20,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
RemovedLanguagesNotInMicrosoftTranslate(comboBoxTo);
|
||||
|
||||
labelFrom.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.From;
|
||||
labelTo.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.From;
|
||||
labelTo.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.To;
|
||||
labelSourceText.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.SourceText;
|
||||
buttonGoogle.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.GoogleTranslate;
|
||||
buttonMicrosoft.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.MicrosoftTranslate;
|
||||
@ -96,6 +98,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string from = (comboBoxFrom.SelectedItem as Nikse.SubtitleEdit.Forms.GoogleTranslate.ComboBoxItem).Value;
|
||||
string to = (comboBoxTo.SelectedItem as Nikse.SubtitleEdit.Forms.GoogleTranslate.ComboBoxItem).Value;
|
||||
string languagePair = from + "|" + to;
|
||||
|
||||
buttonGoogle.Text = string.Empty;
|
||||
buttonGoogle.Text = Forms.GoogleTranslate.TranslateTextViaApi(textBoxSourceText.Text, languagePair);
|
||||
|
||||
GoogleTranslate gt = new GoogleTranslate();
|
||||
@ -137,5 +141,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void GoogleOrMicrosoftTranslate_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -291,6 +291,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
test = test.Replace("\\u0026#39;", "'");
|
||||
test = test.Replace("\\u0026amp;", "&");
|
||||
test = test.Replace("\\u0026quot;", "\"");
|
||||
test = test.Replace("\\u0026apos;", "'");
|
||||
test = test.Replace("\\u0026lt;", "<");
|
||||
test = test.Replace("\\u0026gt;", ">");
|
||||
test = test.Replace("\\u003d", "=");
|
||||
|
Loading…
Reference in New Issue
Block a user