Can't set up localized commands
When I try to use the
setNameLocalization or setDescriptionLocalization builders, I get this trace:
https://sourceb.in/Mi21E9xgjR
When I instead use setName() and setDescription(), everything works fine and I can deploy my commands.
With localization:
https://sourceb.in/XHryaBBlKW
Without:
https://sourceb.in/WPeFdrNZKf19 Replies
you still need to
setName and setDescription, they are requiredguide suggestion for @Myst:
:guide: Localizations
The names and descriptions of slash commands can be localized to the user's selected language. You can find the list of accepted locales on the discord API documentation. Setting localizations with
setNameLocalizations() and setDescriptionLocalizations() takes the format of an object, mapping location codes (e.g. pl and de) to their localized strings.
read more@Mafia , oh, so I need both setName() AND setNameLocalization() for the same command?
yes,
ooooh
I thought there was a fallback to en-us, or the first in the list
thanks a lot @Mafia
np
(oh yeah but that would make things messy if the dev enters different locales for each property, I understand why we still need a non-localized version)
are you using a table/object for the localizations?
I'm using a mess of a system I just cooked up from an object like this one:
https://sourceb.in/kuPdb6DcBd
for example
in order not to declare N items for each locale
yep
in the end I'm able to have
.setNameLocalizations(getLocProps(strings.commands.mjg.nanikiru.desc))
even if I have 10 localization objectsso then do
yep
So then this is not an issue?
no it's not, I just failed to see the need for this apparent redundancy 🙂
Discord needs a fallback also name is how command interactions are idenified. so you as a dev would want a consitant name
oh okay, the localizedName is just sugar on top of the actual one
correct. it is for user interface only