Problems with slugs in multi language website

Hi,
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 https://learn.getgrav.org/content/multi-language#multi-language-routing, so I configured the system.yaml as follows:

languages:
  translations: true
  include_default_lang: false
  supported:
    - it
    - en

then I configured the ‘basic.it.md’ italian page header as follows:

title: Il titolo
slug: collezione
menu: Collezione

then the ‘basic.en.md’ 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).

cheers

1 Like