Skip to content

Commit

Permalink
Merge pull request #51 from Ordisoftware/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ordisoftware authored Mar 14, 2020
2 parents 37da97d + 877cb52 commit 50af986
Show file tree
Hide file tree
Showing 35 changed files with 4,367 additions and 2,077 deletions.
4 changes: 4 additions & 0 deletions Help/index-en.htm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ <h4>Keyboard shortcuts</h4>
<td width="125">F2</td>
<td width="1616">Settings view</td>
</tr>
<tr>
<td width="125">F3</td>
<td width="1616">Search term</td>
</tr>
<tr>
<td width="125">F8</td>
<td width="1616">Preferences</td>
Expand Down
4 changes: 4 additions & 0 deletions Help/index-fr.htm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ <h4>Raccourcis clavier</h4>
<td width="125">F2</td>
<td>Vue des param&egrave;tres</td>
</tr>
<tr>
<td width="125">F3</td>
<td>Recherche d'un terme</td>
</tr>
<tr>
<td width="125">F8</td>
<td>Pr&eacute;f&eacute;rences</td>
Expand Down
Binary file added Project/Dependencies/ConvertFromUnicode.ico
Binary file not shown.
Binary file added Project/Dependencies/ConvertToUnicode.ico
Binary file not shown.
Binary file added Project/Dependencies/Fatcow/research.ico
Binary file not shown.
Binary file added Project/Dependencies/Fatcow/search_field.ico
Binary file not shown.
25 changes: 25 additions & 0 deletions Project/Hebrew Letters (vs2017).csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,20 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Source\Forms\Boxes\SearchTermResults.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Source\Forms\Boxes\SearchTermResults.Designer.cs">
<DependentUpon>SearchTermResults.cs</DependentUpon>
</Compile>
<Compile Include="Source\Forms\Boxes\SearchTerm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Source\Forms\Boxes\SearchTerm.Designer.cs">
<DependentUpon>SearchTerm.cs</DependentUpon>
</Compile>
<Compile Include="Source\Classes\HebrewLetters.cs" />
<Compile Include="Source\Classes\OnlineWordProvider.cs" />
<Compile Include="Source\Enums\Translations.cs" />
<Compile Include="Source\Classes\Localizer.cs" />
<Compile Include="Source\Classes\SettingsHelper.cs" />
Expand Down Expand Up @@ -126,6 +139,12 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Source\Forms\Boxes\SearchTermResults.fr.resx">
<DependentUpon>SearchTermResults.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Source\Forms\Boxes\SearchTermResults.resx">
<DependentUpon>SearchTermResults.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Source\Forms\Config\AboutBox.fr.resx">
<DependentUpon>AboutBox.cs</DependentUpon>
</EmbeddedResource>
Expand All @@ -147,6 +166,12 @@
<EmbeddedResource Include="Source\Forms\Config\PreferencesForm.resx">
<DependentUpon>PreferencesForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Source\Forms\Boxes\SearchTerm.fr.resx">
<DependentUpon>SearchTerm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Source\Forms\Boxes\SearchTerm.resx">
<DependentUpon>SearchTerm.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Data\DataSet.xsc">
<DependentUpon>DataSet.xsd</DependentUpon>
Expand Down
6 changes: 3 additions & 3 deletions Project/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ordisoftware")]
[assembly: AssemblyProduct("www.ordisoftware.com/projects/hebrew-letters")]
[assembly: AssemblyCopyright("Copyright 2012-2019 Olivier Rogier")]
[assembly: AssemblyCopyright("Copyright 2012-2020 Olivier Rogier")]
[assembly: AssemblyTrademark("www.ordisoftware.com")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.9.0.0")]
[assembly: AssemblyFileVersion("2.9.0.0")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
67 changes: 62 additions & 5 deletions Project/Source/Classes/HebrewLetters.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <license>
/// This file is part of Ordisoftware Hebrew Letters.
/// Copyright 2016-2019 Olivier Rogier.
/// Copyright 2016-2020 Olivier Rogier.
/// See www.ordisoftware.com for more information.
/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
/// If a copy of the MPL was not distributed with this file, You can obtain one at
Expand All @@ -11,7 +11,7 @@
/// You may add additional accurate notices of copyright ownership.
/// </license>
/// <created> 2012-10 </created>
/// <edited> 2019-09 </edited>
/// <edited> 2020-03 </edited>
using System;
using System.Collections.Generic;

Expand Down Expand Up @@ -84,14 +84,34 @@ static public string UnFinaleAll(string str)
static public string ConvertToHebrewFont(string str)
{
string result = "";
foreach ( char c in str ) result += ConvertToKey(c);
foreach ( char c in str )
{
char cNew = ConvertToKey(c);
if ( cNew != '\0' )
result += cNew;
}
return result;
}

/// <summary>
// Convert hebrew font key codes to standard hebrew letters.
/// </summary>
static public string ConvertToUnicode(string str)
{
string result = "";
foreach ( char c in str )
{
char cNew = ConvertToUnicode(c);
if ( cNew != '\0' )
result = cNew + result;
}
return result;
}

/// <summary>
// Convert letters from www.fourmilab.ch/etexts/www/hebrew/Bible to font codes.
/// </summary>
static private char ConvertToKey(char c)
static public char ConvertToKey(char c)
{
switch ( c )
{
Expand Down Expand Up @@ -124,7 +144,44 @@ static private char ConvertToKey(char c)
case 'ת': return 't';
case ':': return '.';
case '-': return ' ';
default: return c;
default: return '\0';
}
}

static public char ConvertToUnicode(char c)
{
switch ( c )
{
case 'a': return 'א';
case 'b': return 'ב';
case 'g': return 'ג';
case 'd': return 'ד';
case 'h': return 'ה';
case 'v': return 'ו';
case 'z': return 'ז';
case 'x': return 'ח';
case 'u': return 'ט';
case 'y': return 'י';
case 'k': return 'כ';
case '!': return 'ך';
case 'l': return 'ל';
case 'm': return 'מ';
case ',': return 'ם';
case 'n': return 'נ';
case ']': return 'ן';
case 'c': return 'ס';
case 'i': return 'ע';
case 'p': return 'פ';
case '[': return 'ף';
case 'j': return 'צ';
case '/': return 'ץ';
case 'q': return 'ק';
case 'r': return 'ר';
case '>': return 'ש';
case 't': return 'ת';
case '.': return ':';
case ' ': return '-';
default: return '\0';
}
}

Expand Down
2 changes: 1 addition & 1 deletion Project/Source/Classes/Localizer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <license>
/// This file is part of Ordisoftware Hebrew Letters.
/// Copyright 2016-2019 Olivier Rogier.
/// Copyright 2016-2020 Olivier Rogier.
/// See www.ordisoftware.com for more information.
/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
/// If a copy of the MPL was not distributed with this file, You can obtain one at
Expand Down
147 changes: 147 additions & 0 deletions Project/Source/Classes/OnlineWordProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/// <license>
/// This file is part of Ordisoftware Hebrew Letters.
/// Copyright 2016-2020 Olivier Rogier.
/// See www.ordisoftware.com for more information.
/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
/// If a copy of the MPL was not distributed with this file, You can obtain one at
/// https://mozilla.org/MPL/2.0/.
/// If it is not possible or desirable to put the notice in a particular file,
/// then You may include the notice in a location(such as a LICENSE file in a
/// relevant directory) where a recipient would be likely to look for such a notice.
/// You may add additional accurate notices of copyright ownership.
/// </license>
/// <created> 2020-03 </created>
/// <edited> 2020-03 </edited>
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace Ordisoftware.HebrewLetters
{

public class OnlineWordProvider
{
public string Name { get; set; }
public string URL { get; set; }
public ToolStripMenuItem CreateMenuItem(EventHandler action, Image image = null)
{
var result = new ToolStripMenuItem(Name, image);
result.Tag = URL;
result.Click += action;
return result;
}
}

static public class OnlineWordProviders
{

static public List<OnlineWordProvider> Items
{
get;
private set;
}

static OnlineWordProviders()
{
Items = new List<OnlineWordProvider>();
OnlineWordProvider item;

item = new OnlineWordProvider();
item.Name = "Pealim Hebrew Verb Tables EN";
item.URL = "https://www.pealim.com/search/?q=%WORD%";
Items.Add(item);

item = new OnlineWordProvider();
item.Name = "Sefaria Klein Dictionary EN";
item.URL = "https://www.sefaria.org/Klein_Dictionary%2C_%WORD%_%E1%B4%B5?lang=bi";
Items.Add(item);

item = new OnlineWordProvider();
item.Name = "Dict.com FR";
item.URL = "https://www.dict.com/hebreu-francais/%WORD%";
Items.Add(item);

Items.Add(new OnlineWordProvider() { Name = "-" });

item = new OnlineWordProvider();
item.Name = "Wiktionary EN";
item.URL = "https://en.wiktionary.org/wiki/%WORD%";
Items.Add(item);
item = new OnlineWordProvider();
item.Name = "Wiktionary FR";
item.URL = "https://fr.wiktionary.org/w/index.php?search=%WORD%";
Items.Add(item);

Items.Add(new OnlineWordProvider() { Name = "-" });

item = new OnlineWordProvider();
item.Name = "Google Translate EN";
item.URL = "https://translate.google.com/?op=translate&sl=iw&tl=en&text=%WORD%";
Items.Add(item);
item = new OnlineWordProvider();
item.Name = "Google Translate FR";
item.URL = "https://translate.google.com/?op=translate&sl=iw&tl=fr&text=%WORD%";
Items.Add(item);

Items.Add(new OnlineWordProvider() { Name = "-" });

item = new OnlineWordProvider();
item.Name = "Bing Translate EN";
item.URL = "https://www.bing.com/translator/?from=he&to=en&text=%WORD%";
Items.Add(item);
item = new OnlineWordProvider();
item.Name = "Bing Translate FR";
item.URL = "https://www.bing.com/translator/?from=he&to=fr&text=%WORD%";
Items.Add(item);

Items.Add(new OnlineWordProvider() { Name = "-" });

item = new OnlineWordProvider();
item.Name = "Reverso Dictionary EN";
item.URL = "https://dictionary.reverso.net/hebrew-english/%WORD%";
Items.Add(item);
item = new OnlineWordProvider();
item.Name = "Reverso Dictionary FR";
item.URL = "https://dictionnaire.reverso.net/hebreu-francais/%WORD%";
Items.Add(item);

Items.Add(new OnlineWordProvider() { Name = "-" });

item = new OnlineWordProvider();
item.Name = "Reverso Context EN";
item.URL = "https://context.reverso.net/translation/hebrew-english/%WORD%";
Items.Add(item);
item = new OnlineWordProvider();
item.Name = "Reverso Context FR";
item.URL = "https://context.reverso.net/translation/hebrew-french/%WORD%";
Items.Add(item);

Items.Add(new OnlineWordProvider() { Name = "-" });

item = new OnlineWordProvider();
item.Name = "Glosbe Dictionary EN";
item.URL = "https://en.glosbe.com/he/en/%WORD%";
Items.Add(item);
item = new OnlineWordProvider();
item.Name = "Glosbe Dictionary FR";
item.URL = "https://fr.glosbe.com/he/fr/%WORD%";
Items.Add(item);

Items.Add(new OnlineWordProvider() { Name = "-" });

item = new OnlineWordProvider();
item.Name = "Google Search";
item.URL = "https://www.google.com/search?q=%WORD%";
Items.Add(item);

item = new OnlineWordProvider();
item.Name = "Bing Search";
item.URL = "http://www.bing.com/search?q=%WORD%";
Items.Add(item);

}

}

}
2 changes: 1 addition & 1 deletion Project/Source/Classes/SettingsHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <license>
/// This file is part of Ordisoftware Hebrew Letters.
/// Copyright 2016-2019 Olivier Rogier.
/// Copyright 2016-2020 Olivier Rogier.
/// See www.ordisoftware.com for more information.
/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
/// If a copy of the MPL was not distributed with this file, You can obtain one at
Expand Down
11 changes: 7 additions & 4 deletions Project/Source/Controls/LettersControl.Designer.cs

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

Loading

0 comments on commit 50af986

Please sign in to comment.