fix %-n$s
This commit is contained in:
parent
e616214c72
commit
2e1de26f34
1 changed files with 5 additions and 5 deletions
|
@ -235,8 +235,8 @@ function parseMinecraftMessage(component) {
|
|||
return "%s";
|
||||
});
|
||||
|
||||
translateString = translateString.replace(/%(\d+)\$s/g, (match, index, stringindex, string) => {
|
||||
const argIndex = parseInt(index) - 1;
|
||||
translateString = translateString.replace(/%(-?\d+)\$s/g, (match, index, stringindex, string) => {
|
||||
const argIndex = index - 1;
|
||||
|
||||
if (argIndex < 0 || argIndex >= withArgs.length) {
|
||||
DefaultMsg = true;
|
||||
|
@ -320,7 +320,7 @@ function parseMinecraftMessageNoColor(component) {
|
|||
});
|
||||
|
||||
translateString = translateString.replace(/%(\d+)\$s/g, (match, index, stringindex, string) => {
|
||||
const argIndex = parseInt(index) - 1;
|
||||
const argIndex = index - 1;
|
||||
|
||||
if (argIndex < 0 || argIndex >= withArgs.length) {
|
||||
DefaultMsg = true;
|
||||
|
|
Loading…
Reference in a new issue