Django 1.11
settings.py
INSTALLED_APPS = [
...
'general',
'general_frame',
...
]
LANGUAGE_CODE = 'ru-RU'
USE_I18N = True
USE_L10N = True
general/models.py
class GeneralModel(models.Model):
"""Sharing common features of models."""
title = models.CharField(max_length=200,
null=False,
blank=False,
default="",
verbose_name=_("title"))
general_frame/models.py
class GeneralFrame(GeneralModel):
DOCUMENT = 'D'
PHOTO = 'P'
PHOTO_DOCUMENT_CHOICES = ((None, '----'),
(DOCUMENT, _('document')),
(PHOTO, _('photo')),)
type = models.CharField(max_length=1, choices=PHOTO_DOCUMENT_CHOICES,
blank=False,
null=False,
default="---",
verbose_name=_('type'))
I have executed makemessages and compilemessages. The structure is as follows:
Project structure:
├── general
│ ├── locale
│ │ └── ru_RU
│ │ └── LC_MESSAGES
│ │ ├── django.mo
│ │ └── django.po
├── general_frame
│ ├── locale
│ │ └── ru_RU
│ │ └── LC_MESSAGES
│ │ ├── django.mo
│ │ └── django.po
The problem is: everything in GeneralFrame is translated, bot GeneralModel is not translated. I mean that document, photo and type are translated. But title is not translated.
I made messages, checked .po files and recompiled messages again several times.
Could you give me a kick here?
_
there? Can you please add the import lines to your code? – Gokhan Sari