-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add owo-lib rich translations compatibility #2
Conversation
Suggestion: create a boolean switch for it, since it's not that a Minecraft standard. Benefits:
|
Gradle, **why** is it so difficult to pass parameters to a filter? You already have it for extensions, just do it here again!
Are these complex implementations really necessary? thonk |
Apparently yes, because the filtering reader doesn't accept additional constructor args, like extensions do, so the alternative is either to create a non-static inner class or an anonymous class to get variables from the outer scope. The third way messes with how gradle injects passed properties via reflection, but that requires implementing non-api interfaces. |
Any updates on this? Or preferred other methods? |
I want to have a try myself to see if there's any better implementation on this when I have time. If you really needs this feature, you can use your fork for now (e.g. via jitpack) |
A cleaner approach, where |
Yeah this approach is much nicer |
src/main/java/me/fallenbreath/yamlang/ConverterConfiguration.java
Outdated
Show resolved
Hide resolved
Since Gradle is not very welcoming of configurable filters, this is going to be cursed anyway. I'd leave as default behavior because you don't use lists in normal translation files. |
You can simply use this method to pass argument to the filter: https://docs.gradle.org/current/javadoc/org/gradle/api/file/CopySpec.html#filter(java.util.Map,java.lang.Class) Changes are already pushed to your branch and it's now working. You can have another check to see if that's what you want |
Rich translations allow creating text with configurable effects using owo-lib: https://docs.wispforest.io/owo/rich-translations/
This format translates nicely to yaml:
In the plugin it is a simple change - whenever the endpoint value is a list, it preserves all its contents and converts to json as is.