Skip to content

Commit

Permalink
Merge branch develop v9.3.6-210925.0024
Browse files Browse the repository at this point in the history
  • Loading branch information
anoyetta committed Sep 24, 2021
2 parents eb06bf7 + 65f89bb commit 88fd713
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion source/@MasterVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v9.3.5
v9.3.6
4 changes: 2 additions & 2 deletions source/ACT.Hojoring.Common/Version.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;

[assembly: AssemblyVersion("9.3.0.5")]
[assembly: AssemblyFileVersion("9.3.0.5")]
[assembly: AssemblyVersion("9.3.0.6")]
[assembly: AssemblyFileVersion("9.3.0.6")]
46 changes: 30 additions & 16 deletions source/ACT.TTSYukkuri/ACT.TTSYukkuri.Core/KanjiTranslator.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
using FFXIV.Framework.Common;
using NLog;
using System;
using System.Runtime.InteropServices;

namespace ACT.TTSYukkuri
{
Expand Down Expand Up @@ -61,29 +61,39 @@ public void Initialize()
{
lock (lockObject)
{
if (this.IFELang == null)
try
{
this.IFELang = Activator.CreateInstance(Type.GetTypeFromProgID("MSIME.Japan")) as IFELanguage;

if (this.IFELang == null)
{
this.Logger.Error("IFELANG IME initialize faild.");
}
else
{
var hr = this.IFELang.Open();
if (hr != 0)
this.IFELang = Activator.CreateInstance(Type.GetTypeFromProgID("MSIME.Japan")) as IFELanguage;

if (this.IFELang == null)
{
this.Logger.Error("IFELANG IME connection faild.");
this.IFELang = null;
this.Logger.Warn("IFELANG IME initialize failed. Disabled IME reverse translation.");
}
else
{
var hr = this.IFELang.Open();
if (hr != 0)
{
this.Logger.Warn("IFELANG IME connection failed. Disabled IME reverse translation.");
this.IFELang = null;
}

this.Logger.Trace("IFELANG IME Connected.");
}

this.Logger.Trace("IFELANG IME Connected.");
}
}
catch (Exception)
{
this.Logger.Warn("IFELANG IME initialize failed due to an unexpected exception. Disabled IME reverse translation.");
this.IFELang = null;
}
}
}

private volatile bool hasWarned;

/// <summary>
/// 読みがなを取得する
/// </summary>
Expand All @@ -110,7 +120,11 @@ public string GetPhonetic(
}
else
{
this.Logger.Error($"IFELANG IME not ready. text={text}");
if (!this.hasWarned)
{
this.hasWarned = true;
this.Logger.Warn($"IFELANG IME has been disabled. text={text}");
}
}

return yomigana;
Expand Down

0 comments on commit 88fd713

Please # to comment.