Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from zyddnys:main #5

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ Colorizer: **mc2**
image folder if using batch mode
-o, --dest DEST Path to the destination folder for translated images in
batch mode
-l, --target-lang {CHS,CHT,CSY,NLD,ENG,FRA,DEU,HUN,ITA,JPN,KOR,PLK,PTB,ROM,RUS,ESP,TRK,UKR,VIN,ARA,CNR,SRP,HRV,THA,IND}
-l, --target-lang {CHS,CHT,CSY,NLD,ENG,FRA,DEU,HUN,ITA,JPN,KOR,PLK,PTB,ROM,RUS,ESP,TRK,UKR,VIN,ARA,CNR,SRP,HRV,THA,IND,FIL}
Destination language
-v, --verbose Print debug info and save intermediate images in result
folder
Expand Down Expand Up @@ -514,6 +514,7 @@ SRP: Serbian
HRV: Croatian
THA: Thai
IND: Indonesian
FIL: Filipino (Tagalog)
```

### Translators Reference
Expand Down
3 changes: 2 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ SRP: Serbian
HRV: Croatian
THA: Thai
IND: Indonesian
FIL: Filipino (Tagalog)
```

<!-- Auto generated start (See devscripts/make_readme.py) -->
Expand All @@ -117,7 +118,7 @@ IND: Indonesian
image folder if using batch mode
-o, --dest DEST Path to the destination folder for translated images in
batch mode
-l, --target-lang {CHS,CHT,CSY,NLD,ENG,FRA,DEU,HUN,ITA,JPN,KOR,PLK,PTB,ROM,RUS,ESP,TRK,UKR,VIN,ARA,CNR,SRP,HRV,THA,IND}
-l, --target-lang {CHS,CHT,CSY,NLD,ENG,FRA,DEU,HUN,ITA,JPN,KOR,PLK,PTB,ROM,RUS,ESP,TRK,UKR,VIN,ARA,CNR,SRP,HRV,THA,IND,FIL}
Destination language
-v, --verbose Print debug info and save intermediate images in result
folder
Expand Down
4 changes: 2 additions & 2 deletions manga_translator/translators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .selective import SelectiveOfflineTranslator, prepare as prepare_selective_translator
from .none import NoneTranslator
from .original import OriginalTranslator
from .sakura import Sakura13BTranslator
from .sakura import SakuraTranslator

OFFLINE_TRANSLATORS = {
'offline': SelectiveOfflineTranslator,
Expand All @@ -41,7 +41,7 @@
'gpt4': GPT4Translator,
'none': NoneTranslator,
'original': OriginalTranslator,
'sakura': Sakura13BTranslator,
'sakura': SakuraTranslator,
**OFFLINE_TRANSLATORS,
}
translator_cache = {}
Expand Down
6 changes: 4 additions & 2 deletions manga_translator/translators/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
'SRP': 'Serbian',
'HRV': 'Croatian',
'THA': 'Thai',
'IND': 'Indonesian'
'IND': 'Indonesian',
'FIL': 'Filipino (Tagalog)'
}

ISO_639_1_TO_VALID_LANGUAGES = {
Expand Down Expand Up @@ -64,7 +65,8 @@
'sr': 'SRP',
'hr': 'HRV',
'th': 'THA',
'id': 'IND'
'id': 'IND',
'tl': 'FIL'
}

class InvalidServerResponse(Exception):
Expand Down
5 changes: 3 additions & 2 deletions manga_translator/translators/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,15 @@ class GoogleTranslator(CommonTranslator):
'ESP': 'es',
'TRK': 'tr',
'UKR': 'uk',
'VIN': 'vi',
'ARA': 'ar',
'SRP': 'sr',
'HRV': 'hr',
'THA': 'th',
'IND': 'id'
'IND': 'id',
'FIL': 'tl'
}


def __init__(self, service_urls=DEFAULT_CLIENT_SERVICE_URLS, user_agent=DEFAULT_USER_AGENT,
raise_exception=DEFAULT_RAISE_EXCEPTION,
proxies: typing.Dict[str, httpcore.AsyncHTTPTransport] = None,
Expand Down
9 changes: 5 additions & 4 deletions manga_translator/translators/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
OPENAI_HTTP_PROXY = os.getenv('OPENAI_HTTP_PROXY') # TODO: Replace with --proxy

OPENAI_API_BASE = os.getenv('OPENAI_API_BASE', 'https://api.openai.com/v1') #使用api-for-open-llm例子 http://127.0.0.1:8000/v1
SAKURA_API_BASE = os.getenv('SAKURA_API_BASE', 'http://127.0.0.1:8080/v1') #SAKURA API地址

# sakura
SAKURA_API_BASE = os.getenv('SAKURA_API_BASE', 'http://127.0.0.1:8080/v1') #SAKURA API地址
SAKURA_VERSION = os.getenv('SAKURA_VERSION', '0.9') #SAKURA API版本,可选值:0.9、0.10,选择0.10则会加载术语表。
SAKURA_DICT_PATH = os.getenv('SAKURA_DICT_PATH', './sakura_dict.txt') #SAKURA 术语表路径

CAIYUN_TOKEN = os.getenv('CAIYUN_TOKEN', '') # 彩云小译API访问令牌

SAKURA_API_KEY = os.getenv('SAKURA_API_KEY', '')
SAKURA_API_BASE = os.getenv('SAKURA_API_BASE', 'http://127.0.0.1:5000/v1')
CAIYUN_TOKEN = os.getenv('CAIYUN_TOKEN', '') # 彩云小译API访问令牌
Loading
Loading