$ composer require geniv/nette-locale-switch
or
"geniv/nette-locale-switch": "^2.0"
require:
"php": ">=7.0",
"nette/nette": ">=2.4",
"geniv/nette-locale": ">=2.0",
"geniv/nette-general-form": ">=1.0"
neon configure:
services:
- LocaleSwitch
usage:
protected function createComponentLocaleSwitch(ILocaleSwitch $localeSwitch, IAliasRouter $aliasRouter): ILocaleSwitch
{
//$localeSwitch->setTemplatePath(__DIR__ . '/templates/header-lang.latte');
$domain = $aliasRouter->getDomainAlias();
if ($domain) {
$localeSwitch->setDomain($domain);
}
return $localeSwitch;
}
usage:
{control localeSwitch}
or
{control localeSwitch, $idLocale}