MessageEditor Handle funktion

This commit is contained in:
GregTCLTK 2019-12-10 17:40:19 +01:00
parent 48a5c5a075
commit 12f1cdfdcb
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67

View file

@ -4,6 +4,8 @@ import net.dv8tion.jda.api.EmbedBuilder;
import java.awt.*;
import java.time.Instant;
import java.util.Locale;
import java.util.ResourceBundle;
public class MessageEditor {
@ -59,4 +61,9 @@ public class MessageEditor {
NO_PERMISSION,
NO_SELF_PERMISSION
}
public static String handle(String language_code, String string) {
Locale locale = new Locale(language_code);
return ResourceBundle.getBundle("Translations", locale).getString(string).replaceAll("%prefix%", "h.");
}
}