mirror of
https://github.com/illian64/llm-translate.git
synced 2026-04-29 20:29:53 +00:00
Files processing - books
* book translate * files processing * files processing * files processing * files processing --------- Co-authored-by: APodoinikov <APodoynikov@detmir.ru>
This commit is contained in:
parent
e9e0e647f7
commit
0a70da3b98
39 changed files with 1737 additions and 493 deletions
|
|
@ -1,15 +1,17 @@
|
|||
# No Translate dummy plugin
|
||||
# No Translate dummy plugin, for test / debug
|
||||
# author: Vladislav Janvarev
|
||||
|
||||
import os
|
||||
|
||||
from tqdm import tqdm
|
||||
|
||||
from app import params
|
||||
from app.app_core import AppCore
|
||||
from app.struct import TranslateStruct
|
||||
from app.dto import TranslatePluginInitInfo, TranslateStruct
|
||||
|
||||
modname = os.path.basename(__file__)[:-3] # calculating modname
|
||||
plugin_name = os.path.basename(__file__)[:-3] # calculating modname
|
||||
|
||||
|
||||
# start function
|
||||
def start(core: AppCore):
|
||||
manifest = { # plugin settings
|
||||
"name": "No Translate dummy plugin", # name
|
||||
|
|
@ -23,12 +25,12 @@ def start(core: AppCore):
|
|||
return manifest
|
||||
|
||||
|
||||
def init(core: AppCore):
|
||||
return modname
|
||||
def init(core: AppCore) -> TranslatePluginInitInfo:
|
||||
return TranslatePluginInitInfo(plugin_name=plugin_name, model_name="")
|
||||
|
||||
|
||||
def translate(core: AppCore, ts: TranslateStruct):
|
||||
for part in ts.parts:
|
||||
for part in tqdm(ts.parts, unit=params.tp.unit, ascii=params.tp.ascii, desc=params.tp.desc):
|
||||
part.translate = part.text
|
||||
|
||||
return ts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue