stub out some i18n
This commit is contained in:
@ -27,14 +27,19 @@ from django.urls import reverse
|
||||
#import datetime as DT
|
||||
#from django.db.models import Q
|
||||
|
||||
from django.contrib import messages
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
#from .forms import SourceForm, DestinationForm, PostForm, MoverForm, ClaimForm, SourceLoginForm, MoverLoginForm, CustomFormDestination
|
||||
#from .models import Source, Destination, Post, Mover, Claim
|
||||
|
||||
|
||||
def dashboard(request):
|
||||
return render(request, 'dashboard/index.html', {})
|
||||
#messages.info(request, 'Three credits remain in your account.')
|
||||
return render(request, 'dashboard/index.html')
|
||||
|
||||
def unused(request):
|
||||
return HttpResponse("Hello, world.")
|
||||
return HttpResponse(_("Hello, world."))
|
||||
|
||||
# def sources(request):
|
||||
# sources = Source.objects.all()
|
||||
|
||||
@ -46,6 +46,7 @@ MIDDLEWARE = [
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'django.middleware.locale.LocaleMiddleware',
|
||||
'procat2.middleware.SetApplicationName',
|
||||
]
|
||||
|
||||
@ -102,18 +103,12 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/2.1/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
|
||||
TIME_ZONE = 'UTC'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_L10N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ from django.urls import include, path
|
||||
from dashboard.views import dashboard
|
||||
|
||||
urlpatterns = [
|
||||
path('', dashboard, name='root'),
|
||||
path('', dashboard, name='home'),
|
||||
path('dashboard', dashboard, name='dashboard'),
|
||||
path('admin/', admin.site.urls),
|
||||
path('accounts/', include('django.contrib.auth.urls')),
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Dashboard{% endblock %}
|
||||
{% block title %} trans "Dashboard"{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Dashboard</h2>
|
||||
<h2>{% trans "Dashboard" %}</h2>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user