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 Request] Support for TranslatableComponent #18

Open
Ghost-chu opened this issue Feb 6, 2022 · 4 comments
Open

[Feature Request] Support for TranslatableComponent #18

Ghost-chu opened this issue Feb 6, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Ghost-chu
Copy link

Is your feature request related to a problem? Please describe.

MineDown seems doesn't support TranslatableComponent.

Describe the solution you'd like

Foo [TextWillBeReplaced](translation_key=item.minecraft.diamond_sword) Bar.

Preview:

Foo Diamond Sword Bar.

Describe alternatives you've considered

Nope.

Additional context

Nothing.

@Ghost-chu Ghost-chu added the enhancement New feature or request label Feb 6, 2022
@Phoenix616
Copy link
Owner

Yeah, translation support has been on my todo for a while now but I could never decide on a proper syntax. The one you are suggesting doesn't really make sense to me tbh. as the part inside the square bracket would be pointless to have and the values in the round parentheses is supposed to apply to the value in the square ones, not completely replace it so a different syntax would be better.

The syntax I personally would prefer could be <translationkey>/<translation=translationkey> (arrows aren't used anywhere yet in MineDown so that could work but they are often used for formatting so it might cause false-positives and would require more escaping) or maybe {translationkey} (but curly brackets are already used in some places for the syntax so that's not really ideal either).

Another solution could be to just have it [translation=translationkey] with square brackets but that could cause some confusion I guess?

@Ghost-chu
Copy link
Author

Ghost-chu commented Feb 6, 2022

$translation_key$ maybe?
It't doesn't need too much escape and rare to use.

Also it easy to input, and translation key consist of A-z 0-9 and dots so that mean it actually doesn't need two different char to mark start and end like arrows.

@HarvelsX
Copy link

Maybe you should try to deserialize MiniMessage? Markdown in most implementations support HTML.

@Phoenix616
Copy link
Owner

Phoenix616 commented Jul 24, 2023

Maybe you should try to deserialize MiniMessage? Markdown in most implementations support HTML.

I fail to see what this has to do with this feature request of adding translatable to the MineDown systax.

Also while I never documented it here I pretty much already decided to go with this format: [Fallback text](translation=translation.key with={value1,value2}) which now that fallbacks exist just make sense it would way easier integrate with the whole approach of using the markdown link systax for additional info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants