Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] add i18n dynamic url #1135

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions pod/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 += [
Expand Down Expand Up @@ -164,9 +169,9 @@

# PLAYLIST
if USE_PLAYLIST:
urlpatterns += [
urlpatterns += i18n_patterns(
path("playlist/", include("pod.playlist.urls", namespace="playlist")),
]
)

# DRESSING
if USE_DRESSING:
Expand All @@ -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")
Expand Down
Loading