sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
951 stars 405 forks source link

translate: warn or error if user gives a bad language code #2537

Open SnoopJ opened 8 months ago

SnoopJ commented 8 months ago

Requested Feature

Currently, invoking the .tr command with a bad language code will silently fall back on default behavior, e.g. my usual habit of using :jp instead of :ja

<+SnoopJ> .tr :jp :en むりです <+Sopel> [translate] "むりです" (en to en, translate.google.com)

There's a TODO in the plugin about this, which suggests one path forward. A simple check against ISO language codes will probably suffice for the sake of this issue.

Problems Solved

No response

Alternatives

No response

Notes

No response