# Multilingual permalinks with relLangURL and custom slug

**URL:** <https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231>\
**Category:** support\
**Created:** [November 10, 2018, 11:53pm UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231 "2018-11-10T23:53:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dangelion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dangelion/32/7251_2.png) [@dangelion](https://discourse.gohugo.io/u/dangelion)\
**Post date:** [November 10, 2018, 11:53pm UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231/1 "2018-11-10T23:53:18Z")

</div>

Hi, I’m building a multilingual site. Here the files I’m working on:

**config.toml**

```
...
# Disable errors in browser because of symlink error
# https://discourse.gohugo.io/t/symlinks-error-blocks-site-rendering-in-hugo-server-in-0-50/14962
disableBrowserError = true

#
# Multilingual
#
DefaultContentLanguage = "it"

[languages]
  [languages.it]
    languageName = "Italiano"
    weight = 0

  [languages.en]
    languageName = "English"
    weight = 1

```

**content/contatti.it.md (italian is default language)**

```
---
title: Contatti
---

```

**content/contatti.en.md**

```
---
title: Contact
slug: "contact" # rewriting the slug
---

```

**themes/my-theme/layouts/index.html**

```
...
<a href="{{ "contatti/" | relLangURL }}">{{ i18n "home" }}</a>
...

```

Now opening the site in italian I see the rendered link is:  
`<a href="/contatti/">Casa</a>`  
and in english it’s  
`<a href="/en/contatti/">Home</a>`  
while it should be (or I would be):  
`<a href="/en/contact/">Casa</a>`

Someone can help me?  
Thanks

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [November 11, 2018, 6:10am UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231/2 "2018-11-11T06:10:01Z")

</div>

We need a bit more info to be able to help you, so please have a look at [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132) and provide some more details? If you can provide a link to your repo that would be great, but at least I think it would be helpful to see your `config` file. Thanks.

---

<div class="post-metadata">

**Author:** ![dangelion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dangelion/32/7251_2.png) [@dangelion](https://discourse.gohugo.io/u/dangelion)\
**Post date:** [November 11, 2018, 3:57pm UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231/3 "2018-11-11T15:57:35Z")

</div>

Hi Rick, I updated the first post adding info about the config file. At the moment I haven’t a repository. Let me know if you need other infos. Thanks

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [November 11, 2018, 8:16pm UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231/4 "2018-11-11T20:16:34Z")

</div>

Hmm @dangelion, it looks correct. Try adding the `slug` param to `content/contatti.it.md`?

---

<div class="post-metadata">

**Author:** ![dangelion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dangelion/32/7251_2.png) [@dangelion](https://discourse.gohugo.io/u/dangelion)\
**Post date:** [November 12, 2018, 8:34am UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231/5 "2018-11-12T08:34:08Z")

</div>

Tried but it’s the same. It renders the link as `/en/contatti/`that gives a 404… in your projects instead it works as expected?

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [November 12, 2018, 9:41am UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231/6 "2018-11-12T09:41:18Z")

</div>

I haven’t tried localizing slugs yet, I’m afraid.

---

<div class="post-metadata">

**Author:** ![nfriedli](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nfriedli/32/26027_2.png) [@nfriedli](https://discourse.gohugo.io/u/nfriedli)\
**Post date:** [November 12, 2018, 9:57am UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231/7 "2018-11-12T09:57:27Z")

</div>

> [@dangelion](#):
>
> \<a href=“{{ “contatti/” | relLangURL }}”\>{{ i18n “home” }}\</a\>

Your “contatti” character chain is hard coded… Not really nice.  
Please have a look at [Multilingual mode | Hugo](https://gohugo.io/content-management/multilingual/#list-all-available-languages)

A testing (or Work in Progress) site I made: [https://github.com/nfriedli/chez-olivia-et-pascal.ch/](https://github.com/nfriedli/chez-olivia-et-pascal.ch/)

---

<div class="post-metadata">

**Author:** ![Bfredo123](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Bfredo123](https://discourse.gohugo.io/u/Bfredo123)\
**Post date:** [September 7, 2023, 9:01pm UTC](https://discourse.gohugo.io/t/multilingual-permalinks-with-rellangurl-and-custom-slug/15231/8 "2023-09-07T21:01:28Z")

</div>

Hi I have the same issue as dangelion.

Has someone found a solution?

It should be something quite common, right?

It looks like relLangURL simply prepends the language to the provided URL, and does not replace the slug if it has been overridden in the translated page.

I could not find other functions that behave smarter.

Many thanks!
