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