Skip to content

Commit

Permalink
it just works
Browse files Browse the repository at this point in the history
  • Loading branch information
UlyssesWu committed Jun 5, 2022
1 parent c3394b1 commit 67f41cf
Show file tree
Hide file tree
Showing 8 changed files with 528 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,4 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/
/VoiSona.CN.Translator/Properties/launchSettings.json
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
本项目将提供VoiSona的非官方简体中文汉化。

## 注意事项
* 建议您将软件目录下的reporter目录重命名,以取消崩溃信息上报
* 建议以管理员权限运行此工具
* 如果出现“权限不足”的错误提示,请以管理员权限运行本工具。
* 建议您将软件目录下的reporter目录重命名,以取消崩溃信息上报。
* 若软件更新,需要重新运行本工具。
* 本工具仅进行文本汉化。使用本工具产生的一切后果需自负。
* 如果您的账号因此被禁用,请保持淡定并通过邮件与我们联系。
Expand All @@ -13,17 +14,17 @@
如果您使用了本工具,您需要:保持原作者信息;保证不用于盈利;对文本和程序的修改需要开源。

## 安装方式
运行本工具需要系统安装**.NET 6**运行时。如果您无法运行此工具,请先在[这里下载](https://dotnet.microsoft.com/zh-cn/download/dotnet/6.0/runtime)安装《.NET 桌面运行时 (x64)》
运行本工具需要系统安装 **.NET 6** 运行时。如果您无法运行此工具,请先在[这里下载](https://dotnet.microsoft.com/zh-cn/download/dotnet/6.0/runtime)安装《.NET 桌面运行时 (x64)》

双击运行此工具,按Enter键。

* 如果提示找不到VoiSona,请自行找到VoiSona安装目录,将VoiSona.exe拖放到本工具的exe文件上。
* 如果提示权限不足,请以管理员权限运行此工具。
* 如果以上两种情况都有,请把VoiSona.exe和VoiSona Song.vst3复制到工具所在目录运行,将运行后生成产物自行复制到原来的文件夹。

安装完成后,会在VoiSona.exe所在的目录生成汉化版`VoiSona.CN.exe`(同时生成汉化版VST插件`VoiSona_CN-S.vst3`),
安装完成后,会在VoiSona.exe所在的目录生成汉化版`VoiSona.CN.exe`(同时生成汉化版VST插件`VoiSona_CN-S.vst3`),运行汉化版程序(或VST)则进入汉化版;运行原程序仍为原版。

运行汉化版程序(或VST)则进入汉化版;运行原程序仍为原版
如果打开后程序为英文,请通过菜单栏 Edit - Preference - Display Language 选择 `Chinese``Japanese`

软件更新后,需要重新运行本工具。如果汉化失效或者出现新的未翻译文本,请到发布地址下载新版本工具。

Expand Down
18 changes: 18 additions & 0 deletions VoiSona.CN.Translator/Helper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace VoiSona.CN.Translator
{
internal static class Helper
{
//https://stackoverflow.com/a/31107925
internal static unsafe long FindIndexOf(this byte[] haystack, byte[] needle, long startOffset = 0)
{
fixed (byte* h = haystack) fixed (byte* n = needle)
{
for (byte* hNext = h + startOffset, hEnd = h + haystack.LongLength + 1 - needle.LongLength, nEnd = n + needle.LongLength; hNext < hEnd; hNext++)
for (byte* hInc = hNext, nInc = n; *nInc == *hInc; hInc++)
if (++nInc == nEnd)
return hNext - h;
return -1;
}
}
}
}
Loading

0 comments on commit 67f41cf

Please sign in to comment.