Add <branding> tag to translations

This commit is contained in:
JeremyStar™ 2024-10-09 10:49:16 +02:00
parent 2eb1d0c1a2
commit 72650600b4
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
5 changed files with 9 additions and 5 deletions

View file

@ -30,6 +30,7 @@ public enum LanguageString {
// Internal stuff // Internal stuff
PREFIX, PREFIX,
PREFIX_NEWLINE, PREFIX_NEWLINE,
TAG_BRANDING,
TAG_GENERIC_OPEN, TAG_GENERIC_OPEN,
TAG_GENERIC_CLOSE, TAG_GENERIC_CLOSE,
TAG_ERROR_OPEN, TAG_ERROR_OPEN,

View file

@ -136,6 +136,7 @@ public final class TranslationManager {
public static void processTranslations() { public static void processTranslations() {
LOGGER.verb("Processing translations"); LOGGER.verb("Processing translations");
String tagBranding = get(LanguageString.TAG_BRANDING, "en");
String tagGenericOpen = get(LanguageString.TAG_GENERIC_OPEN, "en"); String tagGenericOpen = get(LanguageString.TAG_GENERIC_OPEN, "en");
String tagGenericClose = get(LanguageString.TAG_GENERIC_CLOSE, "en"); String tagGenericClose = get(LanguageString.TAG_GENERIC_CLOSE, "en");
String tagErrorOpen = get(LanguageString.TAG_ERROR_OPEN, "en"); String tagErrorOpen = get(LanguageString.TAG_ERROR_OPEN, "en");
@ -152,6 +153,7 @@ public final class TranslationManager {
translations.get(language).put( translations.get(language).put(
languageString, languageString,
translations.get(language).get(languageString) translations.get(language).get(languageString)
.replace("<branding/>", tagBranding)
.replace("<generic>", tagGenericOpen) .replace("<generic>", tagGenericOpen)
.replace("</generic>", tagGenericClose) .replace("</generic>", tagGenericClose)
.replace("<error>", tagErrorOpen) .replace("<error>", tagErrorOpen)

View file

@ -59,7 +59,7 @@ public final class ClearChatCommand extends CommandBase {
* *
* @since v1-release0 * @since v1-release0
*/ */
private static final String NEWLINES = "Seems like clearing the chat does not prevent you from looking at the logs or using mods..." + "\n ".repeat(100); public static final String NEWLINES = "Seems like clearing the chat does not prevent you from looking at the logs or using mods..." + "\n ".repeat(100);
/** /**
* Creates and initializes an instance of * Creates and initializes an instance of

View file

@ -51,9 +51,9 @@ public final class ExtensionCommand extends CommandBase {
* @since v1-release0 * @since v1-release0
*/ */
private final @NotNull TabCompletion completion = new StaticTabCompletion() private final @NotNull TabCompletion completion = new StaticTabCompletion()
.add("psse", 0, "killjvm", "pickshadow.command.extension.advanced")
.add("psse", 0, "license", "pickshadow.command.extension") .add("psse", 0, "license", "pickshadow.command.extension")
.add("psse", 0, "source", "pickshadow.command.extension") .add("psse", 0, "source", "pickshadow.command.extension")
.add("psse", 0, "killjvm", "pickshadow.command.extension.advanced")
.copy("psse", "pickshadow") .copy("psse", "pickshadow")
.copy("psse", "server"); .copy("psse", "server");
@ -86,14 +86,14 @@ public final class ExtensionCommand extends CommandBase {
)); ));
else { else {
switch (arguments[0]) { switch (arguments[0]) {
case "license" -> sender.sendRichMessage(TranslationManager.get(LanguageString.EXTENSIONCMD_LICENSE, sender, true));
case "source" -> sender.sendRichMessage(TranslationManager.get(LanguageString.EXTENSIONCMD_SOURCE, sender, true));
case "killjvm" -> { case "killjvm" -> {
if (checkPermission(sender, "pickshadow.command.extension.advanced")) return; if (checkPermission(sender, "pickshadow.command.extension.advanced")) return;
sender.sendRichMessage(TranslationManager.get(LanguageString.EXTENSIONCMD_KILLJVM, sender, true)); sender.sendRichMessage(TranslationManager.get(LanguageString.EXTENSIONCMD_KILLJVM, sender, true));
Runtime.getRuntime().halt(0); Runtime.getRuntime().halt(0);
} }
case "license" -> sender.sendRichMessage(TranslationManager.get(LanguageString.EXTENSIONCMD_LICENSE, sender, true));
case "source" -> sender.sendRichMessage(TranslationManager.get(LanguageString.EXTENSIONCMD_SOURCE, sender, true));
default -> sender.sendRichMessage(TranslationManager.get(LanguageString.ERROR_INVALID_ARGUMENT, sender, true, entry("argument", arguments[0]))); default -> sender.sendRichMessage(TranslationManager.get(LanguageString.ERROR_INVALID_ARGUMENT, sender, true, entry("argument", arguments[0])));
} }
if (arguments[0].equals("killjvm")) if (arguments[0].equals("killjvm"))

View file

@ -1,6 +1,7 @@
{ {
"PREFIX": "<gradient:#FFFFFF:#A8A8A8>PickShadow</gradient> <#d60532>» </#d60532>", "PREFIX": "<branding/> <#d60532>» </#d60532>",
"PREFIX_NEWLINE": " <#d60532>» </#d60532>", "PREFIX_NEWLINE": " <#d60532>» </#d60532>",
"TAG_BRANDING": "<gradient:#FFFFFF:#A8A8A8>PickShadow</gradient>",
"TAG_GENERIC_OPEN": "<gold>", "TAG_GENERIC_OPEN": "<gold>",
"TAG_GENERIC_CLOSE": "</gold>", "TAG_GENERIC_CLOSE": "</gold>",
"TAG_ERROR_OPEN": "<red>", "TAG_ERROR_OPEN": "<red>",