diff --git a/artel/artel/settings/base.py b/artel/artel/settings/base.py index 2570898..45c052b 100644 --- a/artel/artel/settings/base.py +++ b/artel/artel/settings/base.py @@ -30,6 +30,7 @@ INSTALLED_APPS = [ "search", "wagtail.contrib.forms", "wagtail.contrib.redirects", + "wagtail.contrib.simple_translation", "wagtail.embeds", "wagtail.sites", "wagtail.users", @@ -41,6 +42,7 @@ INSTALLED_APPS = [ 'wagtail.contrib.modeladmin', "wagtail", "wagtailmenus", + 'wagtail.locales', "modelcluster", "taggit", "django.contrib.admin", @@ -62,6 +64,7 @@ MIDDLEWARE = [ "django.middleware.clickjacking.XFrameOptionsMiddleware", "django.middleware.security.SecurityMiddleware", "wagtail.contrib.redirects.middleware.RedirectMiddleware", + 'django.middleware.locale.LocaleMiddleware', ] ROOT_URLCONF = "artel.urls" @@ -77,6 +80,7 @@ TEMPLATES = [ "context_processors": [ "django.template.context_processors.debug", "django.template.context_processors.request", + 'django.template.context_processors.i18n', "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", 'wagtailmenus.context_processors.wagtailmenus', @@ -132,6 +136,12 @@ USE_L10N = True USE_TZ = True +WAGTAIL_I18N_ENABLED = True + +WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [ + ('en', "English"), + ('pl', "Polish"), + ] # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.1/howto/static-files/ diff --git a/artel/artel/templates/menu/custom_main_menu.html b/artel/artel/templates/menu/custom_main_menu.html index 56e8d8f..e19c353 100644 --- a/artel/artel/templates/menu/custom_main_menu.html +++ b/artel/artel/templates/menu/custom_main_menu.html @@ -1,22 +1,29 @@ -{% load static %} +{% load static %} {% load menu_tags %} - +{% load wagtailcore_tags %}