Download the PHP package kunstmaan/languagechooser-bundle without Composer
On this page you can find all versions of the php package kunstmaan/languagechooser-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kunstmaan/languagechooser-bundle
More information about kunstmaan/languagechooser-bundle
Files in kunstmaan/languagechooser-bundle
Package languagechooser-bundle
Short Description The Kunstmaan Language chooser bundle supplies your project with basic but extendible language chooser
License MIT
Homepage https://github.com/Kunstmaan/KunstmaanLanguageChooserBundle
Informations about the package languagechooser-bundle
KunstmaanLanguageChooserBundle
Handles autodetection of the language of the end user or shows a splash page with a language choice.
Installation instructions
Assuming you have installed composer.phar or composer binary:
Add the KunstmaanLanguageChooserBundle and the LuneticsLocaleBundle to your AppKernel.php file:
Remark: The KunstmaanLanguageChooserBundle should be loaded BEFORE the LuneticsLocaleBundle
Add the KunstmaanLanguageChooserBundle to your routing.yml:
Overwrite the KunstmaanLanguageChooserBundle config to your needs in config.yml:
Usage
When the user arrives on the root page of your website (eg. http://domain.com/) he:
- is automatically redirect to his language of choice (eg. http://domain.com/en) when the
autodetectlanguage
is set totrue
- sees a splash page where he can select his language manually when the
showlanguagechooser
is set totrue
The template path of the splash page can we set via the languagechoosertemplate
configuration parameter.
In all your Twig templates, there is a global variable available with an array of the available languages: languagechooser_languages
.
This can be usefull on your custom splash page, or when you want to show the language choice on other pages.