From d17449b53d0c60560dbcb9087df6758aa9640f97 Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Thu, 26 Aug 2021 20:23:06 +0800 Subject: [PATCH] v1.2.0 for MCDR 2.1+ translation logic --- mcdreforged.plugin.json | 5 ++++- simple_op/__init__.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mcdreforged.plugin.json b/mcdreforged.plugin.json index 62c786e..598b981 100644 --- a/mcdreforged.plugin.json +++ b/mcdreforged.plugin.json @@ -1,6 +1,6 @@ { "id": "simple_op", - "version": "1.1.0", + "version": "1.2.0", "name": "Simple OP", "description": { "en_us": "!!op to get op, !!restart to restart the server", @@ -9,6 +9,9 @@ "author": [ "Fallen_Breath" ], + "dependencies": { + "mcdreforged": ">=2.1.0-beta" + }, "link": "https://github.com/MCDReforged/SimpleOP", "resources": [ "lang" diff --git a/simple_op/__init__.py b/simple_op/__init__.py index 606b59d..d02c87e 100644 --- a/simple_op/__init__.py +++ b/simple_op/__init__.py @@ -13,8 +13,8 @@ class Config(Serializable): config = Config.get_default() -def tr(translation_key: str, *args, **kwargs): - return ServerInterface.get_instance().tr('{}.{}'.format(PLUGIN_METADATA.id, translation_key), *args, **kwargs) +def tr(translation_key: str, *args, **kwargs) -> RTextMCDRTranslation: + return ServerInterface.get_instance().rtr('{}.{}'.format(PLUGIN_METADATA.id, translation_key), *args, **kwargs) @new_thread(PLUGIN_METADATA.name + ' - restart')