mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
API Language Field Validation Prevents Locale-Specific Language Selection #535
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Dong-Chen-1031 on GitHub (Jan 3, 2026).
Originally assigned to: @Boy132 on GitHub.
Current Behavior
When creating users via the API at POST /api/application/users, the language field validation only accepts 2-letter ISO 639-1 language codes (e.g.,
zh,en,fr).This prevents users from specifying locale-specific language codes like
zh-TW(Traditional Chinese - Taiwan),pt-BR(Brazilian Portuguese), orar-SA(Saudi Arabic) even though the system has complete translation files for these locales.When Debug=false :
When Debug=true : pelican_respond.json
Expected Behavior
The API should accept locale codes in the format
xx-XX(language-country) in addition to 2-letter language codes, matching the existing translation file structure in thelang/directory.Steps to Reproduce
Attempt to create a user via API with
language: "zh-TW"Request fails validation because
zh-TWcontains a hyphen and country codePanel Version
1.0.0-beta30
Wings Version
1.0.0-beta21
Games and/or Eggs Affected
No response
Docker Image
No response
Error Logs
Is there an existing issue for this?