From cc01c906ba63b3797bf2b9ef92a6854fe2ddbefb Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 29 Aug 2017 16:21:25 +0200 Subject: #336: Integration of symfony/http-foundation request --- includes/helper/internationalization_helper.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'includes/helper') diff --git a/includes/helper/internationalization_helper.php b/includes/helper/internationalization_helper.php index d2dbcdbd..83faabb0 100644 --- a/includes/helper/internationalization_helper.php +++ b/includes/helper/internationalization_helper.php @@ -1,5 +1,7 @@ 0 ? '&' : '?') . 'set_locale='; + $request = Request::getInstance(); $items = []; foreach (config('locales') as $locale => $name) { + $url = url($request->getPathInfo(), ['set_locale' => $locale]); + $items[] = toolbar_item_link( - htmlspecialchars($url) . $locale, + htmlspecialchars($url), '', - '' . $name . ' ' . $name + sprintf( + '%s %2$s', + url('pic/flag/' . $locale . '.png'), + $name + ) ); } return $items; -- cgit v1.2.3-54-g00ecf