Code

#19158 closed Bug (invalid)

FileField's error message about too long filename should use plural translation function

Reported by: void Owned by: nobody
Component: File uploads/storage Version: master
Severity: Normal Keywords: i18n
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

FileField's error message is currently defined as _('Filename is %(extra)d characters too long.'). It contains a number, but _ in that context is ugettext_lazy, so translators cannot provide different translations for different pluralization forms.

Attachments (0)

Change History (6)

comment:1 Changed 21 months ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Agreed. ungettext_lazy should be used instead.

comment:2 Changed 21 months ago by claudep

Related to #19034. Unfortunately, ungettext_lazy is seldom useful, as generally you don't know the third (count) parameter at the lazy definition time. The patch I proposed for #19034 has one annoying drawback, it overwrites any customized message. Has someone a better idea?

comment:3 Changed 21 months ago by void

Pull request: https://github.com/django/django/pull/462 (also includes patch for #19034)

comment:4 Changed 20 months ago by EmilStenstrom

  • Has patch set

comment:5 Changed 19 months ago by void

Commit db278c3bf9177043c42a9ed8b529a5c117938460 reverted corresponding changes, so this ticket is probably no longer makes any sense

comment:6 Changed 19 months ago by void

  • Resolution set to invalid
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.