Skip to content
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

Open
wants to merge 5 commits into
base: main/4
Choose a base branch
from
Open

Conversation

kezz
Copy link
Member

@kezz kezz commented Sep 19, 2023

Closes #971

@mishyy
Copy link

mishyy commented Dec 5, 2023

I think it would be worth including an equivalent of the MessageFormat-based TranslationRegistry for MiniMessage's String-based translations, to maintain consistency in the level of multi-locale and multi-source (ResourceBundles, Files, etc) support.

@kezz kezz added this to the 4.19.0 milestone Jan 6, 2025
@kezz kezz force-pushed the feature/minimessage-translator branch from 9b668ad to 9380716 Compare January 6, 2025 17:38
@kezz kezz marked this pull request as ready for review January 6, 2025 17:40
@kezz
Copy link
Member Author

kezz commented Jan 6, 2025

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())
);

@kezz
Copy link
Member Author

kezz commented Jan 6, 2025

I think it would be worth including an equivalent of the MessageFormat-based TranslationRegistry for MiniMessage's String-based translations, to maintain consistency in the level of multi-locale and multi-source (ResourceBundles, Files, etc) support.

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.

@kezz
Copy link
Member Author

kezz commented Jan 6, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a MiniMessage Translator utility implementation
4 participants