diff options
author | Linnea Gräf <nea@nea.moe> | 2024-10-30 18:34:52 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-10-30 18:41:15 +0100 |
commit | b11b12585d3e4dfd67f73beebf7cf950799f087c (patch) | |
tree | 5b695f0c03b5e66c65d28092192031cab5f910fb /src/main/kotlin | |
parent | c9c25b61560e6fb4e1ba2dfb1d5cc61b0ec9ddab (diff) | |
download | Firmament-b11b12585d3e4dfd67f73beebf7cf950799f087c.tar.gz Firmament-b11b12585d3e4dfd67f73beebf7cf950799f087c.tar.bz2 Firmament-b11b12585d3e4dfd67f73beebf7cf950799f087c.zip |
Add mc auto translations
[no changelog]
Diffstat (limited to 'src/main/kotlin')
-rw-r--r-- | src/main/kotlin/commands/rome.kt | 12 | ||||
-rw-r--r-- | src/main/kotlin/util/textutil.kt | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/main/kotlin/commands/rome.kt b/src/main/kotlin/commands/rome.kt index 8fcbd77..39053d2 100644 --- a/src/main/kotlin/commands/rome.kt +++ b/src/main/kotlin/commands/rome.kt @@ -31,6 +31,7 @@ import moe.nea.firmament.util.accessors.messages import moe.nea.firmament.util.collections.InstanceList import moe.nea.firmament.util.collections.WeakCache import moe.nea.firmament.util.mc.SNbtFormatter +import moe.nea.firmament.util.tr import moe.nea.firmament.util.unformattedString @@ -262,15 +263,16 @@ fun firmamentCommand() = literal("firmament") { } thenLiteral("events") { thenExecute { - source.sendFeedback(Text.translatable("firmament.event.start")) + source.sendFeedback(tr("firmament.event.start", "Event Bus Readout:")) FirmamentEventBus.allEventBuses.forEach { eventBus -> - source.sendFeedback(Text.translatable( + val prefixName = eventBus.eventType.typeName.removePrefix("moe.nea.firmament") + source.sendFeedback(tr( "firmament.event.bustype", - eventBus.eventType.typeName.removePrefix("moe.nea.firmament"))) + "- $prefixName:")) eventBus.handlers.forEach { handler -> - source.sendFeedback(Text.translatable( + source.sendFeedback(tr( "firmament.event.handler", - handler.label)) + " * ${handler.label}")) } } } diff --git a/src/main/kotlin/util/textutil.kt b/src/main/kotlin/util/textutil.kt index a6a7e87..3687743 100644 --- a/src/main/kotlin/util/textutil.kt +++ b/src/main/kotlin/util/textutil.kt @@ -164,3 +164,7 @@ fun Text.transformEachRecursively(function: (Text) -> Text): Text { } } } + +fun tr(key: String, default: String): Text = error("Compiler plugin did not run.") +fun trResolved(key: String, vararg args: Any) = Text.translatable(key, *args) + |