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 %}

@@ -24,6 +31,3 @@
Koszyk - - - \ No newline at end of file diff --git a/artel/artel/urls.py b/artel/artel/urls.py index 720ae2a..13a1618 100644 --- a/artel/artel/urls.py +++ b/artel/artel/urls.py @@ -1,6 +1,6 @@ from django.conf import settings from django.urls import ( - include, + include, path ) from django.contrib import admin @@ -10,6 +10,8 @@ from wagtail.admin import urls as wagtailadmin_urls from wagtail import urls as wagtail_urls from wagtail.documents import urls as wagtaildocs_urls +from django.conf.urls.i18n import i18n_patterns + from search import views as search_views urlpatterns = [ @@ -20,6 +22,12 @@ urlpatterns = [ path("store-app/", include("store.urls")) ] +urlpatterns += i18n_patterns( + path('search/', search_views.search, name='search'), + path("", include(wagtail_urls)), + path("search/", search_views.search, name="search"), + path("store-app/", include("store.urls")) +) if settings.DEBUG: from django.conf.urls.static import static