1
I think my path was not correct. I believe the extra slash was wrong⦠I deleted /translations/ from the LOCALE_PATH and it is working now.
LOCALE_PATHS = [
os.path.join(BASE_DIR, 'locale'),
]
Then I run
django-admin compilemessages -l pt_BR
Modify the *.po generated and run
django-admin compilemessages -l pt_BR
I also renamed en-us to en in LANGUAGE_CODE = 'en-us'
0
Please follow this steps.
1) Create folder 'locale'
in root.
2) Add middeleware
.....
'django.middleware.common.CommonMiddleware',
'django.middleware.locale.LocaleMiddleware',
....
3) In settings.py Set
USE_L10N = True
LANGUAGE_CODE = 'pt-BR'
LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale'),
)
LANGUAGES = (
('pt_BR', 'Portuguese'),
)
4) Run following commands
$ django-admin makemessages -l pt_BR -i env
$ django-admin compilemessages -l pt_BR
5) Then update required translated text in locale > pt_BR > LC_MESSAGES > django.po
then again run
$ django-admin compilemessages -l pt_BR
- How to use django-taggit from view file
- Maximum recursion depth trying to create Django migration
- Django model choices using other models
- How to append more data in FormData for django?
- Filter on calculated representation of some fields
Source:stackexchange.com