-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: MiniMessageTranslator #972
base: main/4
Are you sure you want to change the base?
Conversation
...ge/src/main/java/net/kyori/adventure/text/minimessage/translation/MiniMessageTranslator.java
Outdated
Show resolved
Hide resolved
I think it would be worth including an equivalent of the MessageFormat-based |
...ge/src/main/java/net/kyori/adventure/text/minimessage/translation/MiniMessageTranslator.java
Outdated
Show resolved
Hide resolved
9b668ad
to
9380716
Compare
This PR has been updated with full documentation and named argument support using virtual components. An example of which is provided below: Component.translatable(
"my.minimessage.key",
NamedTranslationArgument.component("player_name", player.displayName())
); |
I'm unsure what you mean by this. It already has "multi-locale and multi-source" support by allowing you to do whatever you want to turn keys to MiniMessage strings. |
As pointed out by FabiHBBBT in Discord, it would be incredibly nice to allow for entire tag resolvers to be wrapped in the same system. |
|
||
final Map<String, ComponentLike> namedArgumentMap = new HashMap<>(this.argumentComponents.size()); | ||
for (final ComponentLike argument : this.argumentComponents) { | ||
if (argument instanceof VirtualComponent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason this check fails when using this snippet
player.sendMessage(Component.translatable("mapsetup.stage.9.name",
NamedTranslationArgument.numeric("phase", phase),
NamedTranslationArgument.component("name", teamName)));
and these registry entries
team.red = <red>Team Red
mapsetup.stage.9.name = <grey>9.<phase>. Please sneak at the position where the spawnpoint of team <name> <grey>will be.
Closes #971