Getting localized application command option

I can't really find how to parse options using their name when I used i18n to localize them. Thanks in advance!
Solution:
Found it! You can use resolveKey to get a translation.
Sapphire Framework
Getting Started | Sapphire
This plugin implements [i18next], a powerful internationalization library. It provides a simple way to internationalize
Jump to solution
12 Replies
Solution
Nullified
Nullified•14mo ago
Found it! You can use resolveKey to get a translation.
Sapphire Framework
Getting Started | Sapphire
This plugin implements [i18next], a powerful internationalization library. It provides a simple way to internationalize
Favna
Favna•14mo ago
is this for things like addStringOption @Nullified ?
Favna
Favna•14mo ago
because then you want to use applyLocalizedBuilder (https://www.sapphirejs.dev/docs/Documentation/api-plugins/modules/sapphire_plugin_i18next#applylocalizedbuilder) to add localized names and descriptions
Nullified
NullifiedOP•14mo ago
It was actually for getting the option in the chatInputRun function to retrieve the value, I used this:
No description
Nullified
NullifiedOP•14mo ago
However since I swapped to TSC I'm having a problem, my commands stopped working but everything else seems to work 😂 First I thought the translations might need a copy to /dist/, this didn't help yet
Nullified
NullifiedOP•14mo ago
This log is not called, for example
No description
Nullified
NullifiedOP•14mo ago
OOOH right...
Nullified
NullifiedOP•14mo ago
Makes sense 😄
No description
Nullified
NullifiedOP•14mo ago
There we go
No description
Nullified
NullifiedOP•14mo ago
The trial/error has been real today, phew
Favna
Favna•14mo ago
glad you got this, many people would have similar issues and give up before figuring it out. FWIW something like this is mentioned on the guide too.
Nullified
NullifiedOP•14mo ago
Yeah it always goes like this, I get an issue that generates 5 other issues and before I know it it's 5am in the morning haha
Want results from more Discord servers?
Add your server