| @@ 94-110 (lines=17) @@ | ||
| 91 | $this->configureTranslations($container, $enabled, $pluginDir); |
|
| 92 | } |
|
| 93 | ||
| 94 | protected function configureTwigPaths(ContainerBuilder $container, $enabled, $pluginDir) |
|
| 95 | { |
|
| 96 | $paths = []; |
|
| 97 | ||
| 98 | foreach ($enabled as $code) { |
|
| 99 | $dir = $pluginDir.'/'.$code.'/Resource/template'; |
|
| 100 | if (file_exists($dir)) { |
|
| 101 | $paths[$dir] = $code; |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| 105 | if (!empty($paths)) { |
|
| 106 | $container->prependExtensionConfig('twig', [ |
|
| 107 | 'paths' => $paths, |
|
| 108 | ]); |
|
| 109 | } |
|
| 110 | } |
|
| 111 | ||
| 112 | protected function configureTranslations(ContainerBuilder $container, $enabled, $pluginDir) |
|
| 113 | { |
|
| @@ 112-130 (lines=19) @@ | ||
| 109 | } |
|
| 110 | } |
|
| 111 | ||
| 112 | protected function configureTranslations(ContainerBuilder $container, $enabled, $pluginDir) |
|
| 113 | { |
|
| 114 | $paths = []; |
|
| 115 | ||
| 116 | foreach ($enabled as $code) { |
|
| 117 | $dir = $pluginDir.'/'.$code.'/Resource/locale'; |
|
| 118 | if (file_exists($dir)) { |
|
| 119 | $paths[] = $dir; |
|
| 120 | } |
|
| 121 | } |
|
| 122 | ||
| 123 | if (!empty($paths)) { |
|
| 124 | $container->prependExtensionConfig('framework', [ |
|
| 125 | 'translator' => [ |
|
| 126 | 'paths' => $paths, |
|
| 127 | ], |
|
| 128 | ]); |
|
| 129 | } |
|
| 130 | } |
|
| 131 | ||
| 132 | protected function isConnected(Connection $conn) |
|
| 133 | { |
|