Reputation: 647
I have project in Django==2.2.12
and this is part of my settings:
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [os.path.join(BASE_DIR, "templates")],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"django.template.context_processors.static",
],
},
},
]
LANGUAGE_CODE = "pl"
TIME_ZONE = "Europe/Warsaw"
USE_I18N = True
USE_L10N = True
USE_TZ = False
LANGUAGES = (
('pl', gettext('Polish')),
('en', gettext('English')),
)
When I execute:
django-admin makemessages --locale=en
It generates .po files with string to translate in locale directory from .py files but it completly skips .txt files that are located in my templates directory. For example it does not generate string for translation for my text.txt file with following content:
{% load i18n %}
{% blocktranslate %}
string to translate
{% endblocktranslate %}
Upvotes: 0
Views: 355
Reputation: 1
{%trans 'your string %}
.po
files: python manage.py makemessages -l ar --no-wrap --no-location
#fuzzy
if it's above what you want to translatepython manage.py compilemessages
I hope this helps!
Upvotes: 0