diff --git a/arches_lingo/urls.py b/arches_lingo/urls.py index cdd0a237..6c52ba91 100644 --- a/arches_lingo/urls.py +++ b/arches_lingo/urls.py @@ -6,9 +6,17 @@ from arches_lingo.views import ConceptTreeView urlpatterns = [ - path('', include('arches.urls')), + path("", include("arches.urls")), path("concept_trees/", ConceptTreeView.as_view(), name="concept_trees"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -# if settings.SHOW_LANGUAGE_SWITCH is True: -# urlpatterns = i18n_patterns(*urlpatterns) +# Only handle i18n routing in active project. This will still handle the routes provided by Arches core and Arches applications, +# but handling i18n routes in multiple places causes application errors. +if ( + settings.APP_NAME != "Arches" + and settings.APP_NAME not in settings.ARCHES_APPLICATIONS +): + if settings.SHOW_LANGUAGE_SWITCH is True: + urlpatterns = i18n_patterns(*urlpatterns) + + urlpatterns.append(path("i18n/", include("django.conf.urls.i18n")))