#29693: Django admin corrupted first character in verbose_name for languages
without capital letters
-------------------------------------+-------------------------------------
Reporter: irakli | Owner: nobody
khitarishvili |
Type: | Status: new
Uncategorized |
Component: | Version: 2.1
contrib.admin | Keywords: translation
Severity: Normal | localization corrupted character
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When using **Django admin** for **ka-ge** language first characters gets
corrupted, because language dose not have capital letters.
For example "username" in Georgian is "მომხმარებლის სახელი" and when first
letter is capitalized it's displayed as "Სომხმარებლის სახელი".
You can test this case when "**log in**" page is displayed for admin.
In **django.contrib.admin.forms.AuthenticationForm**
{{{
def __init__(self, request=None, *args, **kwargs):
self.request = request
self.user_cache = None
super().__init__(*args, **kwargs)
self.username_field =
UserModel._meta.get_field(UserModel.USERNAME_FIELD)
self.fields['username'].max_length =
self.username_field.max_length or 254
if self.fields['username'].label is None:
# This is the line when character gets corrupted
self.fields['username'].label =
capfirst(self.username_field.verbose_name)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29693>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.526d3d66a5e330cd9543da2df0574f2e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.