🌐 添加模板语言的映射

This commit is contained in:
2025-04-15 03:11:30 +08:00
parent 1679576fb4
commit f90be2ef9c
5 changed files with 28 additions and 3 deletions

View File

@@ -67,6 +67,19 @@
}
}
}
},
"template": {
"title": "Template",
"description": "Scope 'template' of lang item",
"type": "object",
"additionalProperties": false,
"properties": {
"template_language": {
"title": "template_language",
"description": "value of lang item type 'template_language'",
"type": "string"
}
}
}
}
}
}

View File

@@ -11,6 +11,7 @@
{
"scope": "error",
"types": [{ "subtype": "MessageFormatError", "types": ["TETR.IO", "TOS", "TOP"] }]
}
},
{ "scope": "template", "types": ["template_language"] }
]
}

View File

@@ -12,5 +12,8 @@
"TOS": "Username/ID is invalid",
"TOP": "Username is invalid"
}
},
"template": {
"template_language": "en-US"
}
}

View File

@@ -1,7 +1,7 @@
# This file is @generated by tarina.lang CLI tool
# It is not intended for manual editing.
from tarina.lang.model import LangItem, LangModel # type: ignore[import-untyped]
from tarina.lang.model import LangItem, LangModel
class InteractionWrong:
@@ -27,6 +27,11 @@ class Error:
MessageFormatError = ErrorMessageformaterror
class Template:
template_language: LangItem = LangItem('template', 'template_language')
class Lang(LangModel):
interaction = Interaction
error = Error
template = Template

View File

@@ -10,5 +10,8 @@
"TOS": "用户名/ID不合法",
"TOP": "用户名不合法"
}
},
"template": {
"template_language": "zh-CN"
}
}