i18n applyLocalizedBuilders Options

I saw in the method parameters one for options. How do I pass them?
applyLocalizedBuilder(
builder,
'lfg', Language.buildCommandTranslationKey(CommandType.lfg, 'command_description'),
{
test: "test"
})
applyLocalizedBuilder(
builder,
'lfg', Language.buildCommandTranslationKey(CommandType.lfg, 'command_description'),
{
test: "test"
})
The example above does not work. How can I do it?
7 Replies
Favna
Favna•16mo ago
You're mixing up method parameters and generic type paramaters. The method paramaters dont have options, only. the generic types do and that is only to build the ParseKeys type from i18next which is the proper type for the name and description paramaters. The TSDoc of the function also only mentions the builder and the name and description (params) The proper usage is in the examples in the TSDoc. Simply hover over the function and it will show you.
ShowCast
ShowCastOP•16mo ago
So there is no option to supply options to the localized builder in any way?
Favna
Favna•16mo ago
No. What use case would there even be for any options to be configured for a localized builder Localized builders are for registering commands. It's not like you have any dynamic arguments or anything else dynamic at that point. it can be added but I really dont see a use case
ShowCast
ShowCastOP•16mo ago
Hm I use that because I don't wanna hardcore URLs and stuff like that into my .json files. Well then I have to do it, thanks anyways 😄
Favna
Favna•16mo ago
set them with defaultVariables in the i18next options you shouldnt pass that stuff every single time...
ShowCast
ShowCastOP•16mo ago
Can I find how to do that in the docs for i18next or is there a special way for the plugin implementation?
Favna
Favna•16mo ago
clientOptions.i18n.i18next.defaultVariables pretty sure. It's part of the i18next config. also yes it's on the i18next docs.
Want results from more Discord servers?
Add your server