Skip to content

Commit 5e0abfa

Browse files
committed
add lang
1 parent d9724ef commit 5e0abfa

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

lang/en_us.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
seed:
2+
help_msg: Get world seed quickly!
3+
get_seed: 'Seed:'
4+
copy_to_clipboard: Click to copy to clipboard

lang/zh_cn.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
seed:
2+
help_msg: 更快速的获取服务器种子!
3+
get_seed: 服务器种子:
4+
copy_to_clipboard: 点击复制到剪贴板

mcdreforged.plugin.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
99
"link": "https://github.com/OptiJava/Seed",
1010
"dependencies": {
1111
"mcdreforged": ">=2.2.0"
12-
}
12+
},
13+
14+
"archive_name": "seed-v{version}",
15+
"resources": [
16+
"lang",
17+
"LICENSE"
18+
]
1319
}

seed/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def on_load(server: ServerInterface, old_module):
99
global server_inst
1010
server_inst = server
1111
server.register_command(Literal('!!seed').runs(run))
12-
server.register_help_message('!!seed', 'get world seed')
12+
server.register_help_message('!!seed', server.tr('seed.help_msg'))
1313

1414

1515
def run():
@@ -24,5 +24,5 @@ def on_info(server: ServerInterface, info: Info):
2424
if info.content.startswith('Seed: [') and get_seed:
2525
seed = info.content.split('[')[1].split(']')[0]
2626
server.execute(
27-
'tellraw @a [{"text":"服务器种子: [","color":"yellow"},{"text":"' + seed + '","color":"green","insertion":"' + seed + '","clickEvent":{"action":"copy_to_clipboard","value":"'+ seed + '"},"hoverEvent":{"action":"show_text","value":"点击复制到剪贴板"}},{"text":"]","color":"yellow"}]')
27+
'tellraw @a [{"text":"' + server_inst.tr('seed.get_seed') + ' [","color":"yellow"},{"text":"' + seed + '","color":"green","insertion":"' + seed + '","clickEvent":{"action":"copy_to_clipboard","value":"'+ seed + '"},"hoverEvent":{"action":"show_text","value":"' + server_inst.tr('seed.copy_to_clipboard') + '"}},{"text":"]","color":"yellow"}]')
2828
get_seed = False

0 commit comments

Comments
 (0)