Problems with slugs in multi language website

I’m working on a multi-languages site powered by 1.1.5 Grav and something is not working with slugs. I want to follow the approach explained here, so I configured the system.yaml as follows:

  translations: true
  include_default_lang: false
    - it
    - en

then I configured the ‘’ italian page header as follows:

title: Il titolo
slug: collezione
menu: Collezione

then the ‘’ as follows:

title: The title
slug: collection
menu: Collection 

Next, I added the langswitcher plugin and when I click the English language the browser points to ‘en/collezione’ route instead of the expected ‘/collection’

What I’m doing wrong?

LangSwitcher to determine the other page URL uses the raw route (not the slug you defined). You probably have the page folder named /pages/collezione as italian is the default language

Yes, I have a 02.collezione page in my website but, according with Grav documentation, when I configured the switch include default lang the slug /collection without the language, so /en/collection, should exist but it doesn’t. Next, the LangSwitcher should point the slug not the raw route.

No one could help? @rhukster @flaviocopes?

Hi, i had the same problem. Try to enable the “redirect default route” (in the configuration) which will redirect to the default route for the page (including custom slugs).


1 Like