Skip to content

Commit

Permalink
Move translations from utils bundle to utils lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Nikolaev committed Jan 14, 2020
1 parent ea5ab49 commit 5458c74
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 67 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,5 @@ $ /usr/bin/env php bin/console darvin:utils:translations:title-case <pathname>
- Move price formatter to utils lib.

- Move macros template to utils lib.

- Move translations to utils lib.
27 changes: 19 additions & 8 deletions DependencyInjection/DarvinUtilsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,25 @@ public function prepend(ContainerBuilder $container): void
'stof_doctrine_extensions',
]);

if ($container->hasExtension('twig')) {
$path = sprintf('%s/../Resources/views', dirname((new \ReflectionClass(ExtensionConfigurator::class))->getFileName()));

$container->prependExtensionConfig('twig', [
'paths' => [
$path => 'DarvinUtils',
],
]);
if ($container->hasExtension('framework') || $container->hasExtension('twig')) {
$dir = sprintf('%s/../Resources', dirname((new \ReflectionClass(ExtensionConfigurator::class))->getFileName()));

if ($container->hasExtension('framework')) {
$container->prependExtensionConfig('framework', [
'translator' => [
'paths' => [
sprintf('%s/translations', $dir),
],
],
]);
}
if ($container->hasExtension('twig')) {
$container->prependExtensionConfig('twig', [
'paths' => [
sprintf('%s/views', $dir) => 'DarvinUtils',
],
]);
}
}
}

Expand Down
9 changes: 0 additions & 9 deletions Resources/translations/messages.ar.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions Resources/translations/messages.en.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions Resources/translations/messages.fr.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions Resources/translations/messages.ru.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions Resources/translations/messages.zh.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions Resources/translations/validators.ar.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions Resources/translations/validators.en.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions Resources/translations/validators.fr.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions Resources/translations/validators.ru.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions Resources/translations/validators.zh.yaml

This file was deleted.

0 comments on commit 5458c74

Please sign in to comment.