Skip to content

Commit

Permalink
Change language string to player
Browse files Browse the repository at this point in the history
  • Loading branch information
KeksDev @ PyCMC committed Aug 28, 2024
1 parent a89b4b4 commit 1b9500c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public CommandDataVersions generateCustomCommandData(Player player) {
customData.aliases = new CommandEnum(this.name + "Aliases", aliases);
}

String tra = CustomTranslationManager.translate(player.getLanguageCode().name(), this.description);
String tra = CustomTranslationManager.translate(player, this.description);
if(Objects.equals(tra, this.description)) {
if (plugin == InternalPlugin.INSTANCE) {
customData.description = player.getServer().getLanguage().tr(this.getDescription(), CommandOutputContainer.EMPTY_STRING, "commands.", false);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pycmc/pnxcustom/CustomTranslationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public static String translate(String lang, String key, String... params) {
return key;
}

/*
public static String translate(Player p, String key) {
if (providers == null) {
return key;
Expand All @@ -74,5 +73,5 @@ public static String translate(Player p, String key, String... params) {
}
}
return key;
}*/
}
}
4 changes: 2 additions & 2 deletions src/main/java/pycmc/pnxcustom/TranslationProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public abstract class TranslationProvider {
public abstract String translate(String lang, String key);
public abstract String translate(String lang, String key, String... params);

//public abstract String translate(Player p, String key);
//public abstract String translate(Player p, String key, String... params);
public abstract String translate(Player p, String key);
public abstract String translate(Player p, String key, String... params);
}

0 comments on commit 1b9500c

Please sign in to comment.