add english translation

This commit is contained in:
lijiejie
2022-04-10 00:08:10 +08:00
parent e5b34be344
commit c004584df0
10 changed files with 483 additions and 90 deletions
+8 -1
View File
@@ -1,6 +1,7 @@
# coding:utf-8
import os
from django.utils.translation import gettext_lazy as _
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -27,6 +28,7 @@ INSTALLED_APPS = (
MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
@@ -68,12 +70,17 @@ DATABASES = {
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'zh-Hans'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = True
LANGUAGES = (
('zh-hans', _('中文')),
('en-us', _('English')),
)
LOCALE_PATHS = (os.path.join(BASE_DIR, 'locale'),)
STATIC_URL = '/static/'
if DEBUG: