First pass at internationalization and localization

This commit is contained in:
Mouse Reeve
2021-02-27 13:43:17 -08:00
parent 04ed5d62dd
commit ad2a87d317
6 changed files with 127 additions and 66 deletions

View File

@ -1,9 +1,10 @@
''' bookwyrm settings and configuration '''
import os
from environs import Env
import requests
from django.utils.translation import gettext_lazy as _
env = Env()
DOMAIN = env('DOMAIN')
@ -27,6 +28,7 @@ EMAIL_USE_TLS = env('EMAIL_USE_TLS', True)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale'),]
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
@ -58,6 +60,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',