Skip to content

Commit fc8cf64

Browse files
committed
chore(import): 🔨 删除原来的本地化添加默认脚本名称
没用本地名称是无法导入的
1 parent 5d7848a commit fc8cf64

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

utils/script-import-sync.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,14 @@ def import_scripts(self, sync_urls):
144144
'commit': '导入'
145145
}
146146
response = self.session.post(import_url, headers=headers, data=data)
147-
147+
print(response.text)
148148
# 解析返回的脚本ID信息
149149
if response.status_code == 200:
150150
soup = BeautifulSoup(response.text, 'html.parser')
151151
# 提取返回的脚步列表
152152
results = [] # 用于存储解析后的数组
153153
ul_element = soup.select_one("body > div.width-constraint > section > ul")
154+
print(ul_element)
154155
if ul_element:
155156
li_elements = ul_element.find_all("li") # 获取所有<li>元素
156157
for li in li_elements:
@@ -237,4 +238,4 @@ def sync_update(self, script_url, defaultfile, script_id, urls):
237238
# 更新json
238239
with open(json_path, 'w', encoding='utf-8') as f:
239240
json.dump(data, f, ensure_ascii=False, indent=4)
240-
print(f"----\033[94m[{full_path}]→→→→\033[0m\033[92m 勤务员提醒:新添加的脚本已被添加到GreasyFork网站!\033[0m")
241+
print(f"----\033[94m脚本ID:({import_script_id})-[{script.get('path')}]→→→→\033[0m\033[92m 勤务员提醒:新添加的脚本已被添加到GreasyFork网站!\033[0m")

utils/userscript_localization_tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import argparse
2-
import os
32
import json
43
import re
54
import threading
@@ -171,8 +170,9 @@ def translate_and_collect(lines, chinese_texts, lang):
171170
translation_output += f'// @name {translated_text}\n'
172171
else:
173172
translation_output += f'// @description:{lang} {translated_text}'
174-
if lang == 'en':
175-
translation_output += f'\n// @description {translated_text}'
173+
# NOTE - - 此处无需添加英文翻译,因为在本地已被翻译
174+
""" if lang == 'en':
175+
translation_output += f'\n// @description {translated_text}' """
176176
return translation_output
177177

178178

0 commit comments

Comments
 (0)