aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-08-26 02:46:10 +0200
committerGitHub <noreply@github.com>2024-08-26 02:46:10 +0200
commita658f0f272c25d50ce3c572c388e07895735bd48 (patch)
treeb5bb0e3a8891e5cffe31d60ff3978a7653c99df8 /src/main/java/at/hannibal2/skyhanni/config/features
parent290676ba3954d653bc1cbc0630d2cde90a3249f4 (diff)
downloadskyhanni-a658f0f272c25d50ce3c572c388e07895735bd48.tar.gz
skyhanni-a658f0f272c25d50ce3c572c388e07895735bd48.tar.bz2
skyhanni-a658f0f272c25d50ce3c572c388e07895735bd48.zip
Improvement: Multiple Languages (#2403)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/chat/TranslatorConfig.java37
2 files changed, 40 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java
index f9e64f1e0..6a1d129a2 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java
@@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.config.features.chat;
import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
+import io.github.notenoughupdates.moulconfig.annotations.Category;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorKeybind;
@@ -104,16 +105,9 @@ public class ChatConfig {
@FeatureToggle
public boolean hideSacksChange = false;
+ @Category(name = "Translator", desc = "Chat translator settings.")
@Expose
- @ConfigOption(
- name = "Translator",
- desc = "Click on a message to translate it to English.\n" +
- "Use §e/shcopytranslation§7 to translate from English.\n" +
- "§cTranslation is not guaranteed to be 100% accurate."
- )
- @ConfigEditorBoolean
- @FeatureToggle
- public boolean translator = false;
+ public TranslatorConfig translator = new TranslatorConfig();
@Expose
@ConfigOption(name = "SkyBlock XP in Chat", desc = "Send the SkyBlock XP messages into the chat.")
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chat/TranslatorConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chat/TranslatorConfig.java
new file mode 100644
index 000000000..648afbd87
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/chat/TranslatorConfig.java
@@ -0,0 +1,37 @@
+package at.hannibal2.skyhanni.config.features.chat;
+
+import at.hannibal2.skyhanni.config.FeatureToggle;
+import at.hannibal2.skyhanni.features.chat.translation.TranslatableLanguage;
+import com.google.gson.annotations.Expose;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
+import io.github.notenoughupdates.moulconfig.observer.Property;
+
+public class TranslatorConfig {
+
+ @Expose
+ @ConfigOption(
+ name = "Translate On Click",
+ desc = "Click on a message to translate it to English.\n" +
+ "Use §e/shcopytranslation§7 to translate from English.\n" +
+ "§cTranslation is not guaranteed to be 100% accurate."
+ )
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean translateOnClick = false;
+
+ @ConfigOption(name = "Language Name", desc = "The name of the language selected below. Note that languages marked as unknown might still be supported.")
+ @Expose
+ @ConfigEditorDropdown
+ public Property<TranslatableLanguage> languageName = Property.of(TranslatableLanguage.ENGLISH);
+
+ @Expose
+ @ConfigOption(
+ name = "Language Code",
+ desc = "Enter a language code here to translate on chat click into another language. " +
+ "E.g. `es` for spanish or 'de' for german. Empty for english.")
+ @ConfigEditorText
+ public Property<String> languageCode = Property.of("en");
+}