Coder Social home page Coder Social logo

real-time-translation-typing's Introduction

████████╗██╗   ██╗██████╗ ██╗███╗   ██╗ ██████╗     ████████╗██████╗  █████╗ ███╗   ██╗███████╗██╗      █████╗ ████████╗██╗ ██████╗ ███╗   ██╗
╚══██╔══╝╚██╗ ██╔╝██╔══██╗██║████╗  ██║██╔════╝     ╚══██╔══╝██╔══██╗██╔══██╗████╗  ██║██╔════╝██║     ██╔══██╗╚══██╔══╝██║██╔═══██╗████╗  ██║
   ██║    ╚████╔╝ ██████╔╝██║██╔██╗ ██║██║  ███╗       ██║   ██████╔╝███████║██╔██╗ ██║███████╗██║     ███████║   ██║   ██║██║   ██║██╔██╗ ██║
   ██║     ╚██╔╝  ██╔═══╝ ██║██║╚██╗██║██║   ██║       ██║   ██╔══██╗██╔══██║██║╚██╗██║╚════██║██║     ██╔══██║   ██║   ██║██║   ██║██║╚██╗██║
   ██║      ██║   ██║     ██║██║ ╚████║╚██████╔╝       ██║   ██║  ██║██║  ██║██║ ╚████║███████║███████╗██║  ██║   ██║   ██║╚██████╔╝██║ ╚████║
   ╚═╝      ╚═╝   ╚═╝     ╚═╝╚═╝  ╚═══╝ ╚═════╝        ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝╚══════╝╚══════╝╚═╝  ╚═╝   ╚═╝   ╚═╝ ╚═════╝ ╚═╝  ╚═══╝

Real-time-translation-typing

图 1

图 0

功能

  • 实时打字翻译
  • 实时语音转文字并翻译
  • LOL 语音转文字输入

快捷键

  • ALT Y: 打开
  • ALT ENTER:发音
  • ENTER: 输出翻译文本
  • CTRL ENTER: 输出原始文本
  • ESC: 退出
  • TAB: 切换另一个翻译API
  • CTRL F7: 网页版调试

网页版额外快捷键

  • CTRL + C :复制结果
  • CTRL + ALT + Y :翻译当前粘贴板
  • CTRL + V:打开状态下,输入粘贴板内容
  • ALT + I:语音输入
  • xbutton1: LOL语音输入触发
  • xbutton2: LOL语音输入结束

网页调用版本(推荐)

目前支持 搜狗、百度、有道

环境 版本
系统 需要win10或者安装 webview2 runtime
源码运行需要 ahk 版本 autohotkey v2H

API版本(不推荐)

通过配置文件来配置 /config/setting.json

  • 选择主翻译API
    "cd" : "youdao"   ## 目前支持 "baidu", "google"(需要科学上网,且美国节点), "youdao", "sougou"

备选API需配置 is_open 为 1 如果没反应,可能api在维护,可以切换另一个使用 目前免费的是有道和搜狗和谷歌, 有道是直接调用的api速度比较快,搜狗是爬虫(速度较慢),谷歌需要翻墙 百度结果很不错,但是需要注册(免费100w字符/月)

  • 有道词典
http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule&smartresult=ugc&sessionFrom=null
{
    "is_open" : 1
}
https://fanyi.sogou.com/text?keyword=%E4%BD%A0%E5%A5%BD&transfrom=auto&transto=en&model=general
    "sougou" :
    {
        "is_open" : 1,
        "is_real_time_translate" : 1
    },
  • 谷歌
{
    "is_open" : 0,
    "is_real_time_translate" : 0
}
{
    "is_open" : 0,
    "BaiduFanyiAPPID" : "xxxxx",
    "BaiduFanyiAPPSEC": "xxxxx",
    "is_real_time_translate" : 0
}

因为百度使用次数有限额,因此通过 is_baidu_real_time_translate 来配置是否实时触发翻译 当配置 0 时,需要输入 空格 键 主动翻译, 建议输入最后键入空格

  • 切换

tab键,从配置和打开的API切换

real-time-translation-typing's People

Contributors

sxzxs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

real-time-translation-typing's Issues

无法输出文字

中英互译正常,但是按enter和ctrl+enter,都没有文字输出,功能闪退,软件在后台;
是win10系统,带edge的;

无法输出

系统:win11 输入法:系统自带
Sogou、baidu输入文字可以翻译,可以使用网页版的复制,无法使用enter 输出 ,CTRL enter也无反应

无法切换翻译器

默认的是sogou翻译器,无法用tab切换翻译器,即使修改配置文件也无法生效。

在某些应用的输入框中报错【Messenger】

image

Error: Expected an Integer but got a Float.

Specifically: 591.0

▶ 5509: Return DllCall("User32.dll\MonitorFromPoint", "Int64", (X & 0xFFFFFFFF) | (Y << 32), "UInt", Flag, "Ptr")

Call stack:
#1?00000001401DC3F0#238528.AHK (5509) : [MDMF_FromPoint] Return DllCall("User32.dll\MonitorFromPoint", "Int64", (X & 0xFFFFFFFF) | (Y << 32), "UInt", Flag, "Ptr")
#1?00000001401DC3F0#238528.AHK (5160) : [BeautifulToolTip.Prototype._CalculateDisplayPosition] DisplayX := (X="") ? MouseX : X , DisplayY := (Y="") ? MouseY : Y , hMonitor := MDMF_FromPoint(&DisplayX, &DisplayY, MONITOR_DEFAULTTONEAREST:=2) , TargetLeft := this.Monitors[hMonitor].Left , TargetTop := this.Monitors[hMonitor].Top , TargetRight := this.Monitors[hMonitor].Right , TargetBottom := this.Monitors[hMonitor].Bottom , TargetWidth := TargetRight-TargetLeft , TargetHeight := TargetBottom-TargetTop , Options.DPIScale := this.Monitors[hMonitor].DPIScale
#1?00000001401DC3F0#238528.AHK (4867) : [BeautifulToolTip.Prototype.ToolTip] TargetSize:=this._CalculateDisplayPosition(&X, &Y, "", "", O, GetTargetSize:=1) , MaxTextWidth:=TargetSize.W - O.Margin2 - O.Border
2 , MaxTextHeight:=(TargetSize.H
90)//100 - O.Margin2 - O.Border2 , O.Width:=MaxTextWidth, O.Height:=MaxTextHeight , TextArea:=StrSplit(this._TextToGraphics(this["G" WhichToolTip], Text, O, Measure:=1), "|") , TextWidth:=Min(Ceil(TextArea[3]), MaxTextWidth) , TextHeight:=Min(Ceil(TextArea[4]), MaxTextHeight) , RectWidth:=TextWidth+O.Margin2 , RectHeight:=TextHeight+O.Margin2 , RectWithBorderWidth:=RectWidth+O.Border2 , RectWithBorderHeight:=RectHeight+O.Border2 , R:=(O.Rounded>Min(RectWidth, RectHeight)//2) ? Min(RectWidth, RectHeight)//2 : O.Rounded
*#1?00000001401DC3F0#238528.AHK (4770) : [btt] Return BTT.ToolTip(Text, X, Y, WhichToolTip,BulitInStyleOrStyles,BulitInOptionOrOptions)
*#1?00000001401DC3F0#238528.AHK (6075) : [fanyi] btt('[' g_current_api ']',g_cursor_x, g_cursor_y - 45,,OwnzztooltipStyle1,{Transparent:180,DistanceBetweenMouseXAndToolTip:-100,DistanceBetweenMouseYAndToolTip:-20})
*#1?00000001401DC3F0#238528.AHK (5925) : [] Return fanyi()

!y

百度自动翻译无效

已经按照说明,在配置文件,设置百度翻译自动翻译为 1 ,但是每次输入完还要打空格才能翻译,

添加长效开关

首先感谢能够开源这么棒的软件👍
First of all thank you can source this great software.

能不能增加一个长效开关,不用每输一句话就按一次Alt+Y激活?
Can increase a long-acting switch, need not every input sentence and then press Alt Y activation?

PS: 上面的英语是这个软件翻译的,能够看到翻译的不是那么多的准确,能否提供更改翻译源的功能?

请求添加小牛翻译!!

小牛翻译每天!!赠送20万字符和100页文档页数,而且翻译的非常准确,希望可以加入小牛翻译 ❥(^_-)

deepl无法使用。

感谢大佬的软件,非常好用,不知道是我的问题不,现在无法使用deepl进行翻译。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.