Code Monkey home page Code Monkey logo

xlsxtranslation's Introduction

XlsxTranslation

该软件是由 Xlsx2Lua 的实时翻译功能拆分而来的。

软件中提供了翻译转表功能,建议将软件放在同 Xlsx2Lua 软件的目录下。

软件会根据传入的参数 -- 来决定是否读取配置,如果配置不存在时会自动创建。

Release 最新版本

查看最新的Release版本

Release

.Net 版本

>= v.7.0.201

支持库引用

支持库名 版本 项目地址
EPPLus 6.2.1 https://epplussoftware.com/
.Net 7.0.201 https://dotnet.microsoft.com/en-us/download/dotnet/7.0

TranslateHelper 使用教程

读取配置XlsxTranslation.cfg

:: 读取配置XlsxTranslation.cfg
".\XlsxTranslation.exe" --
pause

根据传参进行配置

::程序名
::设置 Excel 目录                                         ..\Config
::设置 百度翻译API APPID                                  20230205001551232
::设置 百度翻译API SecretKey                              dkpFIs1HsuAIRBWPQ7ky
::设置 要读取的文件名                                      TranslateMain.xlsx
::设置 单条线程翻译的数量,默认500个                         500
::设置 单条线程启动的间隔,默认500毫秒                       100
::设置 线程执行一次准备翻译的间隔,默认500毫秒                500
::设置 线程执行一次翻译目标的间隔,默认2000毫秒               1000
::设置 显示耗时时间                                        true
::设置 显示日志的等级                                       0:All, 1:Warning+Error, 2:Error
::设置 是否输出日志文件                                     true
::设置 进度提示                                            true

REM 开始导表
".\XlsxTranslation.exe" ..\Config 20230205001551232 dkpFIs1HsuAIRBWPQ7ky TranslateMain.xlsx 500 100 500 1000 true 0 true true

pause

具体程序参数说明:

编号 类型 默认值 是否必填 释义
1 string 设置 Excel文件 目录
2 string 20230205001551232 百度翻译API APPID
3 string dkpFIs1HsuAIRBWPQ7ky 百度翻译API SecretKey
4 string TranslateMain.xlsx 要读取/保存的文件名
5 int 500 分割翻译键的数量
6 int 100 启动线程的间隔(毫秒)
7 int 1000 线程执行一次Key的间隔(毫秒)
8 int 2000 线程执行一次Val的间隔(毫秒)
9 int 2000 显示耗时时间
10 int 0 日志显示等级
11 bool false 是否输出日志文件
12 bool true 是否开启翻译进度提示

程序配置文件说明

{
  "ConfigPath": "..\\Config",//配置表路径。
  "MultilingualName": "TranslateMain.xlsx",//读取和输出文件名。
  "SplitKeyCount": 500,//单条线程翻译的数量,默认500个
  "ThreadInterval": 100,//单条线程启动的间隔,默认500毫秒
  "ThreadKeyInterval": 500,//线程执行一次准备翻译的间隔,默认500毫秒
  "ThreadValInterval": 1000,//线程执行一次翻译目标的间隔,默认2000毫秒
  "ShowLogLevel": 0,// 开启显示日志的等级。0:显示所有日志,1:只显示警告和报错,2:只显示报错。
  "OutputLogFile": true,// 是否输出日志文件?在导表结束后会在程序执行目录生成log文件,文件名:程序名+当前时间,示例:XlsxTranslation-20231219151955.log
  "TipProgress": true,//是否开启翻译进度提示
  "ShowTimelapse":true,//显示时间流逝
  "LanguageData": {
    "AppId": "20230205001551232",//百度翻译API APPID
    "SecretKey": "dkpFIs1HsuAIRBWPQ7ky",//百度翻译API SecretKey
    "Translations": [
      "en"
    ],// 翻译文件的语种
    "TranslationNames": [
      "英语"
    ]// 翻译文件的语种中文释义
  }
}

翻译API

本软件采用的百度翻译官网翻译API

http://api.fanyi.baidu.com/api/trans/vip/translate?q=content&from=zh&to=en&appid=APPID&salt=salt&sign=sign

Excel表结构

结构说明
  1. 读取第一个工作簿(sheet)中的第一列作为翻译源,后几列作为目标源
  2. 翻译表的文件名以Translate开头,默认的翻译表名TranslateMain

示例文件:

TestExample\总表模式\Config\TranslateMain.xlsx 打开

TestExample\分表模式\Config\TranslateMain.xlsx 打开

TestExample\翻译演示\Config\TranslateMain.xlsx 打开

多语言Key 中文 英语 繁体中文
key zh en cht
Items_name_1 金币
Items_desc_1 通用货币1
Items_name_2 钻石
Items_desc_2 通用货币2

xlsxtranslation's People

Contributors

clxiao-1029 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.