mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-02 02:51:53 +08:00
初步的 kvmd 国际化(汉化)支持
1. 添加汉化文件 2. 添加 Lanuages().gettext 函数处理字符替换 3. 修改相关字符串调用
This commit is contained in:
7
kvmd/lanuages.py
Normal file
7
kvmd/lanuages.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from gettext import translation
|
||||
|
||||
class Lanuages:
|
||||
t = translation(domain="message",localedir="/kvmd/i18n",languages=["zh"]).gettext
|
||||
|
||||
def gettext(self,string: str) -> str:
|
||||
return self.t(string)
|
||||
Reference in New Issue
Block a user