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:
yeongpin 2025-03-14 12:12:58 +08:00
parent db95689a8e
commit b761bf0b6d
6 changed files with 17 additions and 8 deletions

4
.env
View File

@ -1,2 +1,2 @@
version=1.7.06
VERSION=1.7.06
version=1.7.07
VERSION=1.7.07

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 123 KiB

View File

@ -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": {

View File

@ -17,7 +17,8 @@
"languages": {
"en": "English",
"zh_cn": "简体中文",
"zh_tw": "繁體中文"
"zh_tw": "繁體中文",
"vi": "Vietnamese"
},
"quit_cursor": {
"start": "开始退出 Cursor",

View File

@ -17,7 +17,8 @@
"languages": {
"en": "English",
"zh_cn": "简体中文",
"zh_tw": "繁體中文"
"zh_tw": "繁體中文",
"vi": "Vietnamese"
},
"quit_cursor": {
"start": "開始退出 Cursor",

View File

@ -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')}")