Skip to content

A Neos CMS package to handle language redirects based on the browser language.

License

Notifications You must be signed in to change notification settings

yvirtp/Wegmeister.LanguageRedirect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wegmeister.LanguageRedirect

This package provides a simple language detection service for Neos CMS that will redirect users to the language version that fits their Accept-Language header best. It will only redirect if the uri path is empty (e.g. /).

Installation

Run the following command in your site package:

composer require --no-update wegmeister/language-redirect

Then run composer update in your project root.

Configuration

Sometimes language codes are not configured the same as in Neos. Therefore you can configure a mapping in your Settings.yaml: Also you can configure a feLanguageCookieName to get a cookie value from your frontend in case you want your users last opened language to reopen the next time he visits your website. The feLanguageCookieName allows you to read a cookie that contains a default language. Perhaps you can use this to always load the last language the user opened by setting the cookie when he changes the language via the language menu on your website.

Wegmeister:
  LanguageRedirect:
    # Add mappings for language codes if you use some different codes than the default ones.
    languageCodeOverrides:
      # For example, if you use "cz" instead of "cs" for Czech, you can add this mapping:
      cs: cz
    # configure the name of your frontend language cookie
    feLanguageCookieName: _fe_language

About

A Neos CMS package to handle language redirects based on the browser language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%