Adds methods for getting raw messages from the string formatter
All checks were successful
KnarCraft/KnarLib/pipeline/head This commit looks good

This commit is contained in:
Kristian Knarvik 2024-01-25 15:21:01 +01:00
parent 7dc0315469
commit 17fd61e8b9

View File

@ -148,6 +148,27 @@ public final class StringFormatter {
} }
} }
/**
* Gets the raw, unformatted translation of the given translatable message
*
* @param translatableMessage <p>The message to get the translation of</p>
* @return <p>The raw translation</p>
*/
public @NotNull String getUnformattedMessage(@NotNull TranslatableMessage translatableMessage) {
return this.translator.getTranslatedMessage(translatableMessage);
}
/**
* Gets the unformatted translation of the given translatable message, with translated color codes
*
* @param translatableMessage <p>The message to get the colored translation of</p>
* @return <p>The colored raw translation</p>
*/
public @NotNull String getUnformattedColoredMessage(@NotNull TranslatableMessage translatableMessage) {
return ColorHelper.translateColorCodes(this.translator.getTranslatedMessage(translatableMessage),
this.colorConversion);
}
/** /**
* Replaces a placeholder in a translatable message * Replaces a placeholder in a translatable message
* *