mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 18:11:54 +08:00
初步的 kvmd 国际化(汉化)支持
1. 添加汉化文件 2. 添加 Lanuages().gettext 函数处理字符替换 3. 修改相关字符串调用
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
import os
|
||||
|
||||
from .lanuages import Lanuages
|
||||
|
||||
from . import env
|
||||
|
||||
|
||||
@@ -31,10 +33,10 @@ def find_udc(udc: str) -> str:
|
||||
candidates = sorted(os.listdir(path))
|
||||
if not udc:
|
||||
if len(candidates) == 0:
|
||||
raise RuntimeError("Can't find any UDC")
|
||||
raise RuntimeError(Lanuages().gettext("Can't find any UDC"))
|
||||
udc = candidates[0]
|
||||
elif udc not in candidates:
|
||||
raise RuntimeError(f"Can't find selected UDC: {udc}")
|
||||
raise RuntimeError(Lanuages().gettext(f"Can't find selected UDC: {udc}"))
|
||||
return udc # fe980000.usb
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user