mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-08-02 20:47:35 +08:00
Update localization and versioning for Vietnamese support
- Increment version to 1.7.07 in .env file. - Add Vietnamese language support in main.py and localization files (vi.json, zh_cn.json, zh_tw.json). - Translate Chinese language options to English in localization files.
This commit is contained in:
parent
db95689a8e
commit
b761bf0b6d
Binary file not shown.
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 123 KiB |
@ -15,9 +15,9 @@
|
||||
"disable_auto_update": "Tắt Tự Động Cập Nhật Cursor"
|
||||
},
|
||||
"languages": {
|
||||
"en": "Tiếng Anh",
|
||||
"zh_cn": "Tiếng Trung (Giản Thể)",
|
||||
"zh_tw": "Tiếng Trung (Phồn Thể)",
|
||||
"en": "English",
|
||||
"zh_cn": "简体中文",
|
||||
"zh_tw": "繁體中文",
|
||||
"vi": "Tiếng Việt"
|
||||
},
|
||||
"quit_cursor": {
|
||||
|
@ -17,7 +17,8 @@
|
||||
"languages": {
|
||||
"en": "English",
|
||||
"zh_cn": "简体中文",
|
||||
"zh_tw": "繁體中文"
|
||||
"zh_tw": "繁體中文",
|
||||
"vi": "Vietnamese"
|
||||
},
|
||||
"quit_cursor": {
|
||||
"start": "开始退出 Cursor",
|
||||
|
@ -17,7 +17,8 @@
|
||||
"languages": {
|
||||
"en": "English",
|
||||
"zh_cn": "简体中文",
|
||||
"zh_tw": "繁體中文"
|
||||
"zh_tw": "繁體中文",
|
||||
"vi": "Vietnamese"
|
||||
},
|
||||
"quit_cursor": {
|
||||
"start": "開始退出 Cursor",
|
||||
|
9
main.py
9
main.py
@ -107,6 +107,7 @@ class Translator:
|
||||
0x0409: 'en', # English
|
||||
0x0404: 'zh_tw', # Traditional Chinese
|
||||
0x0804: 'zh_cn', # Simplified Chinese
|
||||
0x0422: 'vi', # Vietnamese
|
||||
}
|
||||
|
||||
return language_map.get(layout_id, 'en')
|
||||
@ -130,14 +131,20 @@ class Translator:
|
||||
return 'zh_cn'
|
||||
elif system_locale.startswith('en'):
|
||||
return 'en'
|
||||
elif system_locale.startswith('vi'):
|
||||
return 'vi'
|
||||
|
||||
|
||||
# Try to get language from LANG environment variable as fallback
|
||||
env_lang = os.getenv('LANG', '').lower()
|
||||
if 'tw' in env_lang or 'hk' in env_lang:
|
||||
return 'zh_tw'
|
||||
elif 'cn' in env_lang:
|
||||
return 'zh_cn'
|
||||
elif 'vi' in env_lang:
|
||||
return 'vi'
|
||||
|
||||
|
||||
return 'en'
|
||||
except:
|
||||
return 'en'
|
||||
@ -206,7 +213,7 @@ class Translator:
|
||||
translator = Translator()
|
||||
|
||||
def print_menu():
|
||||
"""打印菜单选项"""
|
||||
"""Print menu options"""
|
||||
print(f"\n{Fore.CYAN}{EMOJI['MENU']} {translator.get('menu.title')}:{Style.RESET_ALL}")
|
||||
print(f"{Fore.YELLOW}{'─' * 40}{Style.RESET_ALL}")
|
||||
print(f"{Fore.GREEN}0{Style.RESET_ALL}. {EMOJI['ERROR']} {translator.get('menu.exit')}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user