mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 17:12:26 -05:00
[feature] Allow full BCP 47 in language inputs (#2067)
* Allow full BCP 47 in language inputs Fixes #2066 * Fuse validation and normalization for languages * Remove outdated comment line * Move post language canonicalization test
This commit is contained in:
parent
303a6a6b1d
commit
0f812746b7
9 changed files with 132 additions and 70 deletions
|
|
@ -222,10 +222,11 @@ func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, form
|
|||
|
||||
if form.Source != nil {
|
||||
if form.Source.Language != nil {
|
||||
if err := validate.Language(*form.Source.Language); err != nil {
|
||||
language, err := validate.Language(*form.Source.Language)
|
||||
if err != nil {
|
||||
return nil, gtserror.NewErrorBadRequest(err)
|
||||
}
|
||||
account.Language = *form.Source.Language
|
||||
account.Language = language
|
||||
}
|
||||
|
||||
if form.Source.Sensitive != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue