# Can Hugo mark the current language for all pages?

**URL:** <https://discourse.gohugo.io/t/can-hugo-mark-the-current-language-for-all-pages/35706>\
**Category:** support\
**Created:** [November 22, 2021, 10:03am UTC](https://discourse.gohugo.io/t/can-hugo-mark-the-current-language-for-all-pages/35706 "2021-11-22T10:03:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rzhn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rzhn/32/15653_2.png) [@rzhn](https://discourse.gohugo.io/u/rzhn)\
**Post date:** [November 22, 2021, 10:03am UTC](https://discourse.gohugo.io/t/can-hugo-mark-the-current-language-for-all-pages/35706/1 "2021-11-22T10:03:22Z")

</div>

Hi, I have a problem with the multilingual mode. By changing the pages, the language set to default language. Can Hugo mark the current language for all pages?

```auto
<select id="select-language" onchange="location = this.value;" class="language-selector">
	{{ $siteLanguages := .Site.Languages}}
	{{ $pageLang := .Page.Lang}}
	{{ range .Page.AllTranslations }}
	  {{ $translation := .}}
	  {{ range $siteLanguages }}
	    {{ if eq $translation.Lang .Lang }}
	      {{ if eq $pageLang .Lang}}
	        <option id="{{ $translation.Language }}" value="{{ $translation.URL }}" selected>{{ .LanguageName }}</option>
	      {{ else }}
		<option id="{{ $translation.Language }}" value="{{ $translation.URL }}">{{ .LanguageName }}</option>
	      {{ end }}
	    {{ end }}
	  {{ end }}
	{{ end }}
</select>

```

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [November 22, 2021, 10:49am UTC](https://discourse.gohugo.io/t/can-hugo-mark-the-current-language-for-all-pages/35706/2 "2021-11-22T10:49:45Z")

</div>

I have a section with English content.  
section \_index.md frontmatter:

```auto
+++

[[cascade]]
Language = "en"
+++

```

more hee

> **[Front Matter](https://gohugo.io/content-management/front-matter#front-matter-cascade)**
>
> Hugo allows you to add front matter in yaml, toml, or json to your content files.

---

<div class="post-metadata">

**Author:** ![AlfredoRamos](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/alfredoramos/32/14724_2.png) [@AlfredoRamos](https://discourse.gohugo.io/u/AlfredoRamos)\
**Post date:** [November 23, 2021, 3:33am UTC](https://discourse.gohugo.io/t/can-hugo-mark-the-current-language-for-all-pages/35706/3 "2021-11-23T03:33:52Z")

</div>

How and where you are linking your pages?

Because using `.Permalink` / `.Relpermalink` would give you the URL of the current language.

You could also use `relLangURL` / `absLangURL`

Inside your posts you can use the `ref` / `relref` shortcode, like so:

```markdown
[Link]({{<relref "some-page">}})

```

And it would also give you the correct URL of the selected language.

> **[Multilingual Mode](https://gohugo.io/content-management/multilingual/#multilingual-themes-support)**
>
> Hugo supports the creation of websites with multiple languages side by side.

> **[relLangURL](https://gohugo.io/functions/rellangurl/)**
>
> Adds the relative URL with correct language prefix according to site configuration for multilingual.

> **[absLangURL](https://gohugo.io/functions/abslangurl/)**
>
> Adds the absolute URL with correct language prefix according to site configuration for multilingual.

> **[Links and Cross References](https://gohugo.io/content-management/cross-references/)**
>
> Shortcodes for creating links to documents.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [January 10, 2022, 1:36pm UTC](https://discourse.gohugo.io/t/can-hugo-mark-the-current-language-for-all-pages/35706/4 "2022-01-10T13:36:27Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
