Skip to content
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

Discord only accepts language IDs separated by dashes when registering application command localizations #594

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

MrPowerGamerBR
Copy link
Contributor

Invalid Form Body {"1":{"options":{"0":{"description_localizations":{"pt_BR":{"_errors":[{"code":"BASE_TYPE_CHOICES","message":"Value must be one of ('fi', 'cs', 'th', 'it', 'hi', 'bg', 'da', 'hu', 'en-GB', 'pt-BR', 'ru', 'ja', 'uk', 'es-ES', 'hr', 'ro', 'fr', 'nl', 'de', 'no', 'zh-TW', 'ko', 'el', 'tr', 'zh-CN', 'pl', 'en-US', 'vi', 'lt', 'sv-SE')."}]}}},"1":{"description_localizations":{"pt_BR":{"_errors":[{"code":"BASE_TYPE_CHOICES","message":"Value must be one of ('fi', 'cs', 'th', 'it', 'hi', 'bg', 'da', 'hu', 'en-GB', 'pt-BR', 'ru', 'ja', 'uk', 'es-ES', 'hr', 'ro', 'fr', 'nl', 'de', 'no', 'zh-TW', 'ko', 'el', 'tr', 'zh-CN', 'pl', 'en-US', 'vi', 'lt', 'sv-SE')."}]}}}}}}

…g application command localizations

```
Invalid Form Body {"1":{"options":{"0":{"description_localizations":{"pt_BR":{"_errors":[{"code":"BASE_TYPE_CHOICES","message":"Value must be one of ('fi', 'cs', 'th', 'it', 'hi', 'bg', 'da', 'hu', 'en-GB', 'pt-BR', 'ru', 'ja', 'uk', 'es-ES', 'hr', 'ro', 'fr', 'nl', 'de', 'no', 'zh-TW', 'ko', 'el', 'tr', 'zh-CN', 'pl', 'en-US', 'vi', 'lt', 'sv-SE')."}]}}},"1":{"description_localizations":{"pt_BR":{"_errors":[{"code":"BASE_TYPE_CHOICES","message":"Value must be one of ('fi', 'cs', 'th', 'it', 'hi', 'bg', 'da', 'hu', 'en-GB', 'pt-BR', 'ru', 'ja', 'uk', 'es-ES', 'hr', 'ro', 'fr', 'nl', 'de', 'no', 'zh-TW', 'ko', 'el', 'tr', 'zh-CN', 'pl', 'en-US', 'vi', 'lt', 'sv-SE')."}]}}}}}}
```
Copy link
Member

@lukellmann lukellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this, I've only used German localizations so far, which won't trigger this problem.

@lukellmann lukellmann merged commit 6b346e5 into kordlib:0.8.x Apr 14, 2022
@MrPowerGamerBR
Copy link
Contributor Author

By the way @lukellmann, I think that the RegEx should also be updated. The comment says " We accept both "_" and "-" as a separator, because Discord doesn't really document it", however the locale list documentation shows that all locales use a dash as a separator, so I don't think that they would magically change them to a underscore (unless if Discord mixes and matches the separators in different API endpoints?)

https://discord.com/developers/docs/reference#locales

@lukellmann
Copy link
Member

@DRSchlaubi, you implemeted Locale, what do you think?

@DRSchlaubi
Copy link
Member

DRSchlaubi commented Apr 15, 2022

it wasn't documented at the time but still not all use dashes? am i missing something here?

I completely understood you wrong.

The reason for it accepting _ is that it wasn't documented at the time of me implementing it, as this is no longer the case I aggree it should be only accepting -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants