mirror of
https://github.com/kejilion/sh.git
synced 2025-10-03 23:34:20 +08:00
🌐 Weekly translation update - 2025-07-17 10:19:36
This commit is contained in:
parent
73acd7114e
commit
3b3ac3e1c1
5 changed files with 2711 additions and 1057 deletions
|
@ -878,6 +878,14 @@ close_port() {
|
|||
fi
|
||||
done
|
||||
|
||||
# Delete existing rules (if any)
|
||||
iptables -D INPUT -i lo -j ACCEPT 2>/dev/null
|
||||
iptables -D FORWARD -i lo -j ACCEPT 2>/dev/null
|
||||
|
||||
# Insert new rules to first
|
||||
iptables -I INPUT 1 -i lo -j ACCEPT
|
||||
iptables -I FORWARD 1 -i lo -j ACCEPT
|
||||
|
||||
save_iptables_rules
|
||||
send_stats "Port closed"
|
||||
}
|
||||
|
@ -1481,6 +1489,7 @@ certs_status() {
|
|||
echo -e "3. Network configuration issues ➠ If you use Cloudflare Warp and other virtual networks, please temporarily shut down"
|
||||
echo -e "4. Firewall restrictions ➠ Check whether port 80/443 is open to ensure verification is accessible"
|
||||
echo -e "5. The number of applications exceeds the limit ➠ Let's Encrypt has a weekly limit (5 times/domain name/week)"
|
||||
echo -e "6. Domestic registration restrictions ➠ Please confirm whether the domain name is registered in mainland China"
|
||||
break_end
|
||||
clear
|
||||
echo "Please try deploying again$webname"
|
||||
|
@ -3400,7 +3409,7 @@ ldnmp_web_status() {
|
|||
break_end
|
||||
;;
|
||||
6)
|
||||
send_stats "查看错误日志"
|
||||
send_stats "View error log"
|
||||
tail -n 200 /home/web/log/nginx/error.log
|
||||
break_end
|
||||
;;
|
||||
|
@ -4407,7 +4416,7 @@ sed -i 's/^\s*#\?\s*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_confi
|
|||
sed -i 's/^\s*#\?\s*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
|
||||
rm -rf /etc/ssh/sshd_config.d/* /etc/ssh/ssh_config.d/*
|
||||
restart_ssh
|
||||
echo -e "${gl_lv}ROOT login settings are complete!${gl_bai}"
|
||||
echo -e "${gl_lv}ROOT login is set up!${gl_bai}"
|
||||
|
||||
}
|
||||
|
||||
|
@ -6224,7 +6233,7 @@ run_task() {
|
|||
echo "1. Is the network connection normal?"
|
||||
echo "2. Is the remote host accessible?"
|
||||
echo "3. Is the authentication information correct?"
|
||||
echo "4. 本地和远程目录是否有正确的访问权限"
|
||||
echo "4. Do local and remote directories have correct access permissions"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -8359,7 +8368,7 @@ linux_panel() {
|
|||
echo -e "${gl_kjlan}21. ${gl_bai}VScode web version${gl_kjlan}22. ${gl_bai}UptimeKuma monitoring tool"
|
||||
echo -e "${gl_kjlan}23. ${gl_bai}Memos web page memo${gl_kjlan}24. ${gl_bai}Webtop Remote Desktop Web Edition${gl_huang}★${gl_bai}"
|
||||
echo -e "${gl_kjlan}25. ${gl_bai}Nextcloud network disk${gl_kjlan}26. ${gl_bai}QD-Today timing task management framework"
|
||||
echo -e "${gl_kjlan}27. ${gl_bai}Dockge Container Stack Management Panel${gl_kjlan}28. ${gl_bai}LibreSpeed Speed Test Tool"
|
||||
echo -e "${gl_kjlan}27. ${gl_bai}Dockge Container Stack Management Panel${gl_kjlan}28. ${gl_bai}LibreSpeed Speed Test Tool"
|
||||
echo -e "${gl_kjlan}29. ${gl_bai}searxng aggregation search site${gl_huang}★${gl_bai} ${gl_kjlan}30. ${gl_bai}PhotoPrism Private Album System"
|
||||
echo -e "${gl_kjlan}------------------------"
|
||||
echo -e "${gl_kjlan}31. ${gl_bai}StirlingPDF tool collection${gl_kjlan}32. ${gl_bai}drawio free online charting software${gl_huang}★${gl_bai}"
|
||||
|
@ -10204,7 +10213,7 @@ linux_panel() {
|
|||
}
|
||||
|
||||
local docker_describe="自动将你的公网 IP(IPv4/IPv6)实时更新到各大 DNS 服务商,实现动态域名解析。"
|
||||
local docker_url="官网介绍: https://github.com/CorentinTh/it-tools"
|
||||
local docker_url="官网介绍: https://github.com/jeessy2/ddns-go"
|
||||
local docker_use=""
|
||||
local docker_passwd=""
|
||||
local app_size="1"
|
||||
|
|
1827
jp/kejilion.sh
1827
jp/kejilion.sh
File diff suppressed because it is too large
Load diff
1809
kr/kejilion.sh
1809
kr/kejilion.sh
File diff suppressed because it is too large
Load diff
102
translate.py
Normal file
102
translate.py
Normal file
|
@ -0,0 +1,102 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
from deep_translator import GoogleTranslator
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
|
||||
def is_chinese(text):
|
||||
return bool(re.search(r'[\u4e00-\u9fff]', text))
|
||||
|
||||
def translate_text(text, target_lang):
|
||||
try:
|
||||
return GoogleTranslator(source='zh-CN', target=target_lang).translate(text)
|
||||
except Exception as e:
|
||||
print(f"\nTranslation error: {e}")
|
||||
return text
|
||||
|
||||
def translate_line_preserving_variables(line, target_lang):
|
||||
"""
|
||||
Translate only Chinese parts in echo/read/send_stats commands, excluding shell variables
|
||||
"""
|
||||
# Match double or single quoted strings
|
||||
def repl(match):
|
||||
full_string = match.group(0)
|
||||
quote = full_string[0]
|
||||
content = full_string[1:-1]
|
||||
# Split by variable expressions
|
||||
parts = re.split(r'(\$\{?\w+\}?)', content)
|
||||
translated_parts = [
|
||||
translate_text(p, target_lang) if is_chinese(p) else p
|
||||
for p in parts
|
||||
]
|
||||
return quote + ''.join(translated_parts) + quote
|
||||
|
||||
return re.sub(r'(?:\'[^\']*\'|"[^"]*")', repl, line)
|
||||
|
||||
def translate_file(input_file, output_file, target_lang):
|
||||
print(f"Translating to {target_lang}...")
|
||||
|
||||
if not os.path.exists(input_file):
|
||||
print(f"Error: Input file {input_file} not found")
|
||||
return False
|
||||
|
||||
total_lines = sum(1 for _ in open(input_file, 'r', encoding='utf-8'))
|
||||
processed_lines = 0
|
||||
|
||||
with open(input_file, 'r', encoding='utf-8') as f_in, \
|
||||
open(output_file, 'w', encoding='utf-8') as f_out:
|
||||
|
||||
for line in f_in:
|
||||
processed_lines += 1
|
||||
progress = processed_lines / total_lines * 100
|
||||
print(f"\rProcessing: {progress:.1f}% ({processed_lines}/{total_lines})", end='')
|
||||
|
||||
leading_space = re.match(r'^(\s*)', line).group(1)
|
||||
stripped = line.strip()
|
||||
|
||||
if stripped.startswith('#') and is_chinese(stripped):
|
||||
comment_mark = '#'
|
||||
comment_text = stripped[1:].strip()
|
||||
if comment_text:
|
||||
translated = translate_text(comment_text, target_lang)
|
||||
f_out.write(f"{leading_space}{comment_mark} {translated}\n")
|
||||
else:
|
||||
f_out.write(line)
|
||||
elif any(cmd in stripped for cmd in ['echo', 'read', 'send_stats']) and is_chinese(stripped):
|
||||
translated_line = translate_line_preserving_variables(line, target_lang)
|
||||
f_out.write(translated_line)
|
||||
else:
|
||||
f_out.write(line)
|
||||
|
||||
print(f"\nTranslation to {target_lang} completed.")
|
||||
print(f"Original file size: {os.path.getsize(input_file)} bytes")
|
||||
print(f"Translated file size: {os.path.getsize(output_file)} bytes")
|
||||
return True
|
||||
|
||||
if __name__ == "__main__":
|
||||
input_file = 'kejilion.sh'
|
||||
|
||||
# 语言映射:目录名 -> Google翻译语言代码
|
||||
languages = {
|
||||
'en': 'en', # 英语
|
||||
'tw': 'zh-TW', # 繁体中文
|
||||
'kr': 'ko', # 韩语
|
||||
'jp': 'ja' # 日语
|
||||
}
|
||||
|
||||
success_count = 0
|
||||
|
||||
for dir_name, lang_code in languages.items():
|
||||
output_file = f'{dir_name}/kejilion.sh'
|
||||
if translate_file(input_file, output_file, lang_code):
|
||||
success_count += 1
|
||||
print(f"✓ Successfully translated to {dir_name}")
|
||||
else:
|
||||
print(f"✗ Failed to translate to {dir_name}")
|
||||
print("-" * 50)
|
||||
|
||||
print(f"\nTranslation summary: {success_count}/{len(languages)} languages completed")
|
||||
|
||||
if success_count == 0:
|
||||
sys.exit(1)
|
|
@ -878,6 +878,14 @@ close_port() {
|
|||
fi
|
||||
done
|
||||
|
||||
# 刪除已存在的規則(如果有)
|
||||
iptables -D INPUT -i lo -j ACCEPT 2>/dev/null
|
||||
iptables -D FORWARD -i lo -j ACCEPT 2>/dev/null
|
||||
|
||||
# 插入新規則到第一條
|
||||
iptables -I INPUT 1 -i lo -j ACCEPT
|
||||
iptables -I FORWARD 1 -i lo -j ACCEPT
|
||||
|
||||
save_iptables_rules
|
||||
send_stats "已關閉端口"
|
||||
}
|
||||
|
@ -1481,6 +1489,7 @@ certs_status() {
|
|||
echo -e "3. 網絡配置問題 ➠ 如使用Cloudflare Warp等虛擬網絡請暫時關閉"
|
||||
echo -e "4. 防火牆限制 ➠ 檢查80/443端口是否開放,確保驗證可訪問"
|
||||
echo -e "5. 申請次數超限 ➠ Let's Encrypt有每週限額(5次/域名/週)"
|
||||
echo -e "6. 國內備案限制 ➠ 中國大陸環境請確認域名是否備案"
|
||||
break_end
|
||||
clear
|
||||
echo "請再次嘗試部署$webname"
|
||||
|
@ -12487,7 +12496,7 @@ echo -e "${gl_kjlan}p. ${gl_bai}幻獸帕魯開服腳本"
|
|||
echo -e "${gl_kjlan}------------------------${gl_bai}"
|
||||
echo -e "${gl_kjlan}00. ${gl_bai}腳本更新"
|
||||
echo -e "${gl_kjlan}------------------------${gl_bai}"
|
||||
echo -e "${gl_kjlan}0. ${gl_bai}退出脚本"
|
||||
echo -e "${gl_kjlan}0. ${gl_bai}退出腳本"
|
||||
echo -e "${gl_kjlan}------------------------${gl_bai}"
|
||||
read -e -p "請輸入你的選擇:" choice
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue