Defining a slug in multilingual mode does not seem to work

I am trying to get the slugs of my site to be adapted for each language.

Based on this section of the documentation, it is possible to define a different slug for a secondary language using the slug = "my-new-slug" in frontmatter.

The example uses the following structure:
/content/about.md
/content/about.fr.md

My site structure however is different and uses an _index.md for each section of the site, resulting in the following structure:

└── content
    |   └── _index.md    ==> /
    |   └── _index.fr.md   ==> /fr/
    └── about
    |   └── _index.md    ==> /about/
    |   └── _index.fr.md  ==> /fr/about/
    ├── contact
    |   └── _index.md    ==> /contact/
    |   └── _index.fr.md  ==> /fr/contact/
    ...

The problem with this is that defining the slug="a-propos" in about/_index.fr.md for example - or any of these files - does not seem to work for me.
Is this a known issue or am I missing something?

Thanks

EDIT: I’m using the following version of Hugo
Hugo Static Site Generator v0.26-DEV linux/amd64 BuildDate: 2017-07-11T08:53:51Z

I faced this problem with Hugo v0.25.1, but it gone away.
It’s a pity that I did not catch exactly what behavior caused this (I just explored HUGO and I am in first dirty&rapid learning cycle ;-), but I got feeling that there could be two reasons:

  • when I changed menus in config.toml, than if I use hugo server, than it is better to restart it
  • another is that I had some problem in the same config.toml

If I’ll catch - I’ll try to note.

OK great - I also have multilingual menus in config. If you tell me that it worked for you, I’ll keep on trying. I also restart hugo most of the time when I do such changes, but it didn’t resolve my issue so far.

Do you guys have this in a pubilc repo to look at?

I am looking at a multiple language small website boilerplater example to start a webpage with.

I don’t have it in a public repo unfortunately.

For the record, this is what is in the doc, so it might be the issue…

Hugo currently uses the base filename as the translation key, which can be an issue with identical filenames in different sections. We will fix this in .IsTranslated behaviour with identical filenames · Issue #2699 · gohugoio/hugo · GitHub

This is the same issue as mentioned here: How to translate sections?
@janekska does your configuration still work correctly in these cases?

I managed to do so.

Hugo Static Site Generator v0.31.1 linux/amd64 BuildDate: 2017-11-27T13:26:24+02:00

My case:
/content/page/about.en.md
/content/page/about.lv.md

I used slug with absolute path in /content/page/about.lv.md
slug: “…/lapa/parko”

If I use just
slug: "parko"
I’ll get http://wwwroot/lv/page/parko

It was a bit confusing when using menus, because they are relative to current page or with “…/” to web/server root while slug to language root, f.ex. http://wwwroot/lv/
And watch out - if you not use absolute urls with "…/section/page your menus will become like …/section/page/section/page when you click in you page.

I hope I had not mess the terms in English an it helps.

Your case is different: you’re changing a slug to an article inside the ‘page’ section. @pascal and I are trying to localize the slug for the section itself (in my case site.com/news/ for English and site.ru/новости/ for Russian), so all menus and other links/internal variables will work correctly.

Looks like most of the frontmatter variables from _index* pages are treated correctly, but not a ‘slug’ or ‘url’. And I also saw an issue that ‘type’ and ‘layout’ are also not supported yet for section’s _index.md files.