Skip to content

Commit d852bcf

Browse files
committed
feat: Enhance Multilingual Support and System Language Detection
- Add automatic system language detection for Windows and Unix-like systems - Update localization files with new translation keys - Improve language handling in various modules - Translate more UI messages to English - Add GitHub link to logo display - Bump version to 1.4.04
1 parent 4c91525 commit d852bcf

17 files changed

+240
-148
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=1.4.03
2-
VERSION=1.4.03
1+
version=1.4.04
2+
VERSION=1.4.04

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
cursor_accounts.txt
22
/venv
33
/__pycache__
4+
dist
5+
build
6+
install.bat
7+
run.bat
8+
temp_account_info.txt

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## v1.4.04
4+
5+
1. Change Some Language Info to English | 更改一些語言信息為英文
6+
2. Add Auto Detect System Language | 增加自動檢測系統語言
7+
3. Fixed Some Issues | 修復一些問題
8+
9+
310
## v1.4.03
411

512
1. Switch to API-based Registration System | 改用API註冊系統替代瀏覽器操作

build.bat

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
chcp 65001 > nul
33
cls
44

5-
:: 檢查是否以管理員權限運行
5+
:: Check if running with administrator privileges
66
net session >nul 2>&1
77
if %errorLevel% == 0 (
8-
:: 如果是管理員權限,只創建虛擬環境後就降權運行
8+
:: If running with administrator privileges, create virtual environment and then run with normal user privileges
99
if not exist venv (
1010
echo ℹ️ 正在創建虛擬環境...
1111
python -m venv venv
1212
)
1313

14-
:: 降權運行剩餘的步驟
14+
:: Run remaining steps with normal user privileges
1515
echo ℹ️ 以普通用戶權限繼續...
1616
powershell -Command "Start-Process -FilePath '%comspec%' -ArgumentList '/c cd /d %cd% && %~f0 run' -Verb RunAs:NO"
1717
exit /b
1818
) else (
19-
:: 檢查是否是第二階段運行
19+
:: Check if running in second stage
2020
if "%1"=="run" (
2121
goto RUN_BUILD
2222
) else (
23-
:: 如果是普通權限且需要創建虛擬環境,請求管理員權限
23+
:: If running with normal privileges and creating virtual environment is required, request administrator privileges
2424
if not exist venv (
25-
echo ⚠️ 需要管理員權限來創建虛擬環境
26-
echo ℹ️ 正在請求管理員權限...
25+
echo ⚠️ Requires administrator privileges to create virtual environment
26+
echo ℹ️ Requesting administrator privileges...
2727
powershell -Command "Start-Process -Verb RunAs -FilePath '%comspec%' -ArgumentList '/c cd /d %cd% && %~f0'"
2828
exit /b
2929
) else (
@@ -33,30 +33,30 @@ if %errorLevel% == 0 (
3333
)
3434

3535
:RUN_BUILD
36-
echo ℹ️ 啟動虛擬環境...
36+
echo ℹ️ Starting virtual environment...
3737
call venv\Scripts\activate.bat
3838
if errorlevel 1 (
39-
echo啟動虛擬環境失敗
39+
echoFailed to start virtual environment
4040
pause
4141
exit /b 1
4242
)
4343

44-
:: 檢查並安裝缺失的依賴
45-
echo ℹ️ 檢查依賴...
44+
:: Check and install missing dependencies
45+
echo ℹ️ Checking dependencies...
4646
for /f "tokens=1" %%i in (requirements.txt) do (
4747
pip show %%i >nul 2>&1 || (
48-
echo ℹ️ 安裝 %%i...
48+
echo ℹ️ Installing %%i...
4949
pip install %%i
5050
)
5151
)
5252

53-
echo ℹ️ 開始構建...
53+
echo ℹ️ Starting build...
5454
python build.py
5555
if errorlevel 1 (
56-
echo構建失敗
56+
echoBuild failed
5757
pause
5858
exit /b 1
5959
)
6060

61-
echo完成!
61+
echoCompleted!
6262
pause

build.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from logo import print_logo
99
from dotenv import load_dotenv
1010

11-
# 忽略特定警告
11+
# Ignore specific warnings
1212
warnings.filterwarnings("ignore", category=SyntaxWarning)
1313

1414
class LoadingAnimation:
@@ -50,29 +50,29 @@ def simulate_progress(message, duration=1.0, steps=20):
5050
progress_bar(i, steps, prefix="Progress:", length=40)
5151

5252
def build():
53-
# 清理屏幕
53+
# Clean screen
5454
os.system("cls" if platform.system().lower() == "windows" else "clear")
5555

56-
# 顯示 logo
56+
# Display logo
5757
print_logo()
5858

59-
# 清理 PyInstaller 緩存
60-
print("\033[93m🧹 清理構建緩存...\033[0m")
59+
# Clean PyInstaller cache
60+
print("\033[93m🧹 Cleaning build cache...\033[0m")
6161
if os.path.exists('build'):
6262
shutil.rmtree('build')
6363

64-
# 重新加載環境變量以確保獲取最新版本
64+
# Reload environment variables to ensure getting the latest version
6565
load_dotenv(override=True)
6666
version = os.getenv('VERSION', '1.0.0')
67-
print(f"\033[93m📦 正在構建版本: v{version}\033[0m")
67+
print(f"\033[93m📦 Building version: v{version}\033[0m")
6868

6969
try:
7070
simulate_progress("Preparing build environment...", 0.5)
7171

7272
loading = LoadingAnimation()
7373
loading.start("Building in progress")
7474

75-
# 根据系统类型设置输出名称
75+
# Set output name based on system type
7676
system = platform.system().lower()
7777
if system == "windows":
7878
os_type = "windows"
@@ -86,7 +86,7 @@ def build():
8686

8787
output_name = f"CursorFreeVIP_{version}_{os_type}"
8888

89-
# 构建命令
89+
# Build command
9090
build_command = f'pyinstaller --clean --noconfirm build.spec'
9191
output_path = os.path.join('dist', f'{output_name}{ext}')
9292

@@ -95,16 +95,16 @@ def build():
9595
loading.stop()
9696

9797
if os.path.exists(output_path):
98-
print(f"\n\033[92m✅ 構建完成!")
99-
print(f"📦 可執行文件位於: {output_path}\033[0m")
98+
print(f"\n\033[92m✅ Build completed!")
99+
print(f"📦 Executable file located: {output_path}\033[0m")
100100
else:
101-
print("\n\033[91m❌ 構建失敗:未找到輸出文件\033[0m")
101+
print("\n\033[91m❌ Build failed: Output file not found\033[0m")
102102
return False
103103

104104
except Exception as e:
105105
if loading:
106106
loading.stop()
107-
print(f"\n\033[91m❌ 構建過程出錯: {str(e)}\033[0m")
107+
print(f"\n\033[91m❌ Build process error: {str(e)}\033[0m")
108108
return False
109109

110110
return True

build.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,50 @@ NC='\033[0m' # No Color
88

99
# 检查并安装必要的依赖
1010
check_dependencies() {
11-
echo -e "${YELLOW}检查系统依赖...${NC}"
11+
echo -e "${YELLOW}Checking system dependencies...${NC}"
1212

1313
# 检查是否为 Ubuntu/Debian
1414
if [ -f /etc/debian_version ]; then
1515
# 检查并安装必要的包
1616
PACKAGES="python3 python3-pip python3-venv"
1717
for pkg in $PACKAGES; do
1818
if ! dpkg -l | grep -q "^ii $pkg "; then
19-
echo -e "${YELLOW}安装 $pkg...${NC}"
19+
echo -e "${YELLOW}Installing $pkg...${NC}"
2020
sudo apt-get update
2121
sudo apt-get install -y $pkg
2222
fi
2323
done
2424
else
25-
echo -e "${RED}不支持的系统,请手动安装 python3, pip3 python3-venv${NC}"
25+
echo -e "${RED}Unsupported system, please install python3, pip3 and python3-venv manually${NC}"
2626
exit 1
2727
fi
2828
}
2929

3030
# 创建并激活虚拟环境
3131
setup_venv() {
32-
echo -e "${GREEN}正在创建虚拟环境...${NC}"
32+
echo -e "${GREEN}Creating virtual environment...${NC}"
3333
python3 -m venv venv
3434

35-
echo -e "${GREEN}启动虚拟环境...${NC}"
35+
echo -e "${GREEN}Starting virtual environment...${NC}"
3636
. ./venv/bin/activate || source ./venv/bin/activate
3737
}
3838

3939
# 安装依赖
4040
install_dependencies() {
41-
echo -e "${GREEN}安装依赖...${NC}"
41+
echo -e "${GREEN}Installing dependencies...${NC}"
4242
python3 -m pip install --upgrade pip
4343
pip3 install -r requirements.txt
4444
}
4545

4646
# 构建程序
4747
build_program() {
48-
echo -e "${GREEN}开始构建...${NC}"
48+
echo -e "${GREEN}Starting build...${NC}"
4949
python3 build.py
5050
}
5151

5252
# 清理
5353
cleanup() {
54-
echo -e "${GREEN}清理虚拟环境...${NC}"
54+
echo -e "${GREEN}Cleaning virtual environment...${NC}"
5555
deactivate 2>/dev/null || true
5656
rm -rf venv
5757
}
@@ -73,8 +73,8 @@ main() {
7373
# 清理
7474
cleanup
7575

76-
echo -e "${GREEN}完成!${NC}"
77-
echo "按任意键退出..."
76+
echo -e "${GREEN}Completed!${NC}"
77+
echo "Press any key to exit..."
7878
# 使用兼容的方式读取输入
7979
if [ "$(uname)" = "Linux" ]; then
8080
read dummy

0 commit comments

Comments
 (0)