当我运行
这是我的文件夹结构。
django-admin makemessages -l en
时,没有任何反应,也没有创建 po
文件。它只显示 processing locale en
。这是我的文件夹结构。
/myproject
myapp/
locale/
media/
static/
templates/
db.sqlite
manage.py
settings.py
urls.py
wsgi.py
settings.py
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django_user_agents.middleware.UserAgentMiddleware',
]
ROOT_URLCONF = 'urls'
WSGI_APPLICATION = 'wsgi.application'
LANGUAGE_CODE = 'fr'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]