zaanposni / discord-masz

MASZ is a selfhostable highly sophisticated moderation bot for Discord. Includes a web dashboard and a discord bot.
https://discord.gg/5zjpzw6h3S
Other
71 stars 18 forks source link

Add translation for commands #556

Closed FlixProd closed 1 year ago

FlixProd commented 1 year ago

The Discord API provides bot's with the client language of the user who executed a command and also allows bots to register commands in different languages. This gives us some cool features:

Localization of the command responses

Currently, the bot replies with the selected language of the guild, in which the command was executed. This works well, but to improve this system, the bot could fetch the locale of the user and than automatically reply in the language the user uses in the discord client (if available). For messages that aren't triggered by a command, the guild language could still be used. I',m not sure if thats possible, but maybe the dasboard could also automatically switch to the language of the user after fetching it from the OAuth2.

Localization of commands and descriptions

When registering a command, you can also add different names and descriptions for different languages. Discord than automatically shows the right name/description, depending on the client settings. I'm personally not sure if it's a good idea to translate the command names, because it might get confusing if everyone has a different command name, but at least for the descriptions of the command it could be very helpful.

zaanposni commented 1 year ago

Well this is somewhat spoiling the christmas surprise now, but this is actually planned and in development for the upcoming release

image

Stay tuned :eyes:

zaanposni commented 1 year ago

fixed in v3.3.0 release branch