镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 06:26:47 +00:00
添加把项目翻译为任意语言的功能(测试)
这个提交包含在:
@@ -1,6 +1,6 @@
|
|||||||
"""
|
"""
|
||||||
Translate this project to Other languages
|
Translate this project to other languages
|
||||||
Usage:
|
Usage:o
|
||||||
1. modify LANG
|
1. modify LANG
|
||||||
LANG = "English"
|
LANG = "English"
|
||||||
|
|
||||||
@@ -24,14 +24,14 @@ import time
|
|||||||
CACHE_FOLDER = "gpt_log"
|
CACHE_FOLDER = "gpt_log"
|
||||||
blacklist = ['multi-language', 'gpt_log', '.git', 'private_upload', 'multi_language.py']
|
blacklist = ['multi-language', 'gpt_log', '.git', 'private_upload', 'multi_language.py']
|
||||||
|
|
||||||
LANG = "TraditionalChinese"
|
# LANG = "TraditionalChinese"
|
||||||
TransPrompt = f"Replace each json value `#` with translated results in Traditional Chinese, e.g., \"原始文本\":\"翻譯後文字\". Keep Json format. Do not answer #."
|
# TransPrompt = f"Replace each json value `#` with translated results in Traditional Chinese, e.g., \"原始文本\":\"翻譯後文字\". Keep Json format. Do not answer #."
|
||||||
|
|
||||||
# LANG = "Japanese"
|
# LANG = "Japanese"
|
||||||
# TransPrompt = f"Replace each json value `#` with translated results in Japanese, e.g., \"原始文本\":\"テキストの翻訳\". Keep Json format. Do not answer #."
|
# TransPrompt = f"Replace each json value `#` with translated results in Japanese, e.g., \"原始文本\":\"テキストの翻訳\". Keep Json format. Do not answer #."
|
||||||
|
|
||||||
# LANG = "English"
|
LANG = "English"
|
||||||
# TransPrompt = f"Replace each json value `#` with translated results in English, e.g., \"原始文本\":\"TranslatedText\". Keep Json format. Do not answer #."
|
TransPrompt = f"Replace each json value `#` with translated results in English, e.g., \"原始文本\":\"TranslatedText\". Keep Json format. Do not answer #."
|
||||||
|
|
||||||
|
|
||||||
if not os.path.exists(CACHE_FOLDER):
|
if not os.path.exists(CACHE_FOLDER):
|
||||||
@@ -496,4 +496,4 @@ def step_2_core_key_translate():
|
|||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
|
|
||||||
step_1_core_key_translate()
|
step_1_core_key_translate()
|
||||||
step_2_core_key_translate()
|
step_2_core_key_translate()
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户