Divne chovanie pri dvojjazycnej stranke

tomas.stofik
Člen | 33
+
0
-

Zdravim Vas,

Chcel by som sa spytat ci uz niekto riesil podobny problem.

Mam jednoduchu stranku s dvoma jazykmi (en/de)

Chcem aby bolo mozne menit hodnotu v url pre jednu action pri oboch jazykoch.

Divne chovanie nastane vtedy ked chcem navstivit stranku en/services/

V logu sa niekedy vypise a niekedy nevypise tato chyba:
access.log:

[2017–12–07 15–24–15] HTTP code 404: No route for HTTP request. in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/vendor/nette/nette/Nette/Application/Application.php:100 @ http://www.simon-deutsch.com/…img/logo.png
[2017–12–07 15–24–15] HTTP code 404: No route for HTTP request. in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/vendor/nette/nette/Nette/Application/Application.php:100 @ http://www.simon-deutsch.com/…g/logo_l.png
[2017–12–07 15–24–15] HTTP code 404: No route for HTTP request. in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/vendor/nette/nette/Nette/Application/Application.php:100 @ http://www.simon-deutsch.com/…services.jpg
[2017–12–07 15–24–17] HTTP code 404: No route for HTTP request. in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/vendor/nette/nette/Nette/Application/Application.php:100 @ http://www.simon-deutsch.com/…/favicon.ico?…
[2017–12–07 15–24–17] HTTP code 404: No route for HTTP request. in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/vendor/nette/nette/Nette/Application/Application.php:100 @ http://www.simon-deutsch.com/…g/logo_l.png
[2017–12–07 15–24–17] HTTP code 404: No route for HTTP request. in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/vendor/nette/nette/Nette/Application/Application.php:100 @ http://www.simon-deutsch.com/…img/logo.png
[2017–12–07 15–24–18] HTTP code 404: No route for HTTP request. in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/vendor/nette/nette/Nette/Application/Application.php:100 @ http://www.simon-deutsch.com/…services.jpg
[2017–12–07 15–24–18] HTTP code 404: No route for HTTP request. in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/vendor/nette/nette/Nette/Application/Application.php:100 @ http://www.simon-deutsch.com/…ripts.min.js?…

error.log:
[2017–12–07 15–24–15] PHP Notice: Undefined index: in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/app/presenters/BasePresenter.php:485 @ http://www.simon-deutsch.com/…g/logo_l.png
[2017–12–07 15–24–15] PHP Notice: Undefined index: in /usr/local/pem/vhosts/103450/webspace/httpdocs/cms/app/presenters/BasePresenter.php:485 @ http://www.simon-deutsch.com/…services.jpg

Tu je kod routra:
public static function createRouter()
{
$router = new RouteList();

/**
* No language routes
*/
$router[] = new Route(‚rss.xml‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚rss‘));
$router[] = new Route(‚robots.txt‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚robots‘));
$router[] = new Route(‚sitemap.xml‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚sitemapXml‘));

/**
* German language routes
*/
$router[] = new Route(‚de/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚default‘, ‚lang‘=>‚de‘));
$router[] = new Route(‚de/leistungen/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚services‘, ‚lang‘=>‚de‘));
$router[] = new Route(‚de/sitemap/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚sitemap‘, ‚lang‘=>‚de‘));
$router[] = new Route(‚de/impressum/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚imprint‘, ‚lang‘=>‚de‘));
$router[] = new Route(‚de/unsere-produkte/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚products‘, ‚lang‘=>‚de‘));
$router[] = new Route(‚de/kontaktiere-uns/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚contact‘, ‚lang‘=>‚de‘));

/**
* English language routes
*/
$router[] = new Route(‚en/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚default‘, ‚lang‘=>‚en‘));
$router[] = new Route(‚en/services/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚services‘, ‚lang‘=>‚en‘));
$router[] = new Route(‚en/sitemap/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚sitemap‘, ‚lang‘=>‚en‘));
$router[] = new Route(‚en/imprint/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚imprint‘, ‚lang‘=>‚en‘));
$router[] = new Route(‚en/our-products/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚products‘, ‚lang‘=>‚en‘));
$router[] = new Route(‚en/contact-us/‘, array(‚presenter‘=>‚Homepage‘, ‚action‘=>‚contact‘, ‚lang‘=>‚en‘));

$router[] = new Route(‚<lang=de>/<action>/‘, ‚Homepage:default‘);

//$router[] = new Route(‚<presenter>/<action>[/<id>]‘, ‚Homepage:default‘);

return $router;

}

Ak by mal niekto chvilu pozriet na to a aspon ma „navigovat“ budem velmi vdacny a urcite aj niekto kto sa s podobnym problemom stretol, nakolko nemozem na fore nic podobne najst.

Velmi pekne dakujem vsetkym