# Html lang attribute missing

**URL:** <https://forum.getkirby.com/t/html-lang-attribute-missing/14540>\
**Category:** Questions\
**Tags:** v3\
**Created:** [June 10, 2019, 6:00pm UTC](https://forum.getkirby.com/t/html-lang-attribute-missing/14540 "2019-06-10T18:00:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![svenje](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@svenje](https://forum.getkirby.com/u/svenje)\
**Post date:** [June 10, 2019, 6:00pm UTC](https://forum.getkirby.com/t/html-lang-attribute-missing/14540/1 "2019-06-10T18:00:15Z")

</div>

I have a kirby 3 project with 2 languages, DE and EN and the html lang attribute in the browser code is empty.

I tried already: [Multi-language site and HTML lang tag](https://forum.getkirby.com/t/multi-language-site-and-html-lang-tag/4878) but doesn’t solve the problem.

Default language DE and secondary language EN are activated in the panel and everything works.

Asking me if this declaration in the header snippet is correct or how to bring the lang code definition into this.

site/snippets/header.php:

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 10, 2019, 6:05pm UTC](https://forum.getkirby.com/t/html-lang-attribute-missing/14540/2 "2019-06-10T18:05:34Z")

</div>

Like in the example, but not $site but $kirby for Kirby 3

---

<div class="post-metadata">

**Author:** ![svenje](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@svenje](https://forum.getkirby.com/u/svenje)\
**Post date:** [June 10, 2019, 6:15pm UTC](https://forum.getkirby.com/t/html-lang-attribute-missing/14540/3 "2019-06-10T18:15:17Z")

</div>

Thnx Sonja! this code solves the problem:

`<html lang="<?php echo $kirby->language()->code() ?>">`

---

<div class="post-metadata">

**Author:** ![warg](https://avatars.discourse-cdn.com/v4/letter/w/90ced4/32.png) [@warg](https://forum.getkirby.com/u/warg)\
**Post date:** [June 13, 2019, 12:13pm UTC](https://forum.getkirby.com/t/html-lang-attribute-missing/14540/4 "2019-06-13T12:13:54Z")

</div>

Is there a way to generate the HTML’s `lang` attribute without running a mutli-language setup? I just set up a one-language multi-language setup because I don’t want to hardcode the language into the template and I found no way without introducing a language field for a page or to get the language of the #1 admin user.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 13, 2019, 12:24pm UTC](https://forum.getkirby.com/t/html-lang-attribute-missing/14540/5 "2019-06-13T12:24:54Z")

</div>

If you want to make it customisable, you can set up a field in `site.yml` or add an option in your `config.php`.
