-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translations from property file not applied? #89
Comments
Yeah, I didn't had the client on english... Tho I thought that having a default locale set would actually make it use that on any language not set, tho that was bad thinking on my end I guess... |
Yeah I'm inclined to believe the descriptionLocalization requires this.help to be set but I'm unsure. Perhaps I can set this.help if you set a descriptionLocalization if it's blank to prevent that. I'm not sure how the fallbacks work on Discord or JDA's end. |
Looking a bit into this, the localization is applied within the I believe the main problem here is, that Discord defaults to whatever text you gave for name and description when it can't find a locale entry, and since Chewtils here is creating this data using So perhaps it would be a good idea to check at the start, if localization was set, and if yes, retrieve the default lang values for name and description. And if those aren't null, use them as the command values, else default to the getters. I'll try and work out something here to then PR, as it doesn't seem too complicated. Tho, maybe at least for command we should force a command name to be set? Or do we really want to allow a default locale value to be used? Because iirc does the command name itself not allow non-latin characters... So we should ensure this to be the case. |
Issue Checklist
Affected Modules
Command
Description
I'm unsure what exactly the issue here is, if it is an issue at all, but it seems like that translations from a properties file using the TranslateUtil are not applied?
To give some context, I have this properties file named
commands_en-GB.properties
:Then in my main Bot class am I doing this:
Finally, I override the SlashCommand class to implement some own stuff, including a central command handling.
One thing I do there too is set the
nameLocalization
anddescriptionLocalization
values like this:When I now run the bot does it report to have resolved 1 translation, but when typing the command - in my case /blush - does it show this:
This makes me believe that the localizations aren't applied and only the name and value are set...
The text was updated successfully, but these errors were encountered: