Hello again Samir,

I noticed this is related to my previous post. If I am in a product 
directory and change the language, I am redirected to that same product in 
the new language selected.

Now if am at the root and change the language, I am redirected to 
/catalogue ( in the new language).

In this specific case I want to remain at the root directory(with the new 
language). All the others cases seem to be working correctly.

here is my urls.py main file:

from Store import views
urlpatterns = [
    url(r'^$', views.home, name ='home'),
    url(r'^sobre-nos/$', views.about, name ='about'),
    url(r'^dashboard/translation$',views.dashboard_translation, 
name="dashboard_translation"),
    url(r'^dashboard/sobre-nos/$', views.sobre_nos, 
name='dashboard-sobre-nos'),
    url(r'^dashboard/bem-estar/$', views.bem_estar, 
name='dashboard-bem-estar'),
    url(r'^dashboard/home-page/$', views.home_page, 
name='dashboard-home-page'),

]

from django.contrib.sitemaps import views

urlpatterns += [



    path('store/', include('Store.urls')),

    path('bem-estar/', include('myblog.urls')),
    path('ckeditor/', include('ckeditor_uploader.urls')),
    path('i18n/', include('django.conf.urls.i18n')),  # > Django-2.0
    path('admin/', admin.site.urls),  # > Django-2.0

    path('', include(apps.get_app_config('oscar').urls[0])),  # > Django-2.0


    url(r'^sitemap\.xml$', views.index,
        {'sitemaps': base_sitemaps}),
    url(r'^sitemap-(?P<section>.+)\.xml$', views.sitemap,
        {'sitemaps': base_sitemaps},
        name='django.contrib.sitemaps.views.sitemap'),



]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)



I had to do this because oscar root is redirected to /catalogue.
But now when I am at the root and switch language, I continue to be 
redirected to /catalogue




quarta-feira, 22 de Janeiro de 2020 às 12:56:58 UTC, Samir Shah escreveu:
>
> That seems to be what you would want? So the next URL is set to be the 
> same as the current URL without the language code. You should then get 
> redirected to the new language code with this URL path appended. 
>
> On Wed, 22 Jan 2020, 15:36 Yahiba, <yahi...@gmail.com <javascript:>> 
> wrote:
>
>> Hello again Samir,
>>
>> I now noticed the the {{ language_neutral_url_path }} will be equal to 
>> the directory I am on, so previously it was just a slash ( / ) because I 
>> was in the root directory, so if I switch to the catalogue it will be ( 
>> /catalogue/ ) 
>>
>>
>>
>> I have the following configurations:
>>
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> USE_TZ = True
>>
>>
>> I tried turnig False USE_I18N but then the language switching does not 
>> work.
>>
>>
>>
>> quarta-feira, 22 de Janeiro de 2020 às 11:53:04 UTC, Samir Shah escreveu:
>>>
>>> I'm not too sure what the issue is then. Do you have `USE_I18N` set to 
>>> True in your settings? That is the only other thing that would 
>>> short-circuit the context variable.
>>>
>> -- 
>> https://github.com/django-oscar/django-oscar
>> http://django-oscar.readthedocs.org/en/latest/
>> https://twitter.com/django_oscar
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "django-oscar" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-oscar/QPsfCnbbuzU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django...@googlegroups.com <javascript:>.
>> To view this discussion on the web, visit 
>> https://groups.google.com/d/msgid/django-oscar/27a96c67-3ba5-4764-bc31-9e5b8330f2b6%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-oscar/27a96c67-3ba5-4764-bc31-9e5b8330f2b6%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
--- 
You received this message because you are subscribed to the Google Groups 
"django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-oscar+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-oscar/c8cfd2b5-dd8d-4c32-8714-ef880c465219%40googlegroups.com.

Reply via email to