Localization and several UI changes #51

Open
rskthomas wants to merge 55 commits from ux-changes_rebase into main
2 changed files with 24 additions and 3 deletions
Showing only changes of commit 449fdacd02 - Show all commits

View file

@ -65,7 +65,9 @@ ENABLE_EMAIL = config("ENABLE_EMAIL", default=True, cast=bool)
EVIDENCES_DIR = config("EVIDENCES_DIR", default=os.path.join(BASE_DIR, "db")) EVIDENCES_DIR = config("EVIDENCES_DIR", default=os.path.join(BASE_DIR, "db"))
LOCALE_PATHS = [
os.path.join(BASE_DIR, 'locale'),
]
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
@ -119,7 +121,13 @@ TEMPLATES = [
"django.template.context_processors.request", "django.template.context_processors.request",
"django.contrib.auth.context_processors.auth", "django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages", "django.contrib.messages.context_processors.messages",
"django.template.context_processors.i18n",
], ],
'libraries':{
'get_language_code': 'dashboard.templatetags.language_code',
}
}, },
}, },
] ]
@ -172,8 +180,9 @@ if TIME_ZONE == "UTC":
USE_L10N = True USE_L10N = True
LANGUAGES = [ LANGUAGES = [
('es', 'Spanish'), ('es', 'spanish'),
('en', 'English'), ('en', 'english'),
('ca', 'català'),
] ]
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)

View file

@ -16,6 +16,10 @@ Including another URLconf
""" """
from django.conf import settings from django.conf import settings
from django.urls import path, include from django.urls import path, include
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.conf.urls.static import static
from django.views.i18n import set_language
urlpatterns = [ urlpatterns = [
# path('api/', include('snapshot.urls')), # path('api/', include('snapshot.urls')),
@ -35,3 +39,11 @@ if settings.DPP:
path('dpp/', include('dpp.urls')), path('dpp/', include('dpp.urls')),
path('did/', include('did.urls')), path('did/', include('did.urls')),
]) ])
urlpatterns += i18n_patterns(
path("language/", set_language, name='set_language'),
)
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)