kopia lustrzana https://github.com/wagtail/wagtail
				
				
				
			Fix for #3268 : Make file-label translated
							rodzic
							
								
									986749d309
								
							
						
					
					
						commit
						35305e1649
					
				| 
						 | 
				
			
			@ -17,6 +17,7 @@ Changelog
 | 
			
		|||
 * Added `form_fields_exclude` property to ModelAdmin views (Matheus Bratfisch)
 | 
			
		||||
 * User creation / edit form now enforces password validators set in `AUTH_PASSWORD_VALIDATORS` (Bertrand Bordage)
 | 
			
		||||
 * Fix: Marked 'Date from' / 'Date to' strings in wagtailforms for translation (Vorlif)
 | 
			
		||||
 * Fix: "File" field label on image edit form is now translated (Stein Strindhaug)
 | 
			
		||||
 * Fix: Unreliable preview is now reliable by always opening in a new window (Kjartan Sverrisson)
 | 
			
		||||
 * Fix: Fixed placement of `{{ block.super }}` in `snippets/type_index.html` (LB (Ben Johnston))
 | 
			
		||||
 * Fix: Optimised database queries on group edit page (Ashia Zawaduk)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,6 +31,7 @@ Bug fixes
 | 
			
		|||
~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
 * Marked 'Date from' / 'Date to' strings in wagtailforms for translation (Vorlif)
 | 
			
		||||
 * "File" field label on image edit form is now translated (Stein Strindhaug)
 | 
			
		||||
 * Unreliable preview is now reliable by always opening in a new window (Kjartan Sverrisson)
 | 
			
		||||
 * Fixed placement of ``{{ block.super }}`` in ``snippets/type_index.html`` (LB (Ben Johnston))
 | 
			
		||||
 * Optimised database queries on group edit page (Ashia Zawaduk)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
 | 
			
		|||
 | 
			
		||||
from django import forms
 | 
			
		||||
from django.forms.models import modelform_factory
 | 
			
		||||
from django.utils.text import capfirst
 | 
			
		||||
from django.utils.translation import ugettext as _
 | 
			
		||||
 | 
			
		||||
from wagtail.wagtailadmin import widgets
 | 
			
		||||
| 
						 | 
				
			
			@ -17,7 +18,7 @@ from wagtail.wagtailimages.permissions import permission_policy as images_permis
 | 
			
		|||
def formfield_for_dbfield(db_field, **kwargs):
 | 
			
		||||
    # Check if this is the file field
 | 
			
		||||
    if db_field.name == 'file':
 | 
			
		||||
        return WagtailImageField(**kwargs)
 | 
			
		||||
        return WagtailImageField(label=capfirst(db_field.verbose_name), **kwargs)
 | 
			
		||||
 | 
			
		||||
    # For all other fields, just call its formfield() method.
 | 
			
		||||
    return db_field.formfield(**kwargs)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue