Opened 8 years ago

Closed 8 years ago

#7083 closed (invalid)

table names are not getting translated in the 'add' and 'change' forms in admin

Reported by: kenneth gonsalves <lawgon@…> Owned by: nobody
Component: Internationalization Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I am using version 7435. Here in admin, the table names get translated correctly in the main index page. However in the 'add' page, the table name does not get translated. Again in the 'change' page it is not getting translated. I get:
in english: 'areas'
in finnish: 'Alueet'
no problem
but in the add screen:
in english: Add area
in finnish: Uusi area (the word 'area' is not being translated)
similarly, in the change list:
the finnish comes as 'Valitse muokattava area' instead of 'Valitse
muokattava alueet'
same problem in the edit screen.

Attachments (4)

fin4.tiff (22.8 KB) - added by kenneth gonsalves <lawgon@…> 8 years ago.
fin1.tiff (33.4 KB) - added by kenneth gonsalves <lawgon@…> 8 years ago.
fin2.tiff (19.8 KB) - added by kenneth gonsalves <lawgon@…> 8 years ago.
fin3.tiff (25.8 KB) - added by kenneth gonsalves <lawgon@…> 8 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by oyvind

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Think this is a .po issue, parts of strings are not translated.

comment:2 Changed 8 years ago by mtredinnick

  • Resolution invalid deleted
  • Status changed from closed to reopened

Oyvind, it doesn't look invalid to me. Reopening, at least until we can get some more details. I admit the report is hard to decipher.

Kenneth: please be careful when reporting a bug. It's not particularly clear what you are seeing because you say the "change" page is not getting translated, but then says it is showing "Alueet" in Finish (which means it is being translated). You've also run everything together in a single sentence, so it's easy to lose track of what's going on.

From what I can see looking at the code, only change_form.html has a bug (it doesn't translate the model's verbose name). Can you please take some screenshot fragments to show which strings you are talking about on each of the pages. Or at least describe where these strings appear on the page. I might well be misunderstanding the description sentence, but I can't work out all the cases you're talking about (or, at least, I can't see why they wouldn't be translated in the code).

I think we need a bit more information here before we can confirm and/or fix this.

Also, please confirm that the model's verbose_name attribute (not just verbose_name_plural) is marked up with ugettext_lazy()

comment:3 Changed 8 years ago by kenneth gonsalves <lawgon@…>

thanks for reopening it - I find that my tamil, kannada and telugu sites are also having the same problem. For the finnish site, lets take the Area model. Model code:

from django.db import models
from fida.thumbnails.field import *
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from datetime import datetime

class Area(models.Model):

code = models.IntegerField(_("Area Code Number"), unique=True)
name = models.CharField(_("Area Name"),max_length=150,unique=True)
description_en = models.TextField(_("Area Description in English"),blank=True,null=True)
description_fi = models.TextField(_("Area Description in Finnish"),blank=True,null=True)
picture = models.ImageField(_("Picture of Area"),upload_to="images/misc",


iscurrent = models.BooleanField(_("Is active"),default = True)
class Admin:

list_display = ("name","code",)
search_fields = code?
js = ("js/tiny_mce/tiny_mce.js","js/tiny_mce/textareas.js")

class Meta:

verbose_name_plural = _("Areas")

def unicode(self):

return u"%s" %(

I have taken screenshots and will attach

Changed 8 years ago by kenneth gonsalves <lawgon@…>

Changed 8 years ago by kenneth gonsalves <lawgon@…>

Changed 8 years ago by kenneth gonsalves <lawgon@…>

Changed 8 years ago by kenneth gonsalves <lawgon@…>

comment:4 Changed 8 years ago by mtredinnick

(Please hit preview before posting code to check it's formatted properly.)

I asked on the mailing list and in my first comment here about verbose_name being marked for translation and now I see that it is not so marked. So that's a bug in your code right there, since a bunch of those pages use the verbose_name (not verbose_name_plural). After all, you add a singular item, not a plurality of items. And this shows in your examples, since only the words "Areas" is translated.

So, when you fix the verbose_name problem (by marking it for lazy translation), how many of the problems disappear?

comment:5 Changed 8 years ago by kenneth gonsalves <lawgon@…>

ok - when I set verbose_name=_("Area") all problems are solved. Thanks Malcolm for your patience and dedication.

comment:6 Changed 8 years ago by mtredinnick

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

I've confirmed that everything appears to be working properly here when verbose_name and verbose_name_plural are marked for translation.

Note: See TracTickets for help on using tickets.
Back to Top