dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Allow customizing command error messages (and their format)

Open andreashgk opened this issue 3 years ago • 1 comments

This would be nice both for servers that what a different format than the current one, and for servers that want multi-language support.

One way could be to allow some sort of language provider interface to be passed to a server that people can implement. It could be something like the following:

// proof of concept
type LangProvider interface {
    GetMessage(key string, parameters map[string]string) string
}

Or maybe an error handler could be passed to a specific command to be able to handle the errors yourself

andreashgk avatar Mar 26 '22 10:03 andreashgk

This somehow needs to be a system that'd work everywhere throughout dragonfly. While commands are the most obvious case where this is an issue, there's other places that'd benefit from a system like this (think, for example, NPC names which need to be localised). Not entirely sure how this should be approached yet.

Sandertv avatar Mar 26 '22 11:03 Sandertv