mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
This commit is contained in:
8
nonebot_plugin_tetris_stats/utils/lang.py
Normal file
8
nonebot_plugin_tetris_stats/utils/lang.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from typing import cast
|
||||
|
||||
from ..i18n.model import Lang
|
||||
from .typedefs import Lang as LangType
|
||||
|
||||
|
||||
def get_lang() -> LangType:
|
||||
return cast('LangType', Lang.template.template_language())
|
||||
@@ -4,11 +4,11 @@ from typing import Literal
|
||||
from pydantic import BaseModel
|
||||
from strenum import StrEnum
|
||||
|
||||
from ...typedefs import Number
|
||||
from ...typedefs import Lang, Number
|
||||
|
||||
|
||||
class Base(BaseModel):
|
||||
_lang: Literal['zh-CN', 'en-US']
|
||||
_lang: Lang
|
||||
|
||||
|
||||
class Avatar(BaseModel):
|
||||
|
||||
@@ -59,3 +59,5 @@ Me: TypeAlias = Literal[
|
||||
'self',
|
||||
'oneself',
|
||||
]
|
||||
|
||||
Lang: TypeAlias = Literal['zh-CN', 'en-US']
|
||||
|
||||
Reference in New Issue
Block a user