diff --git a/docs/translate_english.json b/docs/translate_english.json index 57e008b..33faebc 100644 --- a/docs/translate_english.json +++ b/docs/translate_english.json @@ -1667,5 +1667,294 @@ "段音频的主要内容": "The main content of the segment audio is", "z$ 分别是空间直角坐标系中的三个坐标": "z$, respectively, are the three coordinates in the spatial rectangular coordinate system", "这个是怎么识别的呢我也不清楚": "I'm not sure how this is recognized", - "从现在起": "From now on" + "从现在起": "From now on", + "连接bing搜索回答问题": "ConnectBingSearchAnswerQuestion", + "联网的ChatGPT_bing版": "OnlineChatGPT_BingEdition", + "Markdown翻译指定语言": "TranslateMarkdownToSpecifiedLanguage", + "Langchain知识库": "LangchainKnowledgeBase", + "Latex英文纠错加PDF对比": "CorrectEnglishInLatexWithPDFComparison", + "Latex输出PDF结果": "OutputPDFFromLatex", + "Latex翻译中文并重新编译PDF": "TranslateChineseToEnglishInLatexAndRecompilePDF", + "sprint亮靛": "SprintIndigo", + "寻找Latex主文件": "FindLatexMainFile", + "专业词汇声明": "ProfessionalTerminologyDeclaration", + "Latex精细分解与转化": "DecomposeAndConvertLatex", + "编译Latex": "CompileLatex", + "如果您是论文原作者": "If you are the original author of the paper", + "正在编译对比PDF": "Compiling the comparison PDF", + "将 \\include 命令转换为 \\input 命令": "Converting the \\include command to the \\input command", + "取评分最高者返回": "Returning the highest-rated one", + "不要修改!! 高危设置!通过修改此设置": "Do not modify!! High-risk setting! By modifying this setting", + "Tex源文件缺失!": "Tex source file is missing!", + "6.25 加入判定latex模板的代码": "Added code to determine the latex template on June 25", + "正在精细切分latex文件": "Finely splitting the latex file", + "获取response失败": "Failed to get response", + "手动指定语言": "Manually specify the language", + "输入arxivID": "Enter arxivID", + "对输入的word文档进行摘要生成": "Generate a summary of the input word document", + "将指定目录下的PDF文件从英文翻译成中文": "Translate PDF files from English to Chinese in the specified directory", + "如果分析错误": "If the analysis is incorrect", + "尝试第": "Try the", + "用户填3": "User fills in 3", + "请在此处追加更细致的矫错指令": "Please append more detailed correction instructions here", + "为了防止大语言模型的意外谬误产生扩散影响": "To prevent the accidental spread of errors in large language models", + "前面是中文冒号": "The colon before is in Chinese", + "内含已经翻译的Tex文档": "Contains a Tex document that has been translated", + "成功啦": "Success!", + "刷新页面即可以退出UpdateKnowledgeArchive模式": "Refresh the page to exit UpdateKnowledgeArchive mode", + "或者不在环境变量PATH中": "Or not in the environment variable PATH", + "--读取文件": "--Read the file", + "才能继续下面的步骤": "To continue with the next steps", + "代理数据解析失败": "Proxy data parsing failed", + "详见项目主README.md": "See the main README.md of the project for details", + "临时存储用于调试": "Temporarily stored for debugging", + "屏蔽空行和太短的句子": "Filter out empty lines and sentences that are too short", + "gpt 多线程请求": "GPT multi-threaded request", + "编译已经开始": "Compilation has started", + "无法找到一个主Tex文件": "Cannot find a main Tex file", + "修复括号": "Fix parentheses", + "请您不要删除或修改这行警告": "Please do not delete or modify this warning", + "请登录OpenAI查看详情 https": "Please log in to OpenAI to view details at https", + "调用函数": "Call a function", + "请查看终端的输出或耐心等待": "Please check the output in the terminal or wait patiently", + "LatexEnglishCorrection+高亮修正位置": "Latex English correction + highlight correction position", + "行": "line", + "Newbing 请求失败": "Newbing request failed", + "转化PDF编译是否成功": "Check if the conversion to PDF and compilation were successful", + "建议更换代理协议": "Recommend changing the proxy protocol", + "========================================= 插件主程序1 =====================================================": "========================================= Plugin Main Program 1 =====================================================", + "终端": "terminal", + "请先上传文件素材": "Please upload file materials first", + "前面是中文逗号": "There is a Chinese comma in front", + "请尝试把以下指令复制到高级参数区": "Please try copying the following instructions to the advanced parameters section", + "翻译-": "Translation -", + "请耐心等待": "Please be patient", + "将前后断行符脱离": "Remove line breaks before and after", + "json等": "JSON, etc.", + "生成中文PDF": "Generate Chinese PDF", + "用红色标注处保留区": "Use red color to highlight the reserved area", + "对比PDF编译是否成功": "Compare if the PDF compilation was successful", + "回答完问题后": "After answering the question", + "其他操作系统表现未知": "Unknown performance on other operating systems", + "-构建知识库": "Build knowledge base", + "还原原文": "Restore original text", + "或者重启之后再度尝试": "Or try again after restarting", + "免费": "Free", + "仅在Windows系统进行了测试": "Tested only on Windows system", + "欢迎加REAME中的QQ联系开发者": "Feel free to contact the developer via QQ in REAME", + "当前知识库内的有效文件": "Valid files in the current knowledge base", + "您可以到Github Issue区": "You can go to the Github Issue area", + "刷新Gradio前端界面": "Refresh the Gradio frontend interface", + "吸收title与作者以上的部分": "Include the title and the above part of the author", + "给出一些判定模板文档的词作为扣分项": "Provide some words in the template document as deduction items", + "--读取参数": "-- Read parameters", + "然后进行问答": "And then perform question-answering", + "根据自然语言执行插件命令": "Execute plugin commands based on natural language", + "*{\\scriptsize\\textbf{警告": "*{\\scriptsize\\textbf{Warning", + "但请查收结果": "But please check the results", + "翻译内容可靠性无保障": "No guarantee of translation accuracy", + "寻找主文件": "Find the main file", + "消耗时间的函数": "Time-consuming function", + "当前语言模型温度设定": "Current language model temperature setting", + "这需要一段时间计算": "This requires some time to calculate", + "为啥chatgpt会把cite里面的逗号换成中文逗号呀": "Why does ChatGPT change commas inside 'cite' to Chinese commas?", + "发现已经存在翻译好的PDF文档": "Found an already translated PDF document", + "待提取的知识库名称id": "Knowledge base name ID to be extracted", + "文本碎片重组为完整的tex片段": "Reassemble text fragments into complete tex fragments", + "注意事项": "Notes", + "参数说明": "Parameter description", + "或代理节点": "Or proxy node", + "构建知识库": "Building knowledge base", + "报错信息如下. 如果是与网络相关的问题": "Error message as follows. If it is related to network issues", + "功能描述": "Function description", + "禁止移除或修改此警告": "Removal or modification of this warning is prohibited", + "Arixv翻译": "Arixv translation", + "读取优先级": "Read priority", + "包含documentclass关键字": "Contains the documentclass keyword", + "根据文本使用GPT模型生成相应的图像": "Generate corresponding images using GPT model based on the text", + "图像生成所用到的提示文本": "Prompt text used for image generation", + "Your account is not active. OpenAI以账户失效为由": "Your account is not active. OpenAI states that it is due to account expiration", + "快捷的调试函数": "Convenient debugging function", + "在多Tex文档中": "In multiple Tex documents", + "因此选择GenerateImage函数": "Therefore, choose the GenerateImage function", + "当前工作路径为": "The current working directory is", + "实际得到格式": "Obtained format in reality", + "这段代码定义了一个名为TempProxy的空上下文管理器": "This code defines an empty context manager named TempProxy", + "吸收其他杂项": "Absorb other miscellaneous items", + "请输入要翻译成哪种语言": "Please enter which language to translate into", + "的单词": "of the word", + "正在尝试自动安装": "Attempting automatic installation", + "如果有必要": "If necessary", + "开始下载": "Start downloading", + "项目Github地址 \\url{https": "Project GitHub address \\url{https", + "将根据报错信息修正tex源文件并重试": "The Tex source file will be corrected and retried based on the error message", + "发送至azure openai api": "Send to Azure OpenAI API", + "吸收匿名公式": "Absorb anonymous formulas", + "用该压缩包+ConversationHistoryArchive进行反馈": "Provide feedback using the compressed package + ConversationHistoryArchive", + "需要特殊依赖": "Requires special dependencies", + "还原部分原文": "Restore part of the original text", + "构建完成": "Build completed", + "解析arxiv网址失败": "Failed to parse arXiv URL", + "输入问题后点击该插件": "Click the plugin after entering the question", + "请求子进程": "Requesting subprocess", + "请务必用 pip install -r requirements.txt 指令安装依赖": "Please make sure to install the dependencies using the 'pip install -r requirements.txt' command", + "如果程序停顿5分钟以上": "If the program pauses for more than 5 minutes", + "转化PDF编译已经成功": "Conversion to PDF compilation was successful", + "虽然PDF生成失败了": "Although PDF generation failed", + "分析上述回答": "Analyze the above answer", + "吸收在42行以内的begin-end组合": "Absorb the begin-end combination within 42 lines", + "推荐http": "Recommend http", + "Latex没有安装": "Latex is not installed", + "用latex编译为PDF对修正处做高亮": "Compile to PDF using LaTeX and highlight the corrections", + "reverse 操作必须放在最后": "'reverse' operation must be placed at the end", + "AZURE OPENAI API拒绝了请求": "AZURE OPENAI API rejected the request", + "该项目的Latex主文件是": "The main LaTeX file of this project is", + "You are associated with a deactivated account. OpenAI以账户失效为由": "You are associated with a deactivated account. OpenAI considers it as an account expiration", + "它*必须*被包含在AVAIL_LLM_MODELS列表中": "It *must* be included in the AVAIL_LLM_MODELS list", + "未知指令": "Unknown command", + "尝试执行Latex指令失败": "Failed to execute the LaTeX command", + "摘要生成后的文档路径": "Path of the document after summary generation", + "GPT结果已输出": "GPT result has been outputted", + "使用Newbing": "Using Newbing", + "其他模型转化效果未知": "Unknown conversion effect of other models", + "P.S. 但愿没人把latex模板放在里面传进来": "P.S. Hopefully, no one passes a LaTeX template in it", + "定位主Latex文件": "Locate the main LaTeX file", + "后面是英文冒号": "English colon follows", + "文档越长耗时越长": "The longer the document, the longer it takes.", + "压缩包": "Compressed file", + "但通常不会出现在正文": "But usually does not appear in the body.", + "正在预热文本向量化模组": "Preheating text vectorization module", + "5刀": "5 dollars", + "提问吧! 但注意": "Ask questions! But be careful", + "发送至AZURE OPENAI API": "Send to AZURE OPENAI API", + "请仔细鉴别并以原文为准": "Please carefully verify and refer to the original text", + "如果需要使用AZURE 详情请见额外文档 docs\\use_azure.md": "If you need to use AZURE, please refer to the additional document docs\\use_azure.md for details", + "使用正则表达式查找半行注释": "Use regular expressions to find inline comments", + "只有第二步成功": "Only the second step is successful", + "P.S. 顺便把CTEX塞进去以支持中文": "P.S. By the way, include CTEX to support Chinese", + "安装方法https": "Installation method: https", + "则跳过GPT请求环节": "Then skip the GPT request process", + "请切换至“UpdateKnowledgeArchive”插件进行知识库访问": "Please switch to the 'UpdateKnowledgeArchive' plugin for knowledge base access", + "=================================== 工具函数 ===============================================": "=================================== Utility functions ===============================================", + "填入azure openai api的密钥": "Fill in the Azure OpenAI API key", + "上传Latex压缩包": "Upload LaTeX compressed file", + "远程云服务器部署": "Deploy to remote cloud server", + "用黑色标注转换区": "Use black color to annotate the conversion area", + "音频文件的路径": "Path to the audio file", + "必须包含documentclass": "Must include documentclass", + "再列出用户可能提出的三个问题": "List three more questions that the user might ask", + "根据需要切换prompt": "Switch the prompt as needed", + "将文件复制一份到下载区": "Make a copy of the file in the download area", + "次编译": "Second compilation", + "Latex文件融合完成": "LaTeX file merging completed", + "返回": "Return", + "后面是英文逗号": "Comma after this", + "对不同latex源文件扣分": "Deduct points for different LaTeX source files", + "失败啦": "Failed", + "编译BibTex": "Compile BibTeX", + "Linux下必须使用Docker安装": "Must install using Docker on Linux", + "报错信息": "Error message", + "删除或修改歧义文件": "Delete or modify ambiguous files", + "-预热文本向量化模组": "- Preheating text vectorization module", + "将每次对话记录写入Markdown格式的文件中": "Write each conversation record into a file in Markdown format", + "其他类型文献转化效果未知": "Unknown conversion effect for other types of literature", + "获取线程锁": "Acquire thread lock", + "使用英文": "Use English", + "如果存在调试缓存文件": "If there is a debug cache file", + "您需要首先调用构建知识库": "You need to call the knowledge base building first", + "原始PDF编译是否成功": "Whether the original PDF compilation is successful", + "生成 azure openai api请求": "Generate Azure OpenAI API requests", + "正在编译PDF": "Compiling PDF", + "仅调试": "Debug only", + "========================================= 插件主程序2 =====================================================": "========================================= Plugin Main Program 2 =====================================================", + "多线程翻译开始": "Multithreaded translation begins", + "出问题了": "There is a problem", + "版权归原文作者所有": "Copyright belongs to the original author", + "当前大语言模型": "Current large language model", + "目前对机器学习类文献转化效果最好": "Currently, the best conversion effect for machine learning literature", + "这个paper有个input命令文件名大小写错误!": "This paper has an input command with a filename case error!", + "期望格式例如": "Expected format, for example", + "解决部分词汇翻译不准确的问题": "Resolve the issue of inaccurate translation for some terms", + "待注入的知识库名称id": "Name/ID of the knowledge base to be injected", + "精细切分latex文件": "Fine-grained segmentation of LaTeX files", + "永远给定None": "Always given None", + "work_folder = Latex预处理": "work_folder = LaTeX preprocessing", + "请直接去该路径下取回翻译结果": "Please directly go to the path to retrieve the translation results", + "寻找主tex文件": "Finding the main .tex file", + "模型参数": "Model parameters", + "返回找到的第一个": "Return the first one found", + "编译转化后的PDF": "Compile the converted PDF", + "\\SEAFILE_LOCALŅ03047\\我的资料库\\music\\Akie秋绘-未来轮廓.mp3": "\\SEAFILE_LOCALŅ03047\\My Library\\music\\Akie秋绘-未来轮廓.mp3", + "拆分过长的latex片段": "Splitting overly long LaTeX fragments", + "没有找到任何可读取文件": "No readable files found", + "暗色模式 / 亮色模式": "Dark mode / Light mode", + "检测到arxiv文档连接": "Detected arXiv document link", + "此插件Windows支持最佳": "This plugin has best support for Windows", + "from crazy_functions.虚空终端 import 终端": "from crazy_functions.null_terminal import Terminal", + "本地论文翻译": "Local paper translation", + "输出html调试文件": "Output HTML debugging file", + "以下所有配置也都支持利用环境变量覆写": "All the following configurations can also be overridden using environment variables", + "PDF文件所在的路径": "Path of the PDF file", + "也是可读的": "It is also readable", + "将消耗较长时间下载中文向量化模型": "Downloading Chinese vectorization model will take a long time", + "环境变量配置格式见docker-compose.yml": "See docker-compose.yml for the format of environment variable configuration", + "编译文献交叉引用": "Compile bibliographic cross-references", + "默认为default": "Default is 'default'", + "或者使用此插件继续上传更多文件": "Or use this plugin to continue uploading more files", + "该PDF由GPT-Academic开源项目调用大语言模型+Latex翻译插件一键生成": "This PDF is generated by the GPT-Academic open-source project using a large language model + LaTeX translation plugin", + "使用latexdiff生成论文转化前后对比": "Use latexdiff to generate before and after comparison of paper transformation", + "正在编译PDF文档": "Compiling PDF document", + "读取config.py文件中关于AZURE OPENAI API的信息": "Read the information about AZURE OPENAI API from the config.py file", + "配置教程&视频教程": "Configuration tutorial & video tutorial", + "临时地启动代理网络": "Temporarily start proxy network", + "临时地激活代理网络": "Temporarily activate proxy network", + "功能尚不稳定": "Functionality is unstable", + "默认为Chinese": "Default is Chinese", + "请查收结果": "Please check the results", + "将 chatglm 直接对齐到 chatglm2": "Align chatglm directly to chatglm2", + "中读取数据构建知识库": "Build a knowledge base by reading data in", + "用于给一小段代码上代理": "Used to proxy a small piece of code", + "分析结果": "Analysis results", + "依赖不足": "Insufficient dependencies", + "Markdown翻译": "Markdown translation", + "除非您是论文的原作者": "Unless you are the original author of the paper", + "test_LangchainKnowledgeBase读取": "test_LangchainKnowledgeBase read", + "将多文件tex工程融合为一个巨型tex": "Merge multiple tex projects into one giant tex", + "吸收iffalse注释": "Absorb iffalser comments", + "您接下来不能再使用其他插件了": "You can no longer use other plugins next", + "正在构建知识库": "Building knowledge base", + "需Latex": "Requires Latex", + "即找不到": "That is not found", + "保证括号正确": "Ensure parentheses are correct", + "= 2 通过一些Latex模板中常见": "= 2 through some common Latex templates", + "请立即终止程序": "Please terminate the program immediately", + "解压失败! 需要安装pip install rarfile来解压rar文件": "Decompression failed! Install 'pip install rarfile' to decompress rar files", + "请在此处给出自定义翻译命令": "Please provide custom translation command here", + "解压失败! 需要安装pip install py7zr来解压7z文件": "Decompression failed! Install 'pip install py7zr' to decompress 7z files", + "执行错误": "Execution error", + "目前仅支持GPT3.5/GPT4": "Currently only supports GPT3.5/GPT4", + "P.S. 顺便把Latex的注释去除": "P.S. Also remove comments from Latex", + "写出文件": "Write out the file", + "当前报错的latex代码处于第": "The current error in the LaTeX code is on line", + "主程序即将开始": "Main program is about to start", + "详情信息见requirements.txt": "See details in requirements.txt", + "释放线程锁": "Release thread lock", + "由于最为关键的转化PDF编译失败": "Due to the critical failure of PDF conversion and compilation", + "即将退出": "Exiting soon", + "尝试下载": "Attempting to download", + "删除整行的空注释": "Remove empty comments from the entire line", + "也找不到": "Not found either", + "从一批文件": "From a batch of files", + "编译结束": "Compilation finished", + "调用缓存": "Calling cache", + "只有GenerateImage和生成图像相关": "Only GenerateImage and image generation related", + "待处理的word文档路径": "Path of the word document to be processed", + "是否在提交时自动清空输入框": "Whether to automatically clear the input box upon submission", + "检查结果": "Check the result", + "生成时间戳": "Generate a timestamp", + "编译原始PDF": "Compile the original PDF", + "填入ENGINE": "Fill in ENGINE", + "填入api版本": "Fill in the API version", + "中文Bing版": "Chinese Bing version", + "当前支持的格式包括": "Currently supported formats include" } \ No newline at end of file diff --git a/multi_language.py b/multi_language.py index 6c72598..b4a8834 100644 --- a/multi_language.py +++ b/multi_language.py @@ -33,7 +33,7 @@ import pickle import time 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', 'build', '.github', '.vscode', '__pycache__', 'venv'] # LANG = "TraditionalChinese" # TransPrompt = f"Replace each json value `#` with translated results in Traditional Chinese, e.g., \"原始文本\":\"翻譯後文字\". Keep Json format. Do not answer #." @@ -301,6 +301,7 @@ def step_1_core_key_translate(): elif isinstance(node, ast.ImportFrom): for n in node.names: if contains_chinese(n.name): syntax.append(n.name) + # if node.module is None: print(node.module) for k in node.module.split('.'): if contains_chinese(k): syntax.append(k) return syntax @@ -310,6 +311,7 @@ def step_1_core_key_translate(): for root, dirs, files in os.walk(directory_path): if any([b in root for b in blacklist]): continue + print(files) for file in files: if file.endswith('.py'): file_path = os.path.join(root, file) @@ -505,6 +507,6 @@ def step_2_core_key_translate(): with open(file_path_new, 'w', encoding='utf-8') as f: f.write(content) os.remove(file_path) - step_1_core_key_translate() step_2_core_key_translate() +print('Finished, checkout generated results at ./multi-language/') \ No newline at end of file