Answer the question
In order to leave comments, you need to log in
Why doesn't translation of verbose_name work for applications of django-allauth package installed via pip?
The well-known battery for authorization through third-party services django-allauth is installed via pip into the project's virtual environment.
The translation of the verbose_name of the application does not work, while there is no such problem for verbose_name models:
Python and Django versions:
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class SocialAccountConfig(AppConfig):
name = 'allauth.socialaccount'
verbose_name = _('Social Accounts')
from . import app_settings
default_app_config = 'allauth.socialaccount.apps.SocialAccountConfig'
#: socialaccount/apps.py:8
#, fuzzy
msgid "Social Accounts"
msgstr "Социальные аккаунты"
INSTALLED_APPS = [
...
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.vk',
...
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.i18n',
...
'django.template.context_processors.request',
],
},
},
]
LANGUAGE_CODE = 'ru-ru'
from allauth import socialaccount
socialaccount.apps.SocialAccountConfig.verbose_name = 'Социальные аккаунты'
Answer the question
In order to leave comments, you need to log in
In localization files with the .po extension, some of the translated strings are marked fuzzy translation:
And ignored when compiling files with the .mo extension
.
or like this:
Result:
Thanks to sim3x for the exact reference in the documentation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question