Add "Add 'word' to user dictionary" in spell check context menu - thx Mihai :)

This commit is contained in:
Nikolaj Olsson 2018-02-05 20:05:38 +01:00
parent 579ed635de
commit df0612e61e
7 changed files with 39 additions and 12 deletions

View File

@ -15,6 +15,7 @@
* Allow larger "margin" in SSA/ASSA styles - thx von Suppé
* Export to images alignment option "Center, left justify" - thx Shota
* Add "only if on separate line" option for "Remove interjections" - thx darnn
* Start with uppercase letter after title in "Change casing" - thx 791
* FIXED:
* Fix Ctrl+v of time code in "Time code control" (regr. from 3.5.5) - thx Mohammed
* Fix for format "TTML draft 2006-10" - thx thehulk
@ -25,6 +26,7 @@
* Fix missing color tag for EBU STL - thx Tom
* Fix for null terminated text from mkv - thx taxen/mkver
* Fix focus after Alt+3/4 (previous/next) - thx Jamakmake
* Fix possible crash in "Save original as..." - thx darnn
3.5.5 (26th January 2018)

View File

@ -2031,6 +2031,7 @@ can edit in same subtitle file (collaboration)</Information>
<EditWholeText>Edit whole text</EditWholeText>
<EditWordOnly>Edit word only</EditWordOnly>
<AddXToNames>Add '{0}' to name list</AddXToNames>
<AddXToUserDictionary>Add '{0}' to user dictionary</AddXToUserDictionary>
<AutoFixNames>Auto fix names where only casing differ</AutoFixNames>
<CheckOneLetterWords>Prompt for unknown one letter words</CheckOneLetterWords>
<TreatINQuoteAsING>Treat word ending " in' " as " ing " (English only)</TreatINQuoteAsING>

View File

@ -2327,6 +2327,7 @@ can edit in same subtitle file (collaboration)",
EditWholeText = "Edit whole text",
EditWordOnly = "Edit word only",
AddXToNames = "Add '{0}' to name list",
AddXToUserDictionary = "Add '{0}' to user dictionary",
AutoFixNames = "Auto fix names where only casing differ",
CheckOneLetterWords = "Prompt for unknown one letter words",
TreatINQuoteAsING = "Treat word ending \" in' \" as \" ing \" (English only)",

View File

@ -5506,6 +5506,9 @@ namespace Nikse.SubtitleEdit.Core
case "SpellCheck/AddXToNames":
language.SpellCheck.AddXToNames = reader.Value;
break;
case "SpellCheck/AddXToUserDictionary":
language.SpellCheck.AddXToUserDictionary = reader.Value;
break;
case "SpellCheck/AutoFixNames":
language.SpellCheck.AutoFixNames = reader.Value;
break;

View File

@ -2206,6 +2206,7 @@
public string EditWholeText { get; set; }
public string EditWordOnly { get; set; }
public string AddXToNames { get; set; }
public string AddXToUserDictionary { get; set; }
public string AutoFixNames { get; set; }
public string CheckOneLetterWords { get; set; }
public string TreatINQuoteAsING { get; set; }

View File

@ -34,6 +34,7 @@
this.buttonUseSuggestionAlways = new System.Windows.Forms.Button();
this.buttonAddToNames = new System.Windows.Forms.Button();
this.groupBoxWordNotFound = new System.Windows.Forms.GroupBox();
this.buttonGoogleIt = new System.Windows.Forms.Button();
this.buttonUndo = new System.Windows.Forms.Button();
this.groupBoxSuggestions = new System.Windows.Forms.GroupBox();
this.checkBoxAutoChangeNames = new System.Windows.Forms.CheckBox();
@ -44,7 +45,7 @@
this.textBoxWholeText = new System.Windows.Forms.TextBox();
this.labelActionInfo = new System.Windows.Forms.Label();
this.buttonSpellCheckDownload = new System.Windows.Forms.Button();
this.buttonGoogleIt = new System.Windows.Forms.Button();
this.addXToUserDictionaryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
this.groupBoxWordNotFound.SuspendLayout();
this.groupBoxSuggestions.SuspendLayout();
@ -108,9 +109,10 @@
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addXToNamesnoiseListToolStripMenuItem});
this.addXToNamesnoiseListToolStripMenuItem,
this.addXToUserDictionaryToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(208, 26);
this.contextMenuStrip1.Size = new System.Drawing.Size(208, 70);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStrip1Opening);
//
// addXToNamesnoiseListToolStripMenuItem
@ -247,6 +249,16 @@
this.groupBoxWordNotFound.TabStop = false;
this.groupBoxWordNotFound.Text = "Word not found";
//
// buttonGoogleIt
//
this.buttonGoogleIt.Location = new System.Drawing.Point(6, 158);
this.buttonGoogleIt.Name = "buttonGoogleIt";
this.buttonGoogleIt.Size = new System.Drawing.Size(280, 21);
this.buttonGoogleIt.TabIndex = 7;
this.buttonGoogleIt.Text = "&Google it";
this.buttonGoogleIt.UseVisualStyleBackColor = true;
this.buttonGoogleIt.Click += new System.EventHandler(this.buttonGoogleIt_Click);
//
// buttonUndo
//
this.buttonUndo.Location = new System.Drawing.Point(6, 185);
@ -357,15 +369,12 @@
this.buttonSpellCheckDownload.UseVisualStyleBackColor = true;
this.buttonSpellCheckDownload.Click += new System.EventHandler(this.buttonSpellCheckDownload_Click);
//
// buttonGoogleIt
// addXToUserDictionaryToolStripMenuItem
//
this.buttonGoogleIt.Location = new System.Drawing.Point(6, 158);
this.buttonGoogleIt.Name = "buttonGoogleIt";
this.buttonGoogleIt.Size = new System.Drawing.Size(280, 21);
this.buttonGoogleIt.TabIndex = 7;
this.buttonGoogleIt.Text = "&Google it";
this.buttonGoogleIt.UseVisualStyleBackColor = true;
this.buttonGoogleIt.Click += new System.EventHandler(this.buttonGoogleIt_Click);
this.addXToUserDictionaryToolStripMenuItem.Name = "addXToUserDictionaryToolStripMenuItem";
this.addXToUserDictionaryToolStripMenuItem.Size = new System.Drawing.Size(207, 22);
this.addXToUserDictionaryToolStripMenuItem.Text = "Add x to user dictionary";
this.addXToUserDictionaryToolStripMenuItem.Click += new System.EventHandler(this.AddXToUserDictionaryToolStripMenuItem_Click);
//
// SpellCheck
//
@ -437,5 +446,6 @@
private System.Windows.Forms.Button buttonSpellCheckDownload;
private System.Windows.Forms.Button buttonUndo;
private System.Windows.Forms.Button buttonGoogleIt;
private System.Windows.Forms.ToolStripMenuItem addXToUserDictionaryToolStripMenuItem;
}
}

View File

@ -358,6 +358,7 @@ namespace Nikse.SubtitleEdit.Forms
{
string word = richTextBoxParagraph.SelectedText.Trim();
addXToNamesnoiseListToolStripMenuItem.Text = string.Format(Configuration.Settings.Language.SpellCheck.AddXToNames, word);
addXToUserDictionaryToolStripMenuItem.Text = string.Format(Configuration.Settings.Language.SpellCheck.AddXToUserDictionary, word);
}
else
{
@ -374,6 +375,15 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void AddXToUserDictionaryToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(richTextBoxParagraph.SelectedText))
{
ChangeWord = richTextBoxParagraph.SelectedText.Trim();
DoAction(SpellCheckAction.AddToDictionary);
}
}
private void CheckBoxAutoChangeNamesCheckedChanged(object sender, EventArgs e)
{
if (textBoxWord.Text.Length < 2)
@ -1085,6 +1095,5 @@ namespace Nikse.SubtitleEdit.Forms
if (!string.IsNullOrWhiteSpace(text))
System.Diagnostics.Process.Start("https://www.google.com/search?q=" + Utilities.UrlEncode(text));
}
}
}