# Language.detect doesn't work

**URL:** <https://forum.getkirby.com/t/language-detect-doesnt-work/14127>\
**Category:** Questions\
**Tags:** v3\
**Created:** [May 8, 2019, 8:11am UTC](https://forum.getkirby.com/t/language-detect-doesnt-work/14127 "2019-05-08T08:11:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![judbd](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/judbd/32/1303_2.png) [@judbd](https://forum.getkirby.com/u/judbd)\
**Post date:** [May 8, 2019, 8:11am UTC](https://forum.getkirby.com/t/language-detect-doesnt-work/14127/1 "2019-05-08T08:11:35Z")

</div>

I made a multilingual [website](https://www.cyberspace.builders) with French by default and English as secondary language. I set the generic `config.php` with `languages.detect` as stated by the documentation but it doesn’t work (tested by friends with English browers, by me with a language switcher Firefox add-on, with deleted cookies and private mode.

The documentation on this point just say to add this option so I don’t really now how to test it further or knowing if I did the good thing.

Did I miss something?

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [May 8, 2019, 11:52am UTC](https://forum.getkirby.com/t/language-detect-doesnt-work/14127/2 "2019-05-08T11:52:20Z")

</div>

Are you sure `languages.detect` is for Kirby 3?

I only find `$kirby->detectedLanguage()` [in the docs](https://getkirby.com/docs/reference/objects/kirby/detected-language).

---

<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:** [May 8, 2019, 11:55am UTC](https://forum.getkirby.com/t/language-detect-doesnt-work/14127/3 "2019-05-08T11:55:01Z")

</div>

Yes, but the option is called `languages.detect`, it is queried here: [https://github.com/getkirby/kirby/blob/c9dcfb5a79af7951a6be6dcecd202d9c8a01b28e/config/routes.php#L141](https://github.com/getkirby/kirby/blob/c9dcfb5a79af7951a6be6dcecd202d9c8a01b28e/config/routes.php#L141)

---

<div class="post-metadata">

**Author:** ![judbd](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/judbd/32/1303_2.png) [@judbd](https://forum.getkirby.com/u/judbd)\
**Post date:** [May 8, 2019, 2:52pm UTC](https://forum.getkirby.com/t/language-detect-doesnt-work/14127/4 "2019-05-08T14:52:33Z")

</div>

`<?php var_dump(option('language.detect')) ?>` returns `bool(true)`, so I assume it’s ok, but I don’t know why it’s not working.

`<?= $kirby->detectedLanguage() ?>` returns `fr` when the browser is in french, `en` when the browser is in english, and `fr` if the language is not english (don’t know why it doesn’t detect the real language though, maybe it only detect the applied/available language).

So the option seems to work, but not the redirecton / auto switch, and I can’t figure out why, and don’t know how to test it further.

---

<div class="post-metadata">

**Author:** ![judbd](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/judbd/32/1303_2.png) [@judbd](https://forum.getkirby.com/u/judbd)\
**Post date:** [February 26, 2020, 9:48am UTC](https://forum.getkirby.com/t/language-detect-doesnt-work/14127/5 "2020-02-26T09:48:58Z")

</div>

It seems linked to this bug (no redirect if default language set without language code) : [https://github.com/getkirby/kirby/issues/1924](https://github.com/getkirby/kirby/issues/1924)
