---
title: 'How to correctly set a default language?'
url: 'https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356'
markdown: 'https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356.md'
date: '2026-06-21'
description: 'I have define default lang with another codet than en, but the main language continues to be set as <html lang="en"> in the code source. Therefore, I suppose'
---

[Themes & Styling](https://getgrav.org/forum/themes-styling)

#   How to correctly set a default language? 

 Solved by Peter Fuchs [View solution](https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356#post-20108)

  Started by P. Mergey 9 years ago · 6 replies · 5215 views    

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356#post-20072 "Permalink") 

I have define `default lang` with another codet than `en`, but the main language continues to be set as `<html lang="en">` in the code source.

Therefore, I suppose that we can deduct that `default lang` does not populate the `grav.language.getLanguage` variable.

In this case, where is the right way to set specifically `grav.language.getLanguage`?

I found different threads about this variable (such as: /forum/archive/set-html-lang-de-t3738 or /forum/archive/get-current-language-issue-t6492 or /forum/archive/how-would-i-get-the-current-language-t504, but none of them seems to answer about this (basics) question (or maybe I have missed something that you will point me out).

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356#post-20093 "Permalink") 

Hi
How are you setting the default lang cause the easiest way is with the language switcher [plugin](https://github.com/getgrav/grav-plugin-langswitcher)? That should just work out of the box....

For just a one-off setup you can set the default in user/config/site.yaml
`default_lang: en`

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356#post-20100 "Permalink") 

The plugin that you have indicated seems to be made for switching *more specifically* between *multiple languages*, but I aim to set an unique language (which is not the default `en` codet).

I have already changed the configuration in the `user/config/site.yaml` file as you wrote, but this parameter seems to not been used as expected: the main language continues to be displayed as `<html lang="en">` in the code source.

As the theme ([Mediator](https://github.com/getgrav/grav-theme-mediator)) that I am currently trying to set up is using the same the same variable as the [Antimatter](https://github.com/getgrav/grav-theme-antimatter) default theme (i.e. `<html lang="{{ grav.language.getLanguage ?: 'en' }}">` in the file named `base.html.twig`), I have some difficulties to see if this problem is originated from the theme, from my settings or from the main installation of Grav.

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356#post-20103 "Permalink") 

Hi @gizmecano,

did you try to set the default language in your `user/config/system.yaml` like this (example) ?:

```yaml
languages:
  supported:
    - fr
```

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356#post-20106 "Permalink") 

Yes, I did. But this option adds the supported language codet in the URL (i.e.: `http://yoursite.com/fr`) as described in [Active Language via URL](https://learn.getgrav.org/content/multi-language#active-language-via-url) in the documentation.

It is not the behaviour that I expect: I simply want all the content of my site uses only another default language than `en`.

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356#post-20108 "Permalink")  Solution 

Ok, I tried it with one of my local installations with this configuration:

```yaml
languages:
  supported:
    - fr
  include_default_lang: false
```

This works fine for me:

- No language code in the URL
- This starting html tag: `<html lang="fr">`

As far as i understand the documention that you mentioned above it is possible to choose a language manually by adding the language code to the URL if you have more than one language.

 👍 1 

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-correctly-set-a-default-language-t1356#post-20109 "Permalink") 

Well done, this is the correct setting combination I was looking for. Thanks.

[Log in](https://getgrav.org/login?return=%2Fforum%2Fthemes-styling%2Fhow-to-correctly-set-a-default-language-t1356) to reply.

###  Suggested topics

 | Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| [Modular Page Background Image Display](https://getgrav.org/forum/themes-styling/modular-page-background-image-display-t9486)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by TomW, 2 weeks ago |  | 2 | 200 | [2 days ago](https://getgrav.org/forum/themes-styling/modular-page-background-image-display-t9486 "by TomW") |
| [Inheriting a Theme does not quite work correctly](https://getgrav.org/forum/themes-styling/inheriting-a-theme-does-not-quite-work-correctly-t9501)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by themetman, 3 days ago |  | 0 | 48 | [3 days ago](https://getgrav.org/forum/themes-styling/inheriting-a-theme-does-not-quite-work-correctly-t9501 "by themetman") |
| [\[quark\] mobile menu as the modular page menu](https://getgrav.org/forum/themes-styling/quark-mobile-menu-as-the-modular-page-menu-t1132)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by Bruno, 4 years ago |  | 4 | 1320 | [3 days ago](https://getgrav.org/forum/themes-styling/quark-mobile-menu-as-the-modular-page-menu-t1132 "by AH") |
| [Grav2 with Quark2 – All pages in the hamburger-menu of a one-pager](https://getgrav.org/forum/themes-styling/grav2-with-quark2-all-pages-in-the-hamburger-menu-of-a-one-pager-t9485)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by AH, 2 weeks ago |  | 0 | 173 | [2 weeks ago](https://getgrav.org/forum/themes-styling/grav2-with-quark2-all-pages-in-the-hamburger-menu-of-a-one-pager-t9485 "by AH") |
| [Is it a way to get the "content - summary" in a twig template ?](https://getgrav.org/forum/themes-styling/is-it-a-way-to-get-the-content-summary-in-a-twig-template-t9431)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by FrViPofm, 2 months ago |  | 4 | 667 | [1 month ago](https://getgrav.org/forum/themes-styling/is-it-a-way-to-get-the-content-summary-in-a-twig-template-t9431 "by Paul Hibbitts") |
