进一步的 kvmd 国际化(汉化)支持,添加配置入口

yaml 配置示例:
```
languages:
    console: zh
    web: zh
```
This commit is contained in:
mofeng-git
2024-08-14 22:54:12 +08:00
parent 5b25b3661f
commit 35397c5414
47 changed files with 567 additions and 181 deletions

View File

@@ -41,7 +41,7 @@ from ....validators.basic import valid_float_f01
from ....validators.os import valid_abs_path
from ....validators.hw import valid_tty_speed
from ....lanuages import Lanuages
from ....languages import Languages
from .. import BaseHid
@@ -84,7 +84,7 @@ class Plugin(BaseHid, multiprocessing.Process): # pylint: disable=too-many-inst
self.__keyboard = Keyboard()
self.__mouse = Mouse()
self.gettext=Lanuages().gettext
self.gettext=Languages().gettext
@classmethod
def get_plugin_options(cls) -> dict:

View File

@@ -25,7 +25,7 @@ import contextlib
from typing import Generator
from ....lanuages import Lanuages
from ....languages import Languages
# =====
@@ -37,7 +37,7 @@ class ChipResponseError(Exception):
class ChipConnection:
def __init__(self, tty: serial.Serial) -> None:
self.__tty = tty
self.gettext=Lanuages().gettext
self.gettext=Languages().gettext
def xfer(self, cmd: bytes) -> int:
self.__send(cmd)