Translations works properly now
rodzic
d66379c440
commit
d0d77956ad
|
@ -43,6 +43,8 @@ INSTALLED_APPS = [
|
|||
"blog",
|
||||
"search",
|
||||
"setup",
|
||||
"wagtail_localize",
|
||||
"wagtail_localize.locales",
|
||||
"wagtail.contrib.forms",
|
||||
"wagtail.contrib.redirects",
|
||||
"wagtail.contrib.simple_translation",
|
||||
|
@ -57,7 +59,6 @@ INSTALLED_APPS = [
|
|||
'wagtail.contrib.modeladmin',
|
||||
"wagtail",
|
||||
"wagtailmenus",
|
||||
'wagtail.locales',
|
||||
"modelcluster",
|
||||
"taggit",
|
||||
"django.contrib.admin",
|
||||
|
@ -84,8 +85,8 @@ MIDDLEWARE = [
|
|||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
|
||||
'django.middleware.locale.LocaleMiddleware'
|
||||
'django.middleware.locale.LocaleMiddleware',
|
||||
"wagtail.contrib.redirects.middleware.RedirectMiddleware"
|
||||
]
|
||||
|
||||
ROOT_URLCONF = "artel.urls"
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
{% for translation in page.get_translations.live %}
|
||||
<a class="dropdown-item text-center" href="{% pageurl translation.specific %}"" rel="alternate" hreflang="{{ translation.locale.language_code }}">
|
||||
<a class="dropdown-item text-center" href="{% pageurl translation %}"" rel="alternate" hreflang="{{ translation.locale.language_code }}">
|
||||
{{translation.locale.language_code | language_name}}
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
|
|
@ -23,17 +23,10 @@ urlpatterns = [
|
|||
path("django-admin/", admin.site.urls),
|
||||
path("admin/", include(wagtailadmin_urls)),
|
||||
path("documents/", include(wagtaildocs_urls)),
|
||||
path("search/", search_views.search, name="search"),
|
||||
path('store-app/', include('store.urls')),
|
||||
path('setup/', include('setup.urls')),
|
||||
]
|
||||
|
||||
urlpatterns += i18n_patterns(
|
||||
path('search/', search_views.search, name='search'),
|
||||
path("store-app/", include("store.urls")),
|
||||
path("", include(wagtail_urls)),
|
||||
)
|
||||
|
||||
if settings.DEBUG:
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
|
@ -43,12 +36,7 @@ if settings.DEBUG:
|
|||
urlpatterns += static(settings.MEDIA_URL,
|
||||
document_root=settings.MEDIA_ROOT)
|
||||
|
||||
urlpatterns = urlpatterns + [
|
||||
# For anything not caught by a more specific rule above, hand over to
|
||||
# Wagtail's page serving mechanism. This should be the last pattern in
|
||||
# the list:
|
||||
urlpatterns = urlpatterns + i18n_patterns(
|
||||
path('search/', search_views.search, name='search'),
|
||||
path("", include(wagtail_urls)),
|
||||
# Alternatively, if you want Wagtail pages to be served from a subpath
|
||||
# of your site, rather than the site root:
|
||||
# path("pages/", include(wagtail_urls)),
|
||||
]
|
||||
)
|
||||
|
|
|
@ -15,3 +15,4 @@ easy_thumbnails==2.8.5
|
|||
num2words==0.5.12
|
||||
sentry-sdk==1.28.0
|
||||
pandas==2.0.3
|
||||
wagtail-localize==1.5.2
|
||||
|
|
Ładowanie…
Reference in New Issue