LuckPerms

LuckPerms

41.4k Downloads

Allow empty values in lang.yml

kmecpp opened this issue ยท 7 comments

commented

Could you please add a way to remove messages from the locale file? Currently, if a node is deleted an exception is thrown, and if a node is set to an empty string a blank line is printed.

If a node in the locale file is set to an empty string I think it would be more accurate if nothing were printed, and that would give users the ability to remove messages they didn't want.

commented

Which node? If you remove an entry, it should just fallback to the default message.

commented

It does fallback but the exception is still printed to the console

image

commented

Update to the latest version, this is already fixed.

https://ci.lucko.me/job/LuckPerms/

commented

@lucko Sorry my original post may not have been very clear. I'm asking for a way to disable the message entirely. I updated to the latest version and tried removing the node, setting the node to null and even setting it to an empty string but yes, it falls back to the default or prints the empty string.

If the node is set to deliberately set to nothing I think instead of falling back to the default, no message should be printed at all which would allow users a way to disable messages.

commented

No, when messages are not in the file, the default message is used. It is absolutely intended and will not change.

I cannot change this behaviour as it would break sending messages for other users of the plugin.

Out of interest, which message were you trying to remove?

commented

If the node exists though and it has no value, I think it makes much more sense to disable the message because its clear that its been deliberately set to null. Most servers which want to use the default message would just not alter the original file or comment out the nodes they didn't want to change. Anyone setting the value to null would probably only be trying to disable the message in the first place, not use the default.

user-not-online: "&bUser &a{0}&b is not online."
user-save-success: 
user-save-error: "There was an error whilst saving the user."

If you think that would still break compatibility too much, maybe consider doing a precheck and see if the node is something like node: false and if it is, disabling the message. This would pose basically zero compatibility issues because 1) the node exists, and 2) it is blatantly being set to a specific invalid value.

Some of the messages I'm trying to remove are *-save-success. I really don't need to know that the data was saved successfully every time. I should be confident knowing that every time I run a command, the data will be saved successfully. If it isn't, then there's a serious issue going on that shouldn't ever happen, and an error message should be given in that case. It's seems redundant to say "user's group was successfully set to awesomegroup" and then after that, "yeah that change was also saved successfully too".

commented

I'll edit the save messages then, point taken about that.

The existing behaviour for the language file will be kept though. It's meant for translating messages, not completely disabling them.