Skip to content

Commit

Permalink
Merge pull request #2 from BibleGet-I-O/development
Browse files Browse the repository at this point in the history
up to v3.0.0.2
  • Loading branch information
JohnRDOrazio authored Jun 30, 2020
2 parents a183b30 + 6eb5919 commit c5263de
Show file tree
Hide file tree
Showing 34 changed files with 280 additions and 131,481 deletions.
231 changes: 228 additions & 3 deletions BibleGetIO/BibleGetAddIn.vb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion BibleGetIO/BibleGetDocInject.vb
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ Public Class BibleGetDocInject
End If
normalText = False
Case "sm"
Dim smallCaps As String = match.Groups(4).Value.ToLower(CultureInfo.CurrentCulture)
Dim smallCaps As String = match.Groups(4).Value.ToLower(CultureInfo.CurrentUICulture)
'//System.out.println("SMALLCAPSIZE THIS TEXT: "+smallCaps);
currentSelection.Font.SmallCaps = True
TypeText(currentSelection, smallCaps)
Expand Down
12 changes: 6 additions & 6 deletions BibleGetIO/BibleGetHelp.vb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Public Class BibleGetHelp
HtmlStr0 &= "</ul>"
HtmlStr0 &= "<p><b>" + __("AUTHOR") + ":</b> " + __("John R. D'Orazio (priest in the Diocese of Rome)") + "</p>"
HtmlStr0 &= "<p><b>" + __("COLLABORATORS") + ":</b> " + __("Giovanni Gregori (computing) and Simone Urbinati (MUG Roma Tre)") + "</p>"
HtmlStr0 &= "<p><b>" + __("Version").ToUpper(CultureInfo.CurrentCulture) + ":</b> " & My.Application.Info.Version.ToString + "</p>"
HtmlStr0 &= "<p><b>" + __("Version").ToUpper(CultureInfo.CurrentUICulture) + ":</b> " & My.Application.Info.Version.ToString + "</p>"
HtmlStr0 &= "<p>© <b>Copyright 2016 BibleGet I/O by John R. D'Orazio</b> <a href=""mailto:priest@johnromanodorazio.com"">priest@johnromanodorazio.com</a></p>"
HtmlStr0 &= "<p><b>" + __("PROJECT WEBSITE") + ": </b><a href=""https://www.bibleget.io"">https://www.bibleget.io</a><br>"
HtmlStr0 &= "<b>" + __("EMAIL ADDRESS FOR INFORMATION OR FEEDBACK ON THE PROJECT") + ":</b> <a href=""mailto:bibleget.io@gmail.com"">bibleget.io@gmail.com</a></p>"
Expand Down Expand Up @@ -306,7 +306,7 @@ Public Class BibleGetHelp
Case __("Biblical Books and Abbreviations")
Dim curLangIsoCode As String = BibleGetAddIn.locale.TwoLetterISOLanguageName
Dim curLangDisplayName As String = New CultureInfo(curLangIsoCode).DisplayName
curLang = localizeLanguage(curLangDisplayName).ToUpper(CultureInfo.CurrentCulture)
curLang = localizeLanguage(curLangDisplayName).ToUpper(CultureInfo.CurrentUICulture)
previewDocument = HtmlStr3
previewDocument &= String.Format(HtmlStr3Table, curLang, booksAndAbbreviations.Item(curLang))
previewDocument &= HtmlStr3Closing
Expand Down Expand Up @@ -369,7 +369,7 @@ Public Class BibleGetHelp
langsObj = JArray.Parse(langsSupported)
booksLangs = langsObj.Count
For Each jsonValue As JValue In langsObj
langsLocalized.Add(localizeLanguage(jsonValue.ToString(CultureInfo.CurrentCulture)))
langsLocalized.Add(localizeLanguage(jsonValue.ToString(CultureInfo.CurrentUICulture)))
Next
langsLocalized.Sort()
booksStr = String.Join(", ", langsLocalized)
Expand All @@ -394,7 +394,7 @@ Public Class BibleGetHelp
Dim buildStr As String
For y As Integer = 0 To (langsObj.Count - 1)
curLang = String.Empty
If langsObj.Value(Of String)(y) IsNot Nothing Then curLang = localizeLanguage(langsObj.Value(Of String)(y)).ToUpper(CultureInfo.CurrentCulture)
If langsObj.Value(Of String)(y) IsNot Nothing Then curLang = localizeLanguage(langsObj.Value(Of String)(y)).ToUpper(CultureInfo.CurrentUICulture)
buildStr = String.Empty
For n As Integer = 0 To 72
Dim styleStr As String = String.Empty
Expand Down Expand Up @@ -424,12 +424,12 @@ Public Class BibleGetHelp

Private Function localizeLanguage(ByVal language As String) As String
If DEBUG_MODE Then BibleGetAddIn.LogInfoToDebug([GetType]().FullName & vbTab & "Attempting to localize language <" & language & ">")
language = language.ToUpper(CultureInfo.CurrentCulture)
language = language.ToUpper(CultureInfo.CurrentUICulture)
Dim langCode As String = String.Empty
If langcodes.TryGetValue(language, langCode) Then
If DEBUG_MODE Then BibleGetAddIn.LogInfoToDebug([GetType]().FullName & vbTab & ">> localization is now taking place...")
Dim myCulture As CultureInfo = New CultureInfo(langCode, False)
Return myCulture.DisplayName.ToUpper(CultureInfo.CurrentCulture)
Return myCulture.DisplayName.ToUpper(CultureInfo.CurrentUICulture)
Else
If DEBUG_MODE Then BibleGetAddIn.LogInfoToDebug([GetType]().FullName & vbTab & ">> Oops, localization does not seem to have been successful. Returning original language string.")
Return language
Expand Down
2 changes: 1 addition & 1 deletion BibleGetIO/BibleGetHelper.vb
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ Public Class BibleGetHelper
idx += 1
End While
If idx < txt.Length - 2 Then
Return txt.Substring(0, idx) + Char.ToString(txt.Chars(idx)).ToUpper(CultureInfo.CurrentCulture) + txt.Substring(idx + 1).ToLower(CultureInfo.CurrentCulture)
Return txt.Substring(0, idx) + Char.ToString(txt.Chars(idx)).ToUpper(CultureInfo.CurrentUICulture) + txt.Substring(idx + 1).ToLower(CultureInfo.CurrentUICulture)
Else
Return txt
End If
Expand Down
19 changes: 10 additions & 9 deletions BibleGetIO/BibleGetIO.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
<OldToolsVersion>4.0</OldToolsVersion>
<VSTO_TrustAssembliesLocation>true</VSTO_TrustAssembliesLocation>
<IsWebBootstrapper>True</IsWebBootstrapper>
<NuGetPackageImportStamp>356005c2</NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<BootstrapperEnabled>true</BootstrapperEnabled>
<PublishUrl>ftp://bibleget.io/httpdocs/msword-addin/</PublishUrl>
<InstallUrl>https://bibleget.io/msword-addin/</InstallUrl>
<TargetCulture>en</TargetCulture>
<ApplicationVersion>3.0.0.1</ApplicationVersion>
<ApplicationVersion>3.0.0.2</ApplicationVersion>
<AutoIncrementApplicationRevision>true</AutoIncrementApplicationRevision>
<UpdateEnabled>true</UpdateEnabled>
<UpdateInterval>4</UpdateInterval>
Expand Down Expand Up @@ -196,17 +197,17 @@
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.Tools.Applications.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.99.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.99.0\lib\net40\System.Data.SQLite.dll</HintPath>
<Reference Include="System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.113.1\lib\net40\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Drawing" />
Expand Down Expand Up @@ -707,11 +708,11 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.99.0\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.99.0\build\net40\System.Data.SQLite.Core.targets')" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.113.1\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.113.1\build\net40\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.99.0\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.99.0\build\net40\System.Data.SQLite.Core.targets'))" />
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.113.1\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.113.1\build\net40\System.Data.SQLite.Core.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion BibleGetIO/BibleGetResource.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ vous pouvez outrepasser le formatage propre de la version de la Bible.</value>
<value>Version de la Bible</value>
</data>
<data name="The BibleGet Plug-in has been correctly initialized!" xml:space="preserve">
<value>Le plugin BibleGet a été &lt;emph&gt; correctement &lt;/emph&gt; initialisé!</value>
<value>Le plugin BibleGet a été correctement initialisé!</value>
</data>
<data name="The BibleGet Plug-in has not been correctly initialized..." xml:space="preserve">
<value>Le plugin BibleGet n'a pas été correctement initialisé ...</value>
Expand Down
26 changes: 16 additions & 10 deletions BibleGetIO/BibleGetRibbon.vb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Imports Microsoft.Office.Tools.Ribbon
Imports System.Diagnostics
Imports System.Globalization

Public Class BibleGetRibbon

Expand All @@ -13,8 +14,8 @@ Public Class BibleGetRibbon
Public BibleVersionForSearch As String
Public TermToSearch As String

Private Shared Function __(ByVal myStr As String) As String
Dim myTranslation As String = BibleGetAddIn.RM.GetString(myStr, BibleGetAddIn.locale)
Private Shared Function __(ByVal myStr As String, ByVal locale As CultureInfo) As String
Dim myTranslation As String = BibleGetAddIn.RM.GetString(myStr, locale)
If Not String.IsNullOrEmpty(myTranslation) Then
Return myTranslation
Else
Expand All @@ -32,14 +33,19 @@ Public Class BibleGetRibbon
End Sub

Private Sub BibleGetRibbon_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
InsertBibleQuoteFromDialogBtn.Label = __("Insert quote from input window")
InsertBibleQuoteFromTextSelectionBtn.Label = __("Insert quote from text selection")
PreferencesBtn.Label = __("User Preferences")
HelpBtn.Label = __("Help")
SendFeedbackBtn.Label = __("Send feedback")
MakeContributionBtn.Label = __("Contribute")
AboutBtn.Label = __("About this plugin")
SearchBtn.Label = __("Search for verses by keyword")
Dim Application As Word.Application = Globals.BibleGetAddIn.Application
Dim lang As Office.MsoLanguageID = Application.LanguageSettings.LanguageID(Office.MsoAppLanguageID.msoLanguageIDUI)
Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(lang)
Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(lang)
Dim locale As CultureInfo = CultureInfo.GetCultureInfo(lang)
InsertBibleQuoteFromDialogBtn.Label = __("Insert quote from input window", locale)
InsertBibleQuoteFromTextSelectionBtn.Label = __("Insert quote from text selection", locale)
PreferencesBtn.Label = __("User Preferences", locale)
HelpBtn.Label = __("Help", locale)
SendFeedbackBtn.Label = __("Send feedback", locale)
MakeContributionBtn.Label = __("Contribute", locale)
AboutBtn.Label = __("About this plugin", locale)
SearchBtn.Label = __("Search for verses by keyword", locale)
bibleGetDB = New BibleGetDatabase
If bibleGetDB.IsInitialized Then
StatusBtn.Image = My.Resources.green_checkmark
Expand Down
12 changes: 6 additions & 6 deletions BibleGetIO/BibleGetSearchResults.vb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Public Class BibleGetSearchResults
searchResultsDT.Columns.Add("IDX", Type.GetType("System.Int32"))
searchResultsDT.Columns.Add("BOOK", Type.GetType("System.Int32"))
searchResultsDT.Columns.Add("CHAPTER", Type.GetType("System.Int32"))
searchResultsDT.Columns.Add("VERSE", Type.GetType("System.Int32"))
searchResultsDT.Columns.Add("VERSE", Type.GetType("System.String"))
searchResultsDT.Columns.Add("VERSETEXT", Type.GetType("System.String"))
searchResultsDT.Columns.Add("SEARCHTERM", Type.GetType("System.String"))
searchResultsDT.Columns.Add("JSONSTR", Type.GetType("System.String"))
Expand Down Expand Up @@ -193,7 +193,7 @@ a.button:hover { background-color: #EEF; }
Dim myCulture As CultureInfo = New CultureInfo(strArray(2), False)
Dim fullLanguageName As String = myCulture.DisplayName
If DEBUG_MODE Then BibleGetAddIn.LogInfoToDebug([GetType]().FullName & vbTab & fullLanguageName)
Dim languageName As String = fullLanguageName.ToUpper(CultureInfo.CurrentCulture)
Dim languageName As String = fullLanguageName.ToUpper(CultureInfo.CurrentUICulture)
BibleVersions.Add(New BibleVersion(s, strArray(0), strArray(1), languageName))
Next

Expand Down Expand Up @@ -395,9 +395,9 @@ a.button:hover { background-color: #EEF; }
Dim previewDocument As String
Dim rowsSearchResultsTable As String = ""

Dim book As String
Dim chapter As String
Dim versenumber As String
Dim book As Integer
Dim chapter As Integer
Dim versenumber As String 'we use string and not integer because some verses contain a letter! otherwise conversion exceptions will be generated
Dim versetext As String
Dim resultJsonStr As String

Expand All @@ -416,7 +416,7 @@ a.button:hover { background-color: #EEF; }
book = result.SelectToken("univbooknum").Value(Of Integer)()
Dim localizedBook As LocalizedBibleBook = localizedBookNames.GetBookByIndex(book - 1)
chapter = result.SelectToken("chapter").Value(Of Integer)()
versenumber = result.SelectToken("verse").Value(Of Integer)()
versenumber = result.SelectToken("verse").Value(Of String)() 'we use string and not integer because some verses contain a letter! otherwise conversion exceptions will be generated
versetext = result.SelectToken("text").Value(Of String)()
versetext = AddMark(versetext, searchTerm)
resultJsonStr = JsonConvert.SerializeObject(result, Formatting.None)
Expand Down
4 changes: 2 additions & 2 deletions BibleGetIO/HealthStatus.vb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Public Class HealthStatus
speakStr += " xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"""
speakStr += " xsi:schemaLocation=""http://www.w3.org/2001/10/synthesis"
speakStr += " http://www.w3.org/TR/speech-synthesis/synthesis.xsd"""
speakStr += " xml:lang=""" & CultureInfo.CurrentCulture.Name & """>"
speakStr += " xml:lang=""" & CultureInfo.CurrentUICulture.Name & """>"
speakStr += msg
'If bibleGetDB.IsInitialized Then
'speakStr += "The BibleGet Plug-in <prosody volume=""x-loud""> has been </prosody> <break strength=""weak"" /> correctly <break strength=""weak"" /> initialized!"
Expand All @@ -57,7 +57,7 @@ Public Class HealthStatus

synth.SetOutputToDefaultAudioDevice()
'Dim engLocale As New CultureInfo("en")
'synth.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult, 1, CultureInfo.CurrentCulture)
'synth.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult, 1, CultureInfo.CurrentUICulture)
synth.SpeakSsmlAsync(speakStr)

End Sub
Expand Down
2 changes: 1 addition & 1 deletion BibleGetIO/InsertQuoteDialog.vb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Public Class InsertQuoteDialog
Dim myCulture As CultureInfo = New CultureInfo(strArray(2), False)
Dim fullLanguageName As String = myCulture.DisplayName
If DEBUG_MODE Then BibleGetAddIn.LogInfoToDebug([GetType]().FullName & vbTab & fullLanguageName)
Dim languageName As String = fullLanguageName.ToUpper(CultureInfo.CurrentCulture)
Dim languageName As String = fullLanguageName.ToUpper(CultureInfo.CurrentUICulture)
BibleVersions.Add(New BibleVersion(s, strArray(0), strArray(1), languageName))
Next

Expand Down
4 changes: 2 additions & 2 deletions BibleGetIO/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("3.0.0.1")>
<Assembly: AssemblyFileVersion("3.0.0.1")>
<Assembly: AssemblyVersion("3.0.0.2")>
<Assembly: AssemblyFileVersion("3.0.0.2")>

Friend Module DesignTimeConstants
Public Const RibbonTypeSerializer As String = "Microsoft.VisualStudio.Tools.Office.Ribbon.Serialization.RibbonTypeCodeDomSerializer, Microsoft.VisualStudio.Tools.Office.Designer, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Expand Down
2 changes: 1 addition & 1 deletion BibleGetIO/VersionCompareByLang.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Public Class VersionCompareByLang
Implements IComparer

Public Function Compare(x As Object, y As Object) As Integer Implements IComparer.Compare
Return New CaseInsensitiveComparer(CultureInfo.CurrentCulture).Compare(x.Lang, y.Lang)
Return New CaseInsensitiveComparer(CultureInfo.CurrentUICulture).Compare(x.Lang, y.Lang)
End Function

End Class
4 changes: 2 additions & 2 deletions BibleGetIO/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.1" targetFramework="net40-client" />
<package id="System.Data.SQLite.Core" version="1.0.99.0" targetFramework="net40-client" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net40-client" />
<package id="System.Data.SQLite.Core" version="1.0.113.1" targetFramework="net40-client" />
</packages>
Loading

0 comments on commit c5263de

Please sign in to comment.