Skip to content

Commit

Permalink
1.253 업데이트
Browse files Browse the repository at this point in the history
DeepL 단축키 추가, DeepL 이 안 되던 문제 수정
  • Loading branch information
killkimno committed May 17, 2023
1 parent 8c21043 commit bbdf601
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 48 deletions.
3 changes: 3 additions & 0 deletions MORT/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,9 @@ public void gHook_KeyDown(object sender, KeyEventArgs e)
case KeyInputLabel.KeyType.EzTrans:
ApplyTransTypeFromHotKey(SettingManager.TransType.ezTrans, LocalizeString("Switching ezTrans"));
break;
case KeyInputLabel.KeyType.DeepL:
ApplyTransTypeFromHotKey(SettingManager.TransType.deepl, LocalizeString("Switching DeepL"));
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion MORT/KeyInputLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class KeyInputLabel : UserControl
public enum KeyType
{
None, Translate, OpenDic, QuickOCR, SnapShot, TranslateOnce, Hide,
OpenSetting, LayerTransparency, DBTranslate, NaverTranslate, GoogleTranslate, GoogleSheetTranslate, EzTrans
OpenSetting, LayerTransparency, DBTranslate, NaverTranslate, GoogleTranslate, GoogleSheetTranslate, EzTrans, DeepL
}
public KeyType keyType = KeyType.None;
public bool isFocus;
Expand Down
6 changes: 3 additions & 3 deletions MORT/Properties/Settings.Designer.cs

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

6 changes: 3 additions & 3 deletions MORT/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<Profiles />
<Settings>
<Setting Name="MORT_VERSION" Type="System.String" Scope="Application">
<Value Profile="(Default)">1.252V</Value>
<Value Profile="(Default)">1.253V</Value>
</Setting>
<Setting Name="LAYER_TEXT" Type="System.String" Scope="Application">
<Value Profile="(Default)">MORT {0}
레이어 번역창</Value>
</Setting>
<Setting Name="MORT_VERSION_VALUE" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">1252</Value>
<Value Profile="(Default)">1253</Value>
</Setting>
<Setting Name="TOOLTIP_LIST" Type="System.String" Scope="Application">
<Value Profile="(Default)">MORT를 처음 쓰시면 그 외-&gt; MORT 사용법을 확인해 주세요,
Expand Down Expand Up @@ -70,7 +70,7 @@ OCR 영역을 빠르게 추가하고 싶을 땐 빠른 OCR 영역을 사용하
<Value Profile="(Default)">색 영역을 이용해 추출한 문장의 폰트색을 지정합니다.</Value>
</Setting>
<Setting Name="MORT_RELEASE" Type="System.String" Scope="Application">
<Value Profile="(Default)">2023 05 02</Value>
<Value Profile="(Default)">2023 05 17</Value>
</Setting>
<Setting Name="TOOLTIP_MULTI_DB" Type="System.String" Scope="Application">
<Value Profile="(Default)">DB 번역문 검색시 OCR 추출 문장에 포함 된 번역문을 모두 가져옵니다.</Value>
Expand Down
14 changes: 9 additions & 5 deletions MORT/Resources/localize.csv
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ You can set the area by dragging the screen in the OCR area setting state.
,Switching Google Sheet,번역방식 - 구글 시트로 변경되었습니다,Translation method -It has been changed to Google Sheet
,Switching Basic,번역방식 - 기본 번역기로 변경되었습니다,Translation method -Changed to a default translator
,Switching Papago,번역방식 - 네이버(파파고)로 변경되었습니다,Translation method -changed to Naver (Papago)
,Switching ezTrans,번역방식 - 이지트랜스로 변경되었습니다,Translation method -It has been changed to Easytrans
,Switching ezTrans,번역방식 - 이지트랜스로 변경되었습니다,Translation method -It has been changed to ezTrans
,Switching DeepL,번역방식 - DeepL로 변경되었습니다,Translation method -changed to DeepL
,Close App Message,"종료하시겠습니까?
[]
[]
Expand All @@ -271,8 +272,8 @@ Would you like to check the usage?"
계속 하시겠습니까?","In the default translator, general translation is not recommended.
Would you like to continue?"
,Basic Translate Warning Title,경고 - 스냅샷을 이용해 주세요,Warning -Please use a snapshot
,DeepL Translate Warning,"딥플 번역기 상태에서 일반 번역은 권장하지 않습니다
계속 하시겠습니까?","General translations are not recommended in a deep -ple translator state.
,DeepL Translate Warning,"DeepL 번역기 상태에서 일반 번역은 권장하지 않습니다
계속 하시겠습니까?","General translations are not recommended in a DeepL translator state.
Do you want to continue?"
,DeepL Translate Warning Title,경고 - 스냅샷을 이용해 주세요,Warning -Please use a snapshot
,Ocar Area Location Warning,"[경고 - OCR 영역과 번역창이 겹쳤기 때문에 번역이 제대로 안 될 수 있습니다
Expand Down Expand Up @@ -344,8 +345,11 @@ exclusion area"
,Adv HotKey BasicTrans Info,기본 번역기를 이용해 번역합니다,Translated using the default translator
,Adv HotKey Google Sheet,구글 시트 사용 : ,Using Google Sheet:
,Adv HotKey Google Sheet Info,구글 시트를 이용해 번역합니다,Translated using Google Sheet
,Adv HotKey EzTrans,이지트랜스 사용 : ,Use Easy Trospin:
,Adv HotKey EzTrans Info,이지트랜스를 이용해 번역합니다,Translate
,Adv HotKey EzTrans,이지트랜스 사용 : ,Use EzTrans:
,Adv HotKey EzTrans Info,이지트랜스를 이용해 번역합니다,Translate using EzTrans
,Adv HotKey DeepL,DeepL 사용 : ,Using DeepL:
,Adv HotKey DeepL Info,DeepL을 이용해 번역합니다,Translated using DeepL
,,,
13000,Adv Transform Overlay,오버레이 번역창,Overlay translation window
,Adv Transform Dark,어두운 번역창,Dark translation window
,Adv Transform General,일반,Normal
Expand Down
1 change: 1 addition & 0 deletions MORT/SettingData/BaseSettingData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ public override void LoadValue(string fileData)
LoadHotkey(0, KeyInputLabel.KeyType.GoogleTranslate, fileData);
LoadHotkey(0, KeyInputLabel.KeyType.GoogleSheetTranslate, fileData);
LoadHotkey(0, KeyInputLabel.KeyType.EzTrans, fileData);
LoadHotkey(0, KeyInputLabel.KeyType.DeepL, fileData);
}

public override string ToSave()
Expand Down
6 changes: 3 additions & 3 deletions MORT/TransAPI/DeepLTranslateAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public class DeepLTranslateAPI : IDisposable
private IDeeplAPIContract _contract;
private bool _unavailableWebview;

public const float NormalTimeoutSecond = 4.5f;
public const float AltTimeoutSecond = 2.5f;
public const float NormalTimeoutSecond = 5f;
public const float AltTimeoutSecond = 3f;

private string _frontUrl;
private string _urlFormat;
Expand Down Expand Up @@ -157,7 +157,7 @@ private async Task<string> WaitResultAsync()
Console.WriteLine($"api {_dtTimeOut} / now {DateTime.Now}");
return "TimeOut";
}
await Task.Delay(100);
await Task.Delay(80);
}

return _view.LastResult;
Expand Down
12 changes: 7 additions & 5 deletions MORT/TransAPI/DeeplWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ private async Task SourceAsync(string text, string transCode, string resultCode

text = text.Replace(@"/", @"\/");
//랜덤 딜레이를 준다
await Task.Delay((int)(random * 200));
Util.ShowLog($"delay {(int)(random * 200)}");
await Task.Delay((int)(random * 180));
Util.ShowLog($"delay {(int)(random * 180)}");
string requestText = RestSharp.Extensions.StringExtensions.UrlEncode(text);

if(requestText != _lastUrl)
Expand All @@ -145,15 +145,17 @@ private async Task SourceAsync(string text, string transCode, string resultCode
{
await Task.Delay(50);
var html = await _webView.CoreWebView2.ExecuteScriptAsync(_elementTarget);
if (html == null)

if (html == null || html == "null")
{
result = _defaultKey;
Console.WriteLine("null");
await Task.Delay(100);
continue;
}

result = html;
if (_dtTimeout < DateTime.Now)
if (_dtTimeout < DateTime.Now && false)
{
Complete = true;
IsError = true;
Expand All @@ -169,7 +171,7 @@ private async Task SourceAsync(string text, string transCode, string resultCode

//랜덤 딜레이를 준다
random = _rand.NextDouble();
_dtNextAvailableTime = DateTime.Now.AddMilliseconds(random * 900);
_dtNextAvailableTime = DateTime.Now.AddMilliseconds(random * 850);

_lastUrl = requestText;
_lastResult = result;
Expand Down
60 changes: 35 additions & 25 deletions MORT/UIAdvencedOption.Designer.cs

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

1 change: 1 addition & 0 deletions MORT/UIAdvencedOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ private void Init()
AddHotKey(LocalizeString("Adv HotKey BasicTrans"), LocalizeString("Adv HotKey BasicTrans Info"), KeyInputLabel.KeyType.GoogleTranslate, ctGoogleTrans);
AddHotKey(LocalizeString("Adv HotKey Google Sheet"), LocalizeString("Adv HotKey Google Sheet Info"), KeyInputLabel.KeyType.GoogleSheetTranslate, ctGoogleSheet);
AddHotKey(LocalizeString("Adv HotKey EzTrans"), LocalizeString("Adv HotKey EzTrans Info"), KeyInputLabel.KeyType.EzTrans, ctEzTrans);
AddHotKey(LocalizeString("Adv HotKey DeepL"), LocalizeString("Adv HotKey DeepL Info"), KeyInputLabel.KeyType.DeepL, ctDeepL);

LocalizeForm();
InitData();
Expand Down
6 changes: 3 additions & 3 deletions MORT/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@
<applicationSettings>
<MORT.Properties.Settings>
<setting name="MORT_VERSION" serializeAs="String">
<value>1.252V</value>
<value>1.253V</value>
</setting>
<setting name="LAYER_TEXT" serializeAs="String">
<value>MORT {0}
레이어 번역창</value>
</setting>
<setting name="MORT_VERSION_VALUE" serializeAs="String">
<value>1252</value>
<value>1253</value>
</setting>
<setting name="TOOLTIP_LIST" serializeAs="String">
<value>MORT를 처음 쓰시면 그 외-&gt; MORT 사용법을 확인해 주세요,
Expand Down Expand Up @@ -144,7 +144,7 @@ OCR 영역을 빠르게 추가하고 싶을 땐 빠른 OCR 영역을 사용하
<value>색 영역을 이용해 추출한 문장의 폰트색을 지정합니다.</value>
</setting>
<setting name="MORT_RELEASE" serializeAs="String">
<value>2023 05 02</value>
<value>2023 05 17</value>
</setting>
<setting name="TOOLTIP_MULTI_DB" serializeAs="String">
<value>DB 번역문 검색시 OCR 추출 문장에 포함 된 번역문을 모두 가져옵니다.</value>
Expand Down

0 comments on commit bbdf601

Please sign in to comment.