Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Browser language priority problem on multi-language site

Started by Kamil 4 years ago · 4 replies · 675 views
4 years ago

Hello. I have a problem with multi-language site behaviour. My site is in two languages: PL (default) and EN. When the priority on your browser is set that Polish language is first and English is second all things work good - you can easily switch between two available language versions.

Problem is when you browser has a priority set to show non-Polish (English) version of site first (the rest of the world ;)). Then you get English version of the site, and you cannot change it to Polish - it redirects you back to English.

This is my laguage config. Is there something obvious that I'm missing?

YAML
languages:
  supported:
    - pl
    - en
  default_lang: pl
  include_default_lang: false
  include_default_lang_file_extension: false
  content_fallback:
    pl: ['pl']
    en: ['en', 'pl']
  http_accept_language: true
  session_store_active: false
last edited 01/24/22 by Kamil
4 years ago

Your config is good. Have you try Langswitcher plugins before? you must try it, and try lookup skeletons example with multilang support.

have nice good day with GravCMS elite CMS Now and Foreever.

4 years ago

Ah I see... and you discovered it first ;) Thank you. I see then no other way then just ignore it until it will be fixed, or change one of the settings (or both of them):

TXT
include_default_lang: false -> true

or

TXT
http_accept_language: true -> false
4 years ago

@goraht,

and you discovered it first

Not quite, it was Werdi who discovered it first. See this thread

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 56 13 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 5 days ago