Skip to content

Commit

Permalink
Merge branch 'dev' into about-view-confetti
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng authored May 5, 2024
2 parents 3548a8c + 5800e14 commit a2021c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ - (void)postUpdateServiceNotification {
}

- (void)startOCRImage:(NSImage *)image actionType:(EZActionType)actionType {
MMLogInfo(@"start OCR Image");
MMLogInfo(@"start OCR Image: %@, actionType: %@", @(image.size), actionType);

self.queryModel.OCRImage = image;
self.queryModel.actionType = actionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ - (void)showFloatingWindowType:(EZWindowType)windowType
self.selectedText = queryText;
self.actionType = actionType;

MMLogInfo(@"show floating windowType: %ld, queryText: %@, autoQuery: %d, actionType: %@, atPoint: %@", windowType, queryText, autoQuery, actionType, @(point));

// Update isTextEditable value when using invoke query, such as open URL Scheme by PopClip.
if (actionType == EZActionTypeInvokeQuery) {
[self.eventMonitor updateSelectedTextEditableState];
Expand Down Expand Up @@ -762,8 +764,9 @@ - (void)snipTranslate {

// Reset window height first, avoid being affected by previous window height.
[window.queryViewController resetTableView:^{
self.actionType = EZActionTypeOCRQuery;
[self showFloatingWindowType:windowType queryText:nil];
[window.queryViewController startOCRImage:image actionType:EZActionTypeOCRQuery];
[window.queryViewController startOCRImage:image actionType:self.actionType];
}];
}];
});
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ Easydict 可以根据查询文本的内容,自动启用相应的查询服务
具体来说,在智能查询模式下,当查询单词时,则只会调用支持【单词查询】的服务;当翻译文本时,则只会调用支持【文本翻译】的服务。
对于单词,支持查询单词的服务效果明显比翻译更好,而翻译文本时,启用单词查询服务
对于单词查询,支持查询单词服务的效果明显比简单翻译更好,例如苹果词典和有道词典;而进行长文本翻译时,启用单词查询服务没有意义,例如使用苹果词典来翻译。
默认情况下,所有的翻译服务都支持单词查询(单词也属于文本的一种),用户可以手动调整,如设置 Google 智能模式只翻译文本,只需要使用下面命令修改为 `translation | sentence` 即可。
Expand Down

0 comments on commit a2021c7

Please sign in to comment.