diff --git a/src/main/java/net/knarcraft/knarlib/formatting/StringFormatter.java b/src/main/java/net/knarcraft/knarlib/formatting/StringFormatter.java index bcebca9..89eec2d 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/StringFormatter.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/StringFormatter.java @@ -148,6 +148,27 @@ public final class StringFormatter { } } + /** + * Gets the raw, unformatted translation of the given translatable message + * + * @param translatableMessage

The message to get the translation of

+ * @return

The raw translation

+ */ + 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

The message to get the colored translation of

+ * @return

The colored raw translation

+ */ + public @NotNull String getUnformattedColoredMessage(@NotNull TranslatableMessage translatableMessage) { + return ColorHelper.translateColorCodes(this.translator.getTranslatedMessage(translatableMessage), + this.colorConversion); + } + /** * Replaces a placeholder in a translatable message *