From 91fd29ceb1db4d2d45626ff13627014ceedd66a6 Mon Sep 17 00:00:00 2001 From: PierreC Date: Fri, 17 May 2024 15:28:37 +0200 Subject: [PATCH] add i18n dynamic url --- pod/urls.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pod/urls.py b/pod/urls.py index 7a97acf666..84b6d17170 100644 --- a/pod/urls.py +++ b/pod/urls.py @@ -9,6 +9,7 @@ from django.contrib.auth import views as auth_views from django.views.i18n import JavaScriptCatalog from django.utils.translation import ugettext_lazy as _ +from django.conf.urls.i18n import i18n_patterns import importlib.util @@ -53,12 +54,8 @@ # Maintenance mode url(r"^maintenance/$", maintenance, name="maintenance"), # videos - url(r"^videos/", include("pod.video.urls-videos")), url(r"^rss", include("pod.video.urls-rss")), - url(r"^video/", include("pod.video.urls")), url(r"^ajax_calls/search_user/", user_autocomplete), - # my channels - url(r"^channels/", include("pod.video.urls-channels")), # recording url(r"^record/", include("pod.recorder.urls")), # search @@ -93,6 +90,14 @@ url("", include("pwa.urls")), ] +# i18n urls +urlpatterns += i18n_patterns( + url(r"^videos/", include("pod.video.urls-videos")), + url(r"^video/", include("pod.video.urls")), + # my channels + url(r"^channels/", include("pod.video.urls-channels")), +) + # WEBPUSH if USE_NOTIFICATIONS: urlpatterns += [ @@ -164,9 +169,9 @@ # PLAYLIST if USE_PLAYLIST: - urlpatterns += [ + urlpatterns += i18n_patterns( path("playlist/", include("pod.playlist.urls", namespace="playlist")), - ] + ) # DRESSING if USE_DRESSING: @@ -190,9 +195,9 @@ ] # CHANNELS -urlpatterns += [ +urlpatterns += i18n_patterns( url(r"^", include("pod.video.urls-channels-video")), -] +) # Change admin site title admin.site.site_header = _("Pod Administration")