Giter Club home page Giter Club logo

yuki's Introduction

YUKI
YUKI Galgame 翻译器

JavaScript Style Guide GPL 3.0 LICENSE Build status

中文English

它看起来的样子

紧急公告

2020.5.30 晚间,大量用户使用 YUKI 时遇到错误为ERR: TypeError: Cannot read property 'target' of undefined的报错窗口。经排查,该报错由彩云 API 目前严重的不稳定状态导致。现已紧急推送 v0.14.3,修复上述问题,但彩云 API 目前仍无法使用,因此请目前所有版本的 YUKI 用户关闭彩云 API(具体方法:打开 YUKI 根目录下的 config\config.json 文件,将 onlineApis 数组中 name = "彩云" 的对象的 enable 属性改为 false)。关闭后,即使不升级至 v0.14.3 也可解决报错问题。

下载

  1. 点击这里
  2. 点开最新版本介绍下面的 " > Assets ",第一个 ZIP 文件就是编译后的 YUKI :)

文档

挖坑的动力

我们已经有 Visual Novel Reader (VNR)了,为什么还要再开发一个 Galgame 翻译器?

嗯...有以下三个原因:

  1. VNR 用 Python(甚至是 Python 2)来渲染 UI,这导致了极端的卡顿,并且完全没有必要;
  2. sakuradite.com(VNR 官网)挂了,似乎现在并没有针对 VNR 的官方维护,只剩下贴吧零零散散的 BUG 修复与改进;
  3. VNR 的功能(也可以说脚本)太多了,想添加/修改一个功能要读很久的源码,十分费劲。

但是,如果要用 Qt5 重写的话,手动管理内存、配置、国际化什么的又显得太麻烦了。

因此,用 Electron 作为用户交互的前端,而用原始的 Windows API 作为后端(比如文本提取),不失为一种比较好的选择。

功能

  • 从正在运行的 Galgame 里即时提取文本
  • 从离线字典中获取翻译,如 J 北京等
  • 从在线翻译 API 中获取翻译,如谷歌、百度、有道等
  • 可编程外部翻译 API (参考 config\ 目录下的 JavaScript 文件)
  • 在游戏窗口上方浮动显示原文+翻译(就像 VNR 一样)
  • 自定义在线 API 翻译获取方式: URL、请求方法、请求报头格式、响应的解析方式等
  • 支持扩展

计划

尝个鲜?

安装好 Node.js 和 yarn 后,随便找个文件夹,运行以下代码:

git clone https://github.com/project-yuki/YUKI.git
cd YUKI
yarn
yarn dev

许可证

YUKI 使用 GPLv3 许可证开源。

我本来是想用 MIT 的,但是由于上游依赖(如文本提取器)用的是 GPL,所以我也很为难啊。

yuki's People

Contributors

arition avatar djytw avatar evi1 avatar hzeng1998 avatar luojunyuan avatar mokurin000 avatar rxia24 avatar tinyadapter 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yuki's Issues

游戏启用Mecab后抓取文字乱码

游戏

アオナツライン,V1.04,使用AlhpaROM Cracker破解

问题

在不启用Mecab时可以正常获取无乱码文本,启用Mecab后获取文本全部乱码。使用的是YUKI文档里提供的Mecab版本。是否使用Locale emulator转区均对文本抓取无影响。

截图

禁用Mecab

禁用Mecab

启用Mecab

启用Mecab

打开游戏翻译窗口啥都不显示

"onlineApis": [ { "enable": true, "external": true, "jsFile": "config\\baiduApi.js", "name": "百度" }, { "enable": true, "external": true, "jsFile": "config\\youdaoApi.js", "name": "有道" }
json设置过了。
安装完Node和Yarn后,

F:\Games\YUKI>yarn
yarn install v1.22.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Saved lockfile.
Done in 0.27s.

F:\Games\YUKI>yarn dev
yarn run v1.22.0
error Couldn't find a package.json file in "F:\Games\YUKI"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
是这个的问题吗?

[feature]建议添加自动化编译

搞了半天部署不上😂,而且感觉另外搞C++开发环境太麻烦了。我觉得这个项目很有前途,可以考虑添加自动化编译。这样也能及时跟上新功能

Translation texts missing if TaskNo more than 15

Often happened when it translates more than 15 or 16 or 17 times, then the translation texts will missed.
It only happened in version 0.7.

捕获

Seems caused by the 'delete' command didn't work well in src/translator/store/modules/Hooks.ts

   if (texts[texts.length - MAX_STORE_COUNT - 1]) {
      delete texts[handleString][texts.length - MAX_STORE_COUNT - 1]
      delete state.translations[handleString][texts.length - MAX_STORE_COUNT - 1]
    }	    }

部署遇到问题@a@

PS C:\Users\ljy77\3D Objects\Yagt> yarn
yarn install v1.15.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/5] ⠐ electron-vibrancy
[2/5] ⠐ ref
[3/5] ⠐ electron
[4/5] ⠈ electron-chromedriver
error C:\Users\ljy77\3D Objects\Yagt\node_modules\electron-vibrancy: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\Users\ljy77\3D Objects\Yagt\node_modules\electron-vibrancy
Output:
C:\Users\ljy77\3D Objects\Yagt\node_modules\electron-vibrancy>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\ljy77\AppData\Local\Programs\Python\Python37\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ljy77\3D Objects\Yagt\node_modules\electron-vibrancy


说是这句 import sys; print "%s.%s.%s" % sys.version_info[:3]; 语法错误

关于翻译文本的背景问题

翻译文本的背景的高斯模糊,影响低分辨率屏幕上面的体验。窗口不知道放在哪里好,如果关掉高斯模糊,还能放在顶部。

Textrator ERROR when Adding H-code

With original Textrator in /lib folder, Will pop up this error.

image

After replacing files from X86 version Textractor, problem solved.

I guess it might cause by x64 version Textractor not supporting Waffle's game.

关于钩子转区钩不上的问题

如果区域转换器设置为localeEmulator,点击运行打开游戏后,文本钩子上显示Textractor:couldn'tinject。
如果区域转换器设置为noChanger,即直接打开,点击运行打开游戏后,能正常获取文本。

举例:对于某个可转区打开也可直接打开的游戏,localeEmulator打开文本钩子上显示Textractor:couldn'tinject,noChanger打开可正常获取文本并正常翻译。

其他建议:能否增加直接将翻译窗口依附在已打开程序上的功能,即相当于自己(转区)打开游戏,再用YUKI寻找某已打开exe进程并将窗口依附在上面。

Translation missing and Mecab issue.

Similar case with #16 , translation missing if payload.id more than 23

Console log

Hooks.ts?5543:129 Uncaught TypeError: Cannot read property '23' of undefined
    at Store.MERGE_TRANSLATION (Hooks.ts?5543:129)
    at wrappedMutationHandler (F:\YUKI-master\node_…\vuex.common.js:727)
    at commitIterator (F:\YUKI-master\node_…\vuex.common.js:393)
    at Array.forEach (<anonymous>)
    at F:\YUKI-master\node_…\vuex.common.js:392
    at Store._withCommit (F:\YUKI-master\node_…\vuex.common.js:523)
    at Store.commit (F:\YUKI-master\node_…\vuex.common.js:391)
    at Store.boundCommit [as commit] (F:\YUKI-master\node_…\vuex.common.js:336)
    at local.commit (F:\YUKI-master\node_…\vuex.common.js:681)
    at Store.mergeTranslation (Hooks.ts?5543:205)

Source

  MERGE_TRANSLATION (
    state: yuki.TranslatorHookState,
    payload: yuki.TranslationMessage
  ) {
    if (!state.translations[payload.id.toString()]) {
      state.translations[payload.id.toString()] = []
    }
    state.translations[state.currentDisplayHookIndex] = {  //<--- Line 129
      ...state.translations[state.currentDisplayHookIndex],
      [payload.id.toString()]: {
        ...state.translations[state.currentDisplayHookIndex][payload.id.toString()],
        ...payload.translation
      }
    }
  }

I'm very new with Js/Ts can't found the reason.

Another side issue, I have installed Mecab,
but it can't work with release version, the wired thing is that Mecab is functional under "npm run dev".

获取文本会出现重复现象

如题,在文本钩子设置的时候,获取到的文本都是会出现一个字多次重复的现象,大佬能不能做一个和VNR一样的去重的功能呢?
还有个小建议就是能不能做一个VNR那种可以让翻译背景变成透明的功能,这样不会遮挡游戏画面

老哥你的YUKI近期反馈评价较多是由我引起的,在此我说明一下。

抱歉哈,我只是一个大学生路人,偶然玩一个车万同人(终于遇到同党了!)galgame,由pre-blossom 同人社团出品的"Scarlet [Alchemy",跟随一篇论坛帖子找到的这个软件,试用了一下感觉还不错就在百度贴吧,galgame吧发帖宣传了一下,我没有在发帖前提前通知作者你,在此道歉,突然给你带来的许多反馈惊扰还请见谅。如果可以的话,能否进入百度贴吧>galgame吧>搜索帖子>推荐一个国人自研翻译软件,里面有许多用户反馈的问题,他们大多不会用github反馈,都写在帖子里了,请作者大大看一下利于改进软件。我也没想到一发帖这么多回复,给你带来的压力再次道歉,谢谢作者大大!加油!底下附上帖子地址。
https://tieba.baidu.com/p/6331257658?pid=128241287695&cid=0&red_tag=0090673195#128241287695

换行后文本会缺失

如果提取出来的文本有换行的话,换行之后的文本会缺失。
发现于waffle的游戏。
ss

Multiline text will duplicated

As I found, the texts will emit 3 times because there a three lines, see this "「" has repeated 3 times.

Other than tianyu's idea, I have come up with a easier one, adding a header like “!!TEXT!!” before texts emitted. So that we can track the duplicate times, then simply split the texts to get the correct texts.

I try to solve it in my machine but I can't hook the text using Hcode with node-textractor😓.


It support multiline game indeed, but other bug appeared.
Text will duplicate several times if there are multiline texts.
SS

Originally posted by @rxia24 in #11 (comment)

一脸懵逼地过来问问这是啥情况啊

图片
翻译的时候每一个字符都连续翻译了好多次,而且不止这一个游戏如此,多个游戏都出现了这样的状况…迷茫,是有什么需要配置的地方还是这种字体的识别率问题还是bug啊?

关于软件的一些小问题,还请作者来解答下,感谢了

1.按照D:\LE\LEProc.exe" -run %GAME_PATH%运行,会提示游戏运行失败,参考调试信息
2.怎样才能全透明啊,现在的全透明自带毛玻璃效果
3.游戏玩着玩着会弹出a javascript error occurred in the main process,这个怎么解决啊.
希望作者能帮我解决下这些问题,感谢了

[question]关于游戏多线程的问题

我在玩消えた世界と月と少女时游戏会启动四个进程

PS C:\Users\ljy77> tasklist /nh /fo csv /fi "imagename eq KIETASEKAI.EXE"
"KIETASEKAI.EXE","12228","Console","9","121,140 K"
"KIETASEKAI.EXE","11624","Console","9","49,628 K"
"KIETASEKAI.EXE","13936","Console","9","102,744 K"
"KIETASEKAI.EXE","2900","Console","9","32,120 K"

然后发现每次都是第三个才是应该hook的那个,在parsePidFrom函数下临时补救了一下

if (value.replace(/"/g, '').split(',')[0] === 'KIETASEKAI.EXE') {
  return parseInt(value.replace(/"/g, '').split(',')[11], 10)
}

有啥更好的通用的处理方法嘛

[问题]翻译器呼出

游戏中不小心把翻译器点X关掉了,如何再次唤出?
关闭游戏重开比较麻烦。
如有[Feature]快捷键,请添加到帮助中。
或者[Feature]添加开启翻译器的后台开关选项

J 北京辞書在线下载问题

连续点击多次下载按钮后,会出现多个下载提示,下载进度不停变,建议点击下载后禁用下载按钮

win10打不开游戏

您好,我下载的最新版本,设置好le,添加好游戏之后,点击开始之后软件跳到最小化过几秒之后又原样跳出来,并启动不了游戏,试验了2款游戏都打不开,求问是什么原因,谢谢

开启自动隐藏标题栏功能后出现窗口抖动问题

RT,开启后在翻译栏隐藏标题功能实现后,把鼠标指针放在原标题栏位置会导致整个窗口不断抖动,需要鼠标左键长按标题栏才会停止跳动。
同时建议添加VNR也有的重复文本过滤功能,部分游戏虽然不用特殊码也能提前文本,但提取的文本会出出现现重重复复的情况。

关于词典解释条目高度过低的问题

问题:点击翻译窗口的原文出现的词典解释条目的高度限制在翻译窗口内,若翻译窗口高度过低,则条目的高度会被限制,只能通过滚轮一行一行看
01

顺便建议:VNR中Mecab可以选择将原文的罗马音全部显示在原文上,能否实现此功能

能否增加去除叠字的功能

如题,在一些游戏中,提取出的文本会出现叠字,例如「おお客客ささんん」这样,非常影响分词和翻译的效果。求问可否增加去除叠字的功能?

希望增加提取文本时去除特定字符串的功能

如题,在玩母烂漫的时候发现文本里会有多余的东西出现,感觉可以用到这种功能
image
最好能支持正则表达式之类的功能(x
(ps:有一个设想,提供一个选项"F:\a.exe" %TEXT%
类似于区域转换设置里的"F:\Locale Emulator\LEProc.exe" %GAME_PATH%
让文本通过一个用户的可执行文件再将输出的文本拿去下一层,这样就可以让用户自己随便折腾文本了

(顺便问问母烂漫现在这游戏有什么可行的提取办法吗,用了特殊码似乎也会有多余的东西出现

vnr的人工字幕是怎么实现的?

好弄吗,给yuki添加这项功能怎么样呀?
很想把vnr的(樱之诗)人工字幕们都给导入进来。

ps.建议文本去重的逻辑最好针对每一张游戏card,理想的样子是优先原生提取到的文本。选择性的对游戏开启文本去重(╹◡╹)

只能翻译弹窗文字

老哥求解,我玩的游戏是“ToHeart2 XRATED”,能够正常打开,跨区等都没问题,但是进入后的文字钩子选项列表中只有游戏窗口名称和游戏弹窗等日文能正常翻译,但是就是找不到游戏内对话的日文。希望老哥有空的时候能帮忙解答下,感谢了。

Binary packages build problems under Node.js 12

On 2019-10-21, a new LTS version of Node.js, v12.13.0, has released.

https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V12.md#12.13.0

However, at present, there are some binary packages (such as node-ffi) that cannot be built correctly due to destructive API changes.

For the reason above, I highly recommend developers still using the previous version of Node.js, say, version 10.

You can download it through Node.js official site:

https://nodejs.org/dist/v10.17.0/

Remember that YUKI always depends on the 32-bit version of Node.js to run properly, so for simplicity, here is the direct link:

https://nodejs.org/dist/v10.17.0/node-v10.17.0-x86.msi

This issue remains open until the packages have been repaired to adapt themselves to Node.js 12.

正常词语被去叠字过滤

新年快乐,身体健康!

已确定config\text.json 中 modifier.deduplicate为 false,正常词语也被识别成叠字了。

如图所示:
image

询问

请问一下怎么修改翻译后的文字单行长度,有些文本长一些就自动换行了。当翻译框覆盖在游戏文字框上面时文本一长位于下面的翻译结果就会被挤出屏幕外面。

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.