#5373: Field label for a ForeignKey not translated
------------------------------------------------------------------------+---
          Reporter:  Szilveszter Farkas <szilveszter.far...@gmail.com>  |       
  Owner:  garcia_marc                
            Status:  new                                                |     
Milestone:                             
         Component:  Internationalization                               |       
Version:  SVN                        
        Resolution:                                                     |      
Keywords:  i18n foreignkey field label
             Stage:  Accepted                                           |     
Has_patch:  1                          
        Needs_docs:  0                                                  |   
Needs_tests:  0                          
Needs_better_patch:  0                                                  |  
------------------------------------------------------------------------+---
Comment (by datakid):

 Replying to [comment:4 mk]:
 > The self.verbose_name of the Category ForeignKey field gets set in
 django/db/models/fields/__init__.py in set_attributes_from_name (around
 line 190)
 >
 > Later, when set_attributes_from_rel from
 django/db/models/fields/related.py is run, self.verbose_name always has a
 value and therefore, the value if self.rel.to._meta.verbose_name is never
 taken into account.
 >
 > The attached patch fixes this behavior by not assigning a value to
 self.verbose_name in set_attributes_from_name for RelatedField instances.


 I've just attached a patch to tests/regressiontests/admin_inlines that
 checks for this problem.

 Since the second patch submitted by mk works, but 1. hasn't been accepted
 yet, and 2. puts an import statement in the body of the code, I thought
 I'd look for another solution.

 I'm not sure about the full implications, but presumably making sure that
 the verbose_name is set in django/db/models/fields/related.py would work
 by just removing the line "if self.verbose_name = None" at 114?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5373#comment:9>
Django <http://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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to