Language sync

- Branch-tracking language source on Bukkit and modded
- 57 unused keys removed, translations corrected
- Consolidated saved-pack field warning
This commit is contained in:
SwiftSwamp committed 2026-11-02 09:39:04 -07:00
1 parent 8b99f0b75f
commit 7efd51de3e
40 files changed
+13578 -14082

No files matched your search

@@ -189,6 +189,7 @@ public final class ModdedEngineBootstrap {
}
ModdedWorldCheck.serverStarted(server);
ModdedWorldgenCatalogs.capture(server);
IrisLanguage.checkUpstream();
}
public static void levelLoaded(NativeWorld world) {
@@ -3,14 +3,19 @@ package art.arcane.iris.modded.command;
import art.arcane.iris.localization.IrisLanguage;
import art.arcane.iris.spi.IrisLogging;
import art.arcane.volmlib.util.director.help.DirectorHelpMessages;
import art.arcane.volmlib.util.localization.BukkitLanguageMessages;
import art.arcane.volmlib.util.localization.LanguageCatalogMerge;
import art.arcane.volmlib.util.localization.LanguageUpstreamSync;
import art.arcane.volmlib.util.localization.MessageArgument;
import art.arcane.volmlib.util.localization.PluginLanguageService;
import art.arcane.volmlib.util.localization.VolmitLocales;
import art.arcane.volmlib.util.localization.TextKey;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import art.arcane.volmlib.nativelib.minecraft26_2.modded.NativeCommandSource;
import art.arcane.volmlib.nativelib.minecraft26_2.modded.NativeCommandRegistration;
import art.arcane.volmlib.nativelib.minecraft26_2.modded.NativeCommandText;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
@@ -22,7 +27,9 @@ final class ModdedLanguageCommands {
return NativeCommandRegistration.literal("language")
.executes(ModdedCommandTree.localized(context -> open(context.getSource())))
.then(scope("self", false))
.then(scope("server", true).requires(NativeCommandRegistration.GAMEMASTERS));
.then(scope("server", true).requires(NativeCommandRegistration.GAMEMASTERS))
.then(NativeCommandRegistration.literal("update").requires(NativeCommandRegistration.GAMEMASTERS)
.executes(ModdedCommandTree.localized(context -> update(context.getSource()))));
}
private static LiteralArgumentBuilder<NativeCommandSource> scope(String name, boolean server) {
@@ -40,7 +47,7 @@ final class ModdedLanguageCommands {
ModdedCommandFeedback.send(source, ModdedCommandFeedback.text(
"Iris language: " + IrisLanguage.activeLocale(), ModdedCommandFeedback.DESCRIPTION));
for (String locale : IrisLanguage.availableLocales()) {
String name = VolmitLocales.displayName(locale).orElse(locale);
String name = IrisLanguage.displayName(locale);
ModdedCommandFeedback.send(source, ModdedCommandFeedback.text("⇀ ", ModdedCommandFeedback.DARK_GREEN)
.append(ModdedCommandFeedback.button(name + " [me]", "/iris language self " + locale, "Use " + name, true))
.append(ModdedCommandTree.isGamemaster(source)
@@ -53,6 +60,56 @@ final class ModdedLanguageCommands {
return 1;
}
private static int update(NativeCommandSource source) {
source.sendSuccess(() -> NativeCommandText.literal(updateMessage(BukkitLanguageMessages.UPDATE_CHECKING)), false);
IrisLanguage.checkUpstream().whenComplete((report, failure) -> source.execute(() -> reportUpdate(source, report, failure)));
return 1;
}
private static void reportUpdate(NativeCommandSource source, LanguageUpstreamSync.SyncReport report, Throwable failure) {
if (failure != null || report == null) {
if (failure != null) {
IrisLogging.reportError(failure);
}
source.sendFailure(NativeCommandText.literal(updateMessage(BukkitLanguageMessages.UPDATE_FAILED,
MessageArgument.untrusted("reason", failure == null ? "no report" : String.valueOf(failure.getMessage())))));
return;
}
if (report.failure().isPresent()) {
source.sendFailure(NativeCommandText.literal(updateMessage(BukkitLanguageMessages.UPDATE_FAILED,
MessageArgument.untrusted("reason", report.failure().get()))));
return;
}
if (report.coolingDown()) {
source.sendSuccess(() -> NativeCommandText.literal(updateMessage(BukkitLanguageMessages.UPDATE_COOLDOWN,
MessageArgument.untrusted("remaining", report.cooldownRemaining()))), false);
return;
}
for (String locale : report.changedLocales()) {
LanguageCatalogMerge.MergeResult result = report.merged().get(locale);
source.sendSuccess(() -> NativeCommandText.literal(updateMessage(BukkitLanguageMessages.UPDATE_APPLIED,
MessageArgument.untrusted("locale", locale),
MessageArgument.untrusted("added", String.valueOf(result.added().size())),
MessageArgument.untrusted("updated", String.valueOf(result.updated().size() + result.removed().size())),
MessageArgument.untrusted("kept", String.valueOf(result.kept().size())))), false);
}
for (Map.Entry<String, String> entry : report.failures().entrySet()) {
source.sendFailure(NativeCommandText.literal(updateMessage(BukkitLanguageMessages.UPDATE_LOCALE_FAILED,
MessageArgument.untrusted("locale", entry.getKey()),
MessageArgument.untrusted("reason", entry.getValue()))));
}
if (report.changedLocales().isEmpty() && report.failures().isEmpty()) {
source.sendSuccess(() -> NativeCommandText.literal(updateMessage(BukkitLanguageMessages.UPDATE_UNCHANGED)), false);
}
}
private static String updateMessage(TextKey key, MessageArgument... arguments) {
MessageArgument[] resolved = new MessageArgument[arguments.length + 1];
resolved[0] = MessageArgument.untrusted("plugin", "Iris");
System.arraycopy(arguments, 0, resolved, 1, arguments.length);
return IrisLanguage.plain(key, resolved);
}
private static int select(NativeCommandSource source, boolean server, String locale) {
PluginLanguageService service = IrisLanguage.selections();
if (service == null) {
@@ -67,7 +67,6 @@ public final class ClientUiMessages {
);
public static final TextKey TOAST_RELOAD_FAILED = TextKey.of("iris.client.toast.reload_failed", "reload failed");
public static final TextKey TOAST_RELOADED = TextKey.of("iris.client.toast.reloaded", "reloaded");
public static final TextKey TOAST_PACK_FAILED = TextKey.of("iris.client.toast.pack_failed", "{pack} failed");
public static final TextKey WHAT_TITLE = TextKey.of("iris.client.what.title", "Iris What");
public static final TextKey WHAT_QUERYING = TextKey.of("iris.client.what.querying", "Querying {x}, {z}...");
public static final TextKey WHAT_BIOME = TextKey.of("iris.client.what.biome", "Biome: {biome}");
@@ -100,7 +99,6 @@ public final class ClientUiMessages {
TOAST_CHANGED_FILES,
TOAST_RELOAD_FAILED,
TOAST_RELOADED,
TOAST_PACK_FAILED,
WHAT_TITLE,
WHAT_QUERYING,
WHAT_BIOME,
@@ -103,10 +103,6 @@ public final class ModdedCommandMessages {
"iris.modded.irismoddedcommands.set_debug",
"Set debug to: " + "{to}"
);
public static final TextKey IRIS_MODDED_COMMANDS_HOTLOADED_SETTINGS = TextKey.of(
"iris.modded.irismoddedcommands.hotloaded_settings",
"Hotloaded settings"
);
public static final TextKey IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_IT_INSPECTS = TextKey.of(
"iris.modded.irismoddedcommands.this_command_can_only_be_used_by_players_it_inspects",
"This command can only be used by players (it inspects your held item)."
@@ -115,10 +111,6 @@ public final class ModdedCommandMessages {
"iris.modded.irismoddedcommands.your_main_hand_is_empty",
"Your main hand is empty."
);
public static final TextKey IRIS_MODDED_COMMANDS_HAND_X = TextKey.of(
"iris.modded.irismoddedcommands.hand_x",
"Hand: " + "{value}" + " x" + "{value2}"
);
public static final TextKey IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS = TextKey.of(
"iris.modded.irismoddedcommands.this_command_can_only_be_used_by_players",
"This command can only be used by players."
@@ -179,18 +171,10 @@ public final class ModdedCommandMessages {
"iris.modded.irismoddedcommands.this_dimension_is_not_generated_by_iris_6",
"This dimension is not generated by Iris."
);
public static final TextKey IRIS_MODDED_COMMANDS_BIOME = TextKey.of(
"iris.modded.irismoddedcommands.biome",
"Biome: " + "{value}" + " (" + "{value2}" + ")"
);
public static final TextKey IRIS_MODDED_COMMANDS_BIOME_LOOKUP_FAILED_2 = TextKey.of(
"iris.modded.irismoddedcommands.biome_lookup_failed_2",
"Biome lookup failed: " + "{value}"
);
public static final TextKey IRIS_MODDED_COMMANDS_REGION = TextKey.of(
"iris.modded.irismoddedcommands.region",
"Region: " + "{value}" + " (" + "{value2}" + ")"
);
public static final TextKey IRIS_MODDED_COMMANDS_REGION_LOOKUP_FAILED_2 = TextKey.of(
"iris.modded.irismoddedcommands.region_lookup_failed_2",
"Region lookup failed: " + "{value}"
@@ -207,10 +191,6 @@ public final class ModdedCommandMessages {
"iris.modded.irismoddedcommands.surface_block_y",
"Surface block: " + "{value}" + " (y=" + "{value2}" + ")"
);
public static final TextKey IRIS_MODDED_COMMANDS_POSITION_CHUNK = TextKey.of(
"iris.modded.irismoddedcommands.position_chunk",
"Position: " + "{value}" + " " + "{value2}" + " " + "{value3}" + " (chunk " + "{value4}" + "," + "{value5}" + ")"
);
public static final TextKey IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_IT_INSPECTS_2 = TextKey.of(
"iris.modded.irismoddedcommands.this_command_can_only_be_used_by_players_it_inspects_2",
"This command can only be used by players (it inspects the block you are looking at)."
@@ -219,10 +199,6 @@ public final class ModdedCommandMessages {
"iris.modded.irismoddedcommands.look_at_block_not_sky",
"Look at a block, not the sky."
);
public static final TextKey IRIS_MODDED_COMMANDS_BLOCK_Y = TextKey.of(
"iris.modded.irismoddedcommands.block_y",
"Block: " + "{value}" + " (y=" + "{value2}" + ")"
);
public static final TextKey IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_MARKERS_RENDER = TextKey.of(
"iris.modded.irismoddedcommands.this_command_can_only_be_used_by_players_markers_render",
"This command can only be used by players (markers render as particles around you)."
@@ -267,10 +243,6 @@ public final class ModdedCommandMessages {
"iris.modded.irismoddedcommands.unknown_region_2",
"Unknown region: " + "{key}"
);
public static final TextKey IRIS_MODDED_COMMANDS_IS_NOT_DEFINED_DIMENSION = TextKey.of(
"iris.modded.irismoddedcommands.is_not_defined_dimension",
"{value}" + " is not defined in the dimension!"
);
public static final TextKey IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_10 = TextKey.of(
"iris.modded.irismoddedcommands.this_dimension_is_not_generated_by_iris_10",
"This dimension is not generated by Iris."
@@ -419,10 +391,6 @@ public final class ModdedCommandMessages {
"iris.modded.irismoddedcommands.downloading_irisdimensions",
"Downloading IrisDimensions/" + "{pack}" + " (" + "{downloadSource}" + ")..."
);
public static final TextKey IRIS_MODDED_COMMANDS_PACK_INSTALLED_ITS_EXACT_DIMENSION_TYPES_CUSTOM_BIOMES_JOIN_FORCED = TextKey.of(
"iris.modded.irismoddedcommands.pack_installed_its_exact_dimension_types_custom_biomes_join_forced",
"Pack '" + "{pack}" + "' installed. Its exact dimension types and custom biomes join the forced Iris datapack on the next server restart; restart before creating worlds from this pack."
);
public static final TextKey IRIS_MODDED_COMMANDS_PACK_DOWNLOAD_FAILED_SEE_CONSOLE = TextKey.of(
"iris.modded.irismoddedcommands.pack_download_failed_see_console",
"Pack download failed for " + "{pack}" + " (" + "{downloadSource}" + "; see console)."
@@ -439,10 +407,6 @@ public final class ModdedCommandMessages {
"iris.modded.irismoddedcommands.ms",
" " + "{value}" + ": " + "{value2}" + "ms"
);
public static final TextKey MODDED_COMMAND_HELP_UNKNOWN_IRIS_HELP_SECTION = TextKey.of(
"iris.modded.moddedcommandhelp.unknown_iris_help_section",
"Unknown Iris help section: " + "{normalized}"
);
public static final TextKey MODDED_DATAPACK_COMMANDS_TYPE_ACTIVE_LOGICAL_PACK_ENGINE_NOT_STARTED_PACK_HEIGHTS_UNKNOWN = TextKey.of(
"iris.modded.moddeddatapackcommands.type_active_logical_pack_engine_not_started_pack_heights_unknown",
"{dimensionId}" + ": type=" + "{typeKey}" + " active=" + "{activeMin}" + ".." + "{activeMax}" + " logical=" + "{value}" + " (pack=" + "{value2}" + ", engine not started; pack heights unknown)"
@@ -964,26 +928,10 @@ public final class ModdedCommandMessages {
"iris.modded.moddedstudiocommands.opening_studio_seed",
"Opening studio for '" + "{pack}" + "' (seed " + "{seed}" + ")..."
);
public static final TextKey MODDED_STUDIO_COMMANDS_PACK_MISSING_DOWNLOADING_IRISDIMENSIONS = TextKey.of(
"iris.modded.moddedstudiocommands.pack_missing_downloading_irisdimensions",
"Pack '" + "{pack}" + "' missing; downloading IrisDimensions/" + "{pack2}" + "..."
);
public static final TextKey MODDED_STUDIO_COMMANDS_PACK_COULD_NOT_BE_DOWNLOADED_CHECK_NAME_TRY_IRIS_DOWNLOAD = TextKey.of(
"iris.modded.moddedstudiocommands.pack_could_not_be_downloaded_check_name_try_iris_download",
"Pack '" + "{pack}" + "' could not be downloaded; check the name and try /iris download " + "{pack2}" + "."
);
public static final TextKey MODDED_STUDIO_COMMANDS_PACK_HAS_NO_DIMENSIONS_JSON = TextKey.of(
"iris.modded.moddedstudiocommands.pack_has_no_dimensions_json",
"Pack '" + "{pack}" + "' has no dimensions/" + "{pack2}" + ".json"
);
public static final TextKey MODDED_STUDIO_COMMANDS_STUDIO_OPEN_FAILED = TextKey.of(
"iris.modded.moddedstudiocommands.studio_open_failed",
"Studio open failed: " + "{value}" + "{errorMessage}"
);
public static final TextKey MODDED_STUDIO_COMMANDS_STUDIO_INJECTION_FAILED = TextKey.of(
"iris.modded.moddedstudiocommands.studio_injection_failed",
"Studio injection failed: " + "{value}" + "{errorMessage}"
);
public static final TextKey MODDED_STUDIO_COMMANDS_CONSOLE_STUDIO_OPEN_NOW_RUNS_SEED_TRANSIENT_NOT_WRITTEN_IRIS = TextKey.of(
"iris.modded.moddedstudiocommands.console_studio_open_now_runs_seed_transient_not_written_iris",
"Console studio open: " + "{dimensionId}" + " now runs '" + "{pack}" + "' seed " + "{seed}" + " (transient; not written to iris-dimensions.json and cleared on restart)."
@@ -1000,10 +948,6 @@ public final class ModdedCommandMessages {
"iris.modded.moddedstudiocommands.remove_it_with_iris_studio_close",
"Remove it with: /iris studio close"
);
public static final TextKey MODDED_STUDIO_COMMANDS_STUDIO_INJECTION_FAILED_2 = TextKey.of(
"iris.modded.moddedstudiocommands.studio_injection_failed_2",
"Studio injection failed: " + "{value}" + "{errorMessage}"
);
public static final TextKey MODDED_STUDIO_COMMANDS_STUDIO_OPEN_NOW_RUNS_SEED_USE_IRIS_STUDIO_CLOSE_WHEN = TextKey.of(
"iris.modded.moddedstudiocommands.studio_open_now_runs_seed_use_iris_studio_close_when",
"Studio open: " + "{dimensionId}" + " now runs '" + "{pack}" + "' seed " + "{seed}" + ". Use /iris studio close when done."
@@ -1314,10 +1258,8 @@ public final class ModdedCommandMessages {
IRIS_MODDED_COMMANDS_CANNOT_EVACUATE_PRIMARY_WORLD_THERE_IS_NOWHERE_SEND_PLAYERS,
IRIS_MODDED_COMMANDS_EVACUATED_PLAYER_S_FROM,
IRIS_MODDED_COMMANDS_SET_DEBUG,
IRIS_MODDED_COMMANDS_HOTLOADED_SETTINGS,
IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_IT_INSPECTS,
IRIS_MODDED_COMMANDS_YOUR_MAIN_HAND_IS_EMPTY,
IRIS_MODDED_COMMANDS_HAND_X,
IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS,
IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_4,
IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_5,
@@ -1333,17 +1275,13 @@ public final class ModdedCommandMessages {
IRIS_MODDED_COMMANDS_LOADED_DIMENSIONS_IRIS,
IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_2,
IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_6,
IRIS_MODDED_COMMANDS_BIOME,
IRIS_MODDED_COMMANDS_BIOME_LOOKUP_FAILED_2,
IRIS_MODDED_COMMANDS_REGION,
IRIS_MODDED_COMMANDS_REGION_LOOKUP_FAILED_2,
IRIS_MODDED_COMMANDS_CAVE_BIOME,
IRIS_MODDED_COMMANDS_CAVE_BIOME_LOOKUP_FAILED,
IRIS_MODDED_COMMANDS_SURFACE_BLOCK_Y,
IRIS_MODDED_COMMANDS_POSITION_CHUNK,
IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_IT_INSPECTS_2,
IRIS_MODDED_COMMANDS_LOOK_AT_BLOCK_NOT_SKY,
IRIS_MODDED_COMMANDS_BLOCK_Y,
IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_MARKERS_RENDER,
IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_7,
IRIS_MODDED_COMMANDS_SCANNING_MARKERS_AROUND_YOU,
@@ -1355,7 +1293,6 @@ public final class ModdedCommandMessages {
IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_4,
IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_9,
IRIS_MODDED_COMMANDS_UNKNOWN_REGION_2,
IRIS_MODDED_COMMANDS_IS_NOT_DEFINED_DIMENSION,
IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_10,
IRIS_MODDED_COMMANDS_IS_NOT_CONFIGURED_ANY_REGION_BIOME_OBJECT_PLACEMENTS_OBJECT_KEYS,
IRIS_MODDED_COMMANDS_THIS_COMMAND_CAN_ONLY_BE_USED_BY_PLAYERS_OBJECT_KEY,
@@ -1393,12 +1330,10 @@ public final class ModdedCommandMessages {
IRIS_MODDED_COMMANDS_ENGINE_SEED_MIXED,
IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_15,
IRIS_MODDED_COMMANDS_DOWNLOADING_IRISDIMENSIONS,
IRIS_MODDED_COMMANDS_PACK_INSTALLED_ITS_EXACT_DIMENSION_TYPES_CUSTOM_BIOMES_JOIN_FORCED,
IRIS_MODDED_COMMANDS_PACK_DOWNLOAD_FAILED_SEE_CONSOLE,
IRIS_MODDED_COMMANDS_THIS_DIMENSION_IS_NOT_GENERATED_BY_IRIS_16,
IRIS_MODDED_COMMANDS_GENERATED_CHUNK_S_S,
IRIS_MODDED_COMMANDS_MS,
MODDED_COMMAND_HELP_UNKNOWN_IRIS_HELP_SECTION,
MODDED_DATAPACK_COMMANDS_TYPE_ACTIVE_LOGICAL_PACK_ENGINE_NOT_STARTED_PACK_HEIGHTS_UNKNOWN,
MODDED_DATAPACK_COMMANDS_TYPE_ACTIVE_LOGICAL_PACK_WANTS_LOGICAL,
MODDED_DATAPACK_COMMANDS_WARNING_ACTIVE_DIMENSION_TYPE_DOES_NOT_MATCH_PACK_IRIS_WILL,
@@ -1529,16 +1464,11 @@ public final class ModdedCommandMessages {
MODDED_STUDIO_COMMANDS_PACK_NOT_FOUND_UNDER,
MODDED_STUDIO_COMMANDS_PROVIDE_DIMENSION_PACK_IRIS_STUDIO_OPEN_PACK_SEED_2,
MODDED_STUDIO_COMMANDS_OPENING_STUDIO_SEED,
MODDED_STUDIO_COMMANDS_PACK_MISSING_DOWNLOADING_IRISDIMENSIONS,
MODDED_STUDIO_COMMANDS_PACK_COULD_NOT_BE_DOWNLOADED_CHECK_NAME_TRY_IRIS_DOWNLOAD,
MODDED_STUDIO_COMMANDS_PACK_HAS_NO_DIMENSIONS_JSON,
MODDED_STUDIO_COMMANDS_STUDIO_OPEN_FAILED,
MODDED_STUDIO_COMMANDS_STUDIO_INJECTION_FAILED,
MODDED_STUDIO_COMMANDS_CONSOLE_STUDIO_OPEN_NOW_RUNS_SEED_TRANSIENT_NOT_WRITTEN_IRIS,
MODDED_STUDIO_COMMANDS_ENTER_IT_WITH_EXECUTE_RUN_TP_S_8_5_8,
MODDED_STUDIO_COMMANDS_PREGEN_IT_WITH_IRIS_PREGEN_START_RADIUS,
MODDED_STUDIO_COMMANDS_REMOVE_IT_WITH_IRIS_STUDIO_CLOSE,
MODDED_STUDIO_COMMANDS_STUDIO_INJECTION_FAILED_2,
MODDED_STUDIO_COMMANDS_STUDIO_OPEN_NOW_RUNS_SEED_USE_IRIS_STUDIO_CLOSE_WHEN,
MODDED_STUDIO_COMMANDS_YOU_DO_NOT_HAVE_OPEN_STUDIO_USE_IRIS_STUDIO_OPEN,
MODDED_STUDIO_COMMANDS_STUDIO_CLOSE_FAILED,
@@ -65,6 +65,7 @@ public class ModdedLanguageCommandsTest {
try (MockedStatic<IrisLanguage> language = mockStatic(IrisLanguage.class)) {
language.when(IrisLanguage::activeLocale).thenReturn("en_US");
language.when(IrisLanguage::availableLocales).thenReturn(Set.of("de_DE"));
language.when(() -> IrisLanguage.displayName("de_DE")).thenReturn("German (Germany)");
language.when(() -> IrisLanguage.plain(DirectorHelpMessages.BACK)).thenReturn("Back");
CommandDispatcher<CommandSourceStack> dispatcher = new CommandDispatcher<>();
new NativeCommandRegistration(dispatcher).register(NativeCommandRegistration.literal("iris").then(ModdedLanguageCommands.tree()));