Skip to content

Commit

Permalink
Get Plugin prefix from lang file
Browse files Browse the repository at this point in the history
  • Loading branch information
FireInstall committed Jun 10, 2024
1 parent bed484b commit b0631e8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Minigames/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<dependency>
<groupId>com.github.seeseemelk</groupId>
<artifactId>MockBukkit-v1.20</artifactId>
<version>3.78.0</version>
<version>3.87.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -88,13 +88,13 @@
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.3.0</version>
<version>8.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.45.2.0</version>
<version>3.46.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -129,7 +129,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.1</version>
<version>2.16.1</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import au.com.mineauz.minigames.Minigames;
import au.com.mineauz.minigames.events.MinigamesBroadcastEvent;
import au.com.mineauz.minigames.managers.language.langkeys.LangKey;
import au.com.mineauz.minigames.managers.language.langkeys.MgMiscLangKey;
import au.com.mineauz.minigames.managers.language.langkeys.MinigameLangKey;
import au.com.mineauz.minigames.minigame.Minigame;
import au.com.mineauz.minigames.objects.MinigamePlayer;
Expand Down Expand Up @@ -349,8 +350,8 @@ public static void sendMessage(@NotNull Audience target, MinigameMessageType typ
target.sendMessage(init.append(message));
}

private static Component getPluginPrefix(MinigameMessageType type) { //todo get from langfile
Component init = Component.text("[Minigames] ");
private static Component getPluginPrefix(MinigameMessageType type) {
Component init = getMessage(BUNDLE_KEY, MgMiscLangKey.PLUGIN_PREFIX).appendSpace();
return switch (type) {
case ERROR, TIE -> init.color(NamedTextColor.RED);
case WARNING -> init.color(NamedTextColor.GOLD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public enum MgMiscLangKey implements MinigameLangKey { //todo this gets rather b
PLAYER_TEAM_ASSIGN_JOINTEAM("player.team.assign.joinTeam"),
PLAYER_TEAM_AUTOBALANCE_MINIGAMEMSG("player.team.autobalance.minigameMsg"),
PLAYER_TEAM_AUTOBALANCE_PLYMSG("player.team.autobalance.plyMsg"),
PLUGIN_PREFIX("minigame.prefix"),
POSITION("position"),
PRESET_INFO_NOINFO("preset.info.noInfo"),
PRESET_LOAD_ERROR_NOTFOUND("preset.load.error.notFound"),
Expand Down
2 changes: 2 additions & 0 deletions Minigames/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ minigame.lateJoin=You will join in <time>...
minigame.lateJoinWait=Please wait <time> and try again.
minigame.lives.error.noLives=The Minigame must have more than 0 lives to use this type.
minigame.lives.livesLeft=Lives left: <number>
# this will be colored by the message type send
minigame.prefix=[Minigames]
minigame.ressourcePack.apply=Custom Server Resource Pack has been sent to your client.
minigame.ressourcePack.declined=You can't play this minigame without this ressource pack!
minigame.ressourcePack.empty.name=empty
Expand Down
2 changes: 2 additions & 0 deletions Minigames/src/main/resources/messages_en_AU.properties
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,8 @@ minigame.lateJoin=You will join in <time> seconds...
minigame.lateJoinWait=Please wait <time> seconds and try again.
minigame.lives.error.noLives=The Minigame must have more than 0 lives to use this type.
minigame.lives.livesLeft=Lives left: <number>
# this will be colored by the message type send
minigame.prefix=[Minigames]
minigame.ressourcePack.apply=Custom Server Resource Pack has been sent to your client.
minigame.ressourcePack.declined=You can't play this minigame without this ressource pack!
minigame.ressourcePack.empty.name=empty
Expand Down
2 changes: 2 additions & 0 deletions Minigames/src/main/resources/messages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,8 @@ minigame.lateJoin=You will join in <time> seconds...
minigame.lateJoinWait=Please wait <time> seconds and try again.
minigame.lives.error.noLives=The Minigame must have more than 0 lives to use this type.
minigame.lives.livesLeft=Lives left: <number>
# this will be colored by the message type send
minigame.prefix=[Minigames]
minigame.ressourcePack.apply=Custom Server Resource Pack has been sent to your client.
minigame.ressourcePack.declined=You can't play this minigame without this ressource pack!
minigame.ressourcePack.empty.name=empty
Expand Down
2 changes: 2 additions & 0 deletions Minigames/src/main/resources/messages_fr_FR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ minigame.join.error.notEnoughMoney=Vous n'avez pas assez d'argent pour rejoindre
minigame.lateJoin=Vous rejoindrez ce mini-jeu dans %s secondse...
minigame.lateJoinWait=Merci d'attendre %s secondes puis réessayez.
minigame.lives.livesLeft=Vies restantes : %s
# this will be colored by the message type send
minigame.prefix=[Minigames]
minigame.resourcepack.command.description=Commandes qui permettent de gérer les pack de ressources personnalisé
minigame.resourcepack.command.remove=Le pack de ressources personnalisé a été supprimé
minigame.resourcepack.declined=Vous avez refusé le pack de ressources personnalisé nécessaire à ce mini-jeu
Expand Down

0 comments on commit b0631e8

Please sign in to comment.