I want to translate the name field in the django application (1.11) using django-modeltranslation. I want to translate to en and fr, but in the admin panel I get 3 fields instead of two: name, name_en, name_fr.
models.py
class Country(models.Model):
name = models.CharField(max_length=100)
code = models.SlugField(max_length=20, default='')
def __str__(self):
return self.name
admin.py
class CountryAdmin(admin.ModelAdmin):
list_display = ('name_en',)
translation.py
from events.models import Country
class CountryTranslationOptions(TranslationOptions):
fields = ('name',)
translator.register(Country, CountryTranslationOptions)