@@ -62,9 +62,9 @@ |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | if (is_array($count)) { |
65 | - $locale = $domain ? : NULL; |
|
66 | - $domain = $parameters ? : NULL; |
|
67 | - $parameters = $count ? : array(); |
|
65 | + $locale = $domain ?: NULL; |
|
66 | + $domain = $parameters ?: NULL; |
|
67 | + $parameters = $count ?: array(); |
|
68 | 68 | $count = NULL; |
69 | 69 | } |
70 | 70 |
@@ -65,9 +65,9 @@ |
||
65 | 65 | return NULL; |
66 | 66 | } |
67 | 67 | |
68 | - $s = strtolower($header); // case insensitive |
|
69 | - $s = strtr($s, '_', '-'); // cs_CZ means cs-CZ |
|
70 | - rsort($langs); // first more specific |
|
68 | + $s = strtolower($header); // case insensitive |
|
69 | + $s = strtr($s, '_', '-'); // cs_CZ means cs-CZ |
|
70 | + rsort($langs); // first more specific |
|
71 | 71 | preg_match_all('#(' . implode('|', $langs) . ')(?:-[^\s,;=]+)?\s*(?:;\s*q=([0-9.]+))?#', $s, $matches); |
72 | 72 | |
73 | 73 | if (!$matches[0]) { |
@@ -87,7 +87,7 @@ |
||
87 | 87 | return NULL; |
88 | 88 | } |
89 | 89 | |
90 | - $short = array_map(function ($locale) { |
|
90 | + $short = array_map(function($locale) { |
|
91 | 91 | return substr($locale, 0, 2); |
92 | 92 | }, $translator->getAvailableLocales()); |
93 | 93 |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | |
259 | 259 | $this->beforeCompileLogging($config); |
260 | 260 | |
261 | - $registerToLatte = function (Nette\DI\ServiceDefinition $def) { |
|
261 | + $registerToLatte = function(Nette\DI\ServiceDefinition $def) { |
|
262 | 262 | $def |
263 | 263 | ->addSetup('?->onCompile[] = function($engine) { Kdyby\Translation\Latte\TranslateMacros::install($engine->getCompiler()); }', array('@self')) |
264 | 264 | ->addSetup('addFilter', array('translate', array($this->prefix('@helpers'), 'translate'))) |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | */ |
473 | 473 | public static function register(Nette\Configurator $configurator) |
474 | 474 | { |
475 | - $configurator->onCompile[] = function ($config, Nette\DI\Compiler $compiler) { |
|
475 | + $configurator->onCompile[] = function($config, Nette\DI\Compiler $compiler) { |
|
476 | 476 | $compiler->addExtension('translation', new TranslationExtension()); |
477 | 477 | }; |
478 | 478 | } |
@@ -155,8 +155,7 @@ |
||
155 | 155 | $panel[] = $this->renderResources($this->ignoredResources); |
156 | 156 | } |
157 | 157 | |
158 | - return empty($panel) ? '' : |
|
159 | - '<h1>Missing translations: ' . count(array_unique($this->untranslated, SORT_REGULAR)) . |
|
158 | + return empty($panel) ? '' : '<h1>Missing translations: ' . count(array_unique($this->untranslated, SORT_REGULAR)) . |
|
160 | 159 | ', Resources: ' . count(Nette\Utils\Arrays::flatten($this->resources)) . '</h1>' . |
161 | 160 | '<div class="nette-inner tracy-inner kdyby-TranslationPanel" style="min-width:500px">' . implode($panel) . '</div>' . |
162 | 161 | '<style> |