Skip to content

Commit ad9e6e6

Browse files
committed
Update locales, commands
1 parent 619915c commit ad9e6e6

File tree

5 files changed

+72
-15
lines changed

5 files changed

+72
-15
lines changed

bukkit/src/main/java/io/github/rothes/protocolstringreplacer/command/CommandHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import io.github.rothes.protocolstringreplacer.PsrLocalization;
44
import io.github.rothes.protocolstringreplacer.ProtocolStringReplacer;
55
import io.github.rothes.protocolstringreplacer.api.user.PsrUser;
6+
import io.github.rothes.protocolstringreplacer.command.subcommands.About;
67
import io.github.rothes.protocolstringreplacer.util.ArgUtils;
78
import io.github.rothes.protocolstringreplacer.command.subcommands.Capture;
89
import io.github.rothes.protocolstringreplacer.command.subcommands.Edit;
@@ -30,9 +31,10 @@ public void initialize() {
3031
plugin.getCommand("ProtocolStringReplacer").setExecutor(this);
3132
plugin.getCommand("ProtocolStringReplacer").setTabCompleter(this);
3233

34+
subCommands.add(new Capture());
3335
subCommands.add(new Edit());
3436
subCommands.add(new Parse());
35-
subCommands.add(new Capture());
37+
subCommands.add(new About());
3638
subCommands.add(new Reload());
3739
}
3840

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package io.github.rothes.protocolstringreplacer.command.subcommands
2+
3+
import io.github.rothes.protocolstringreplacer.PsrLocalization
4+
import io.github.rothes.protocolstringreplacer.api.user.PsrUser
5+
import io.github.rothes.protocolstringreplacer.command.SubCommand
6+
import io.github.rothes.protocolstringreplacer.plugin
7+
8+
class About: SubCommand("about", "protocolstringreplacer.command.about", PsrLocalization.getLocaledMessage("Sender.Commands.About.Description")) {
9+
10+
override fun onExecute(user: PsrUser, args: Array<out String>) {
11+
user.msg("Header")
12+
user.msg("Plugin")
13+
user.msg("Version", plugin.description.version)
14+
user.msg("Author", "Rothes")
15+
user.msg("Donate", "https://ko-fi.com/rothes")
16+
user.msg("GitHub", "https://github.com/Rothes/ProtocolStringReplacer")
17+
user.msg("To-Say")
18+
user.msg("Footer")
19+
}
20+
21+
override fun onTab(user: PsrUser, args: Array<out String>): MutableList<String> {
22+
return mutableListOf()
23+
}
24+
25+
override fun sendHelp(user: PsrUser) {
26+
}
27+
28+
private fun PsrUser.msg(key: String, append: String = "", vararg rep: String) {
29+
this.sendFilteredText(PsrLocalization.getLocaledMessage("Sender.Commands.About.$key", *rep) + append)
30+
}
31+
32+
}

bukkit/src/main/resources/Languages/en-US/Locales/Locale.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Console-Sender:
1414
Backing-Up-Configs: '&aBacking up configurations to folder: %0%'
1515
Upgrading-Configs: '&aUpgrading configurations version: %0% -> %1%'
1616
Replacer-Config:
17-
Pre-Loaded-Replacers: '&aPre-loaded %0% replacer config(s). &8Took %1%ms'
17+
Pre-Loaded-Replacers: '&aFound %0% replacer config(s). &8Took %1%ms'
1818
Replacer-Load-Complete: '&aSuccessfully loaded replacer config: %0%. &8Took %1%ms'
1919
Replacer-Failed-To-Load: '&cFailed to load replacer config %0% . Please fix the problem with the trace stack.'
2020
Replacer-Regex-Exception: '&cFailed to load replacer config %0% , because there''s a regex syntax error in it:'
@@ -52,14 +52,14 @@ Sender:
5252
Subcommand-Help-Format: '&7 * &e%0% &7- &b%1%'
5353
Help:
5454
Header: '&7&m------&7&l &7[ &c&lProtocol&6&lString&3&lReplacer&7 ]&l &7&m------'
55-
Footer: '&7&m-----------------------------------------'
55+
Footer: '&7&m----------------------------------------'
5656
Confirm:
5757
Expired: '&cOperation confirm has timed out. Please execute again.'
5858
Nothing-To-Confirm: '&cYou have no pending operations to confirm.'
5959
Capture:
6060
Description: 'Capture contents in a packet'
6161
Help:
62-
Header: '&7&m------------&7&l &7[ &c&lP&6&lS&3&lR &7- &eCapture Tool&7 ]&l &7&m------------'
62+
Header: '&7&m-------------&7&l &7[ &c&lP&6&lS&3&lR &7- &eCapture Tool&7 ]&l &7&m-------------'
6363
Footer: '&7&m-----------------------------------------------'
6464
Add-Capture-Tip: '&cExecute &e/psr capture add %0% &cto enable capture.'
6565
Remove-Capture-Tip: '&cExecute &e/psr capture remove %0% &cto disable capture.'
@@ -80,11 +80,11 @@ Sender:
8080
List:
8181
Simple-Help: '&7 * &e/psr capture list &7- &bList captured contents'
8282
Detailed-Help: '&7 * &e/psr capture list <Listen type> [page] &7- &bList captured contents'
83-
Results-Header: '&7&m---------&7&l &7[ &c&lP&6&lS&3&lR &7- &eCaptured list&7 ]&l &7&m---------'
84-
Results-Footer: '&7&m------------------------------------------'
83+
Results-Header: '&7&m-------&7&l &7[ &c&lP&6&lS&3&lR &7- &eCaptured list&7 ]&l &7&m-------'
84+
Results-Footer: '&7&m-----------------------------------'
8585
Not-Capturing-Listen-Type: '&cYou are not capturing &f%0% &c.'
8686
Capture-Info:
87-
Captured-Contents: '&3&l&m----------------------&3&l Captured Contents &m----------------------'
87+
Captured-Contents: '&3&l&m----------------&3&l Captured Contents &m----------------'
8888
Click-For-Clipboard: '&aClick for clipboard'
8989
Click-To-Copy: '&aClick to copy'
9090
Click-Any-Entry-To-Copy: '&aClick any entry to copy'
@@ -93,7 +93,7 @@ Sender:
9393
Description: 'Replacers editor'
9494
Help:
9595
Header: '&7&m------------&7&l &7[ &c&lP&6&lS&3&lR &7- &eEditor&7 ]&l &7&m------------'
96-
Footer: '&7&m-----------------------------------------'
96+
Footer: '&7&m----------------------------------------'
9797
Children:
9898
File:
9999
Description: 'Replacer files commands'
@@ -228,6 +228,16 @@ Sender:
228228
Tab-Complete:
229229
String-To-Parse: '<String to parse>'
230230
PAPI-Target: '<PAPI target>'
231+
About:
232+
Description: 'About plugin'
233+
Header: '&7&m-------------&7&l &7[ &c&lP&6&lS&3&lR &7- &eAbout&7 ]&l &7&m-------------'
234+
Plugin: ' &c&lProtocol&6&lString&3&lReplacer &bis...'
235+
Version: ' &3Version&7: &b'
236+
Author: ' &3Author&7: &b'
237+
Donate: ' &3Donate&7: &b'
238+
GitHub: ' &3GitHub&7: &b'
239+
To-Say: ' &aPlease leave a &e⭐Star &afor our free plugin!'
240+
Footer: '&7&m-----------------------------------------'
231241
Reload:
232242
Description: 'Reload configs'
233243
Already-Reloading: '&cPlugin is already reloading. Please reload later.'

bukkit/src/main/resources/Languages/zh-CN/Locales/Locale.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Console-Sender:
1414
Backing-Up-Configs: '&a正在备份配置文件到文件夹: %0%'
1515
Upgrading-Configs: '&a正在升级配置文件版本 %0% -> %1%'
1616
Replacer-Config:
17-
Pre-Loaded-Replacers: '&a预加载 %0% 个替换配置文件. &8耗时 %1%ms'
17+
Pre-Loaded-Replacers: '&a发现 %0% 个替换配置文件. &8耗时 %1%ms'
1818
Replacer-Load-Complete: '&a成功载入替换配置: %0%. &8耗时 %1%ms'
1919
Replacer-Failed-To-Load: '&c无法载入配置文件 %0% , 请通过下面的报错堆栈检查错误.'
2020
Replacer-Regex-Exception: '&c无法载入配置文件 %0% , 因为正则表达式有问题:'
@@ -52,14 +52,14 @@ Sender:
5252
Subcommand-Help-Format: '&7 * &e%0% &7- &b%1%'
5353
Help:
5454
Header: '&7&m------&7&l &7[ &c&lProtocol&6&lString&3&lReplacer&7 ]&l &7&m------'
55-
Footer: '&7&m-----------------------------------------'
55+
Footer: '&7&m----------------------------------------'
5656
Confirm:
5757
Expired: '&c确认操作已超时. 请重新执行.'
5858
Nothing-To-Confirm: '&c您没有待确认的操作.'
5959
Capture:
6060
Description: '捕获数据包的文本内容'
6161
Help:
62-
Header: '&7&m-----------&7&l &7[ &c&lP&6&lS&3&lR &7- &e捕获工具&7 ]&l &7&m-----------'
62+
Header: '&7&m-------------&7&l &7[ &c&lP&6&lS&3&lR &7- &e捕获工具&7 ]&l &7&m-------------'
6363
Footer: '&7&m-------------------------------------------'
6464
Add-Capture-Tip: '&c使用指令 &e/psr capture add %0% &c即可开启捕获.'
6565
Remove-Capture-Tip: '&c使用指令 &e/psr capture remove %0% &c即可取消捕获.'
@@ -81,7 +81,7 @@ Sender:
8181
Simple-Help: '&7 * &e/psr capture list &7- &b列出捕获的文本信息'
8282
Detailed-Help: '&7 * &e/psr capture list <监听类型> [页码] &7- &b列出捕获的文本信息'
8383
Results-Header: '&7&m---------&7&l &7[ &c&lP&6&lS&3&lR &7- &e捕获列表&7 ]&l &7&m---------'
84-
Results-Footer: '&7&m---------------------------------------'
84+
Results-Footer: '&7&m-----------------------------------'
8585
Not-Capturing-Listen-Type: '&c您未在捕获 &f%0% &c.'
8686
Capture-Info:
8787
Captured-Contents: '&3&l&m----------------------&3&l 捕获内容 &m----------------------'
@@ -92,14 +92,14 @@ Sender:
9292
Edit:
9393
Description: '替换配置编辑器'
9494
Help:
95-
Header: '&7&m-----------&7&l &7[ &c&lP&6&lS&3&lR &7- &e编辑器&7 ]&l &7&m-----------'
95+
Header: '&7&m-------------&7&l &7[ &c&lP&6&lS&3&lR &7- &e编辑器&7 ]&l &7&m-------------'
9696
Footer: '&7&m-----------------------------------------'
9797
Children:
9898
File:
9999
Description: '替换配置文件相关指令'
100100
Help:
101101
Header: '&7&m-----------&7&l &7[ &c&lP&6&lS&3&lR &7- &e文件编辑器&7 ]&l &7&m-----------'
102-
Footer: '&7&m---------------------------------------------'
102+
Footer: '&7&m----------------------------------------'
103103
Children:
104104
Cannot-Find-Replacer-Config: '&c找不到此替换配置文件: &f%0%'
105105
List:
@@ -118,7 +118,7 @@ Sender:
118118
Enabled: '&a启用'
119119
Not-Enabled: '&c禁用'
120120
Not-Configured: '&7未定义'
121-
Footer: '&7&m-----------------------------------------------'
121+
Footer: '&7&m------------------------------------------'
122122
Select:
123123
Simple-Help: '&7 * &e/psr edit file select &7- &b选定一个替换配置文件'
124124
Detailed-Help: '&7 * &e/psr file select <替换配置文件|索引> &7- &b选定编辑的替换配置'
@@ -228,6 +228,16 @@ Sender:
228228
Tab-Complete:
229229
String-To-Parse: '<要测试的字符串>'
230230
PAPI-Target: '<占位符目标玩家>'
231+
About:
232+
Description: '关于插件'
233+
Header: '&7&m--------------&7&l &7[ &c&lP&6&lS&3&lR &7- &e关于&7 ]&l &7&m--------------'
234+
Plugin: ' &c&lProtocol&6&lString&3&lReplacer &b是...'
235+
Version: ' &3版本&7: &b'
236+
Author: ' &3作者&7: &b'
237+
Donate: ' &3捐赠&7: &b'
238+
GitHub: ' &3源代码&7: &b'
239+
To-Say: ' &a请给我们的自由软件留下一个 &e⭐Star &a!'
240+
Footer: '&7&m------------------------------------------'
231241
Reload:
232242
Description: '重载插件配置文件'
233243
Already-Reloading: '&c插件已经在重载过程中. 请稍后再重载.'

bukkit/src/main/resources/plugin.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ commands:
1212
aliases: [psr]
1313
description: ProtocolStringReplacer commands.
1414
permissions:
15+
protocolstringreplacer.command.about:
16+
description: See plugin info.
17+
default: true
1518
protocolstringreplacer.command.capture:
1619
description: allow you to capture the packet contents.
1720
default: op

0 commit comments

Comments
 (0)