Skip to content

Commit

Permalink
i18n check and todo cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vogel612 committed Jul 13, 2016
1 parent 13c9ee6 commit c568f96
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Collections.Generic;

namespace Rubberduck.UI.Command.MenuItems.ParentMenus
{
public class ToolsParentMenu : ParentMenuItemBase
{
public ToolsParentMenu(IEnumerable<IMenuItem> items)
: base("ToolsMenu", items)
{
}

public override int DisplayOrder
{
get
{
return (int)RubberduckMenuItemDisplayOrder.Tools;
}
}


}

public enum ToolsMenuItemDisplayOrder
{
SourceControl,
ToDoExplorer,
RegexAssistant,
}
}
11 changes: 3 additions & 8 deletions RetailCoder.VBE/UI/RegexAssistant/RegexAssistantViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Rubberduck.RegexAssistant;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
Expand Down Expand Up @@ -72,7 +73,7 @@ private void RecalculateDescription()
{
if (_pattern.Equals(string.Empty))
{
_description = "No Pattern given";
_description = RubberduckUI.RegexAssistant_NoPatternError;
var results = new List<TreeViewItem>();
var rootTreeItem = new TreeViewItem();
rootTreeItem.Header = _description;
Expand Down Expand Up @@ -119,13 +120,7 @@ public string DescriptionResults

private static TreeViewItem AsTreeViewItem(IRegularExpression expression)
{
var result = new TreeViewItem();
result.Header = "Some unknown IRegularExpression subtype was in the view";
foreach (var subtree in expression.Subexpressions.Select(exp => AsTreeViewItem((dynamic)exp)))
{
result.Items.Add(subtree);
}
return result;
throw new InvalidOperationException("Some unknown IRegularExpression subtype was in RegexAssistantViewModel");
}

private static TreeViewItem AsTreeViewItem(ErrorExpression expression)
Expand Down
9 changes: 9 additions & 0 deletions RetailCoder.VBE/UI/RubberduckUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion RetailCoder.VBE/UI/RubberduckUI.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ Warnung: Alle eigenen Einstellungen gehen dabei verloren. Die Originaldatei wird
<value>Test Explorer</value>
</data>
<data name="TodoExplorer_Caption" xml:space="preserve">
<value>Todo Explorer</value>
<value>ToDo Liste</value>
</data>
<data name="Warning" xml:space="preserve">
<value>Warnung</value>
Expand Down
3 changes: 3 additions & 0 deletions RetailCoder.VBE/UI/RubberduckUI.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1751,4 +1751,7 @@ All our stargazers, likers &amp; followers, for the warm fuzzies
<data name="ToolsMenu" xml:space="preserve">
<value>T&amp;ools</value>
</data>
<data name="RegexAssistant_NoPatternError" xml:space="preserve">
<value>No Pattern given</value>
</data>
</root>
4 changes: 0 additions & 4 deletions Rubberduck.RegexAssistant/Atom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public CharacterClass(string specifier)
Match m = Matcher.Match(specifier);
if (!m.Success)
{
// TODO: i18n
throw new ArgumentException("The given specifier does not denote a character class");
}
this._specifier = specifier;
Expand Down Expand Up @@ -55,7 +54,6 @@ private IList<string> ExtractCharacterSpecifiers(string characterClass)
{
if (specifier.Value.EndsWith("-\\"))
{
// TODO: i18n
throw new ArgumentException("Character Ranges that have incorrectly escaped characters as target are not allowed");
}
else if (specifier.Value.Length == 1)
Expand Down Expand Up @@ -112,7 +110,6 @@ public class Group : IAtom
Match m = Matcher.Match(specifier);
if (!m.Success)
{
// TODO i18n
throw new ArgumentException("The given specifier does not denote a Group");
}
_subexpression = RegularExpression.Parse(m.Groups["expression"].Value);
Expand Down Expand Up @@ -184,7 +181,6 @@ public Literal(string specifier)
Match m = Matcher.Match(specifier);
if (!m.Success)
{
// TODO: i18n
throw new ArgumentException("The given specifier does not denote a Literal");
}
_specifier = specifier;
Expand Down
1 change: 0 additions & 1 deletion Rubberduck.RegexAssistant/Quantifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class Quantifier
public readonly int MinimumMatches;
public readonly int MaximumMatches;

// FIXME i18n ? Shouldn't ever show up actually...
public Quantifier(string expression)
{
if (expression.Length == 0)
Expand Down

0 comments on commit c568f96

Please sign in to comment.