Skip to content

Commit

Permalink
Fixed the TranslateServiceFactory to use the project root const and a…
Browse files Browse the repository at this point in the history
…void returning false.
  • Loading branch information
ruslanbaidan committed Oct 10, 2023
1 parent 198bcdc commit 413fab2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Service/TranslateServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ class TranslateServiceFactory implements FactoryInterface
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
if (is_dir('node_modules/ng_client/po')) {
$baseDir = 'node_modules/ng_client/po/';
} elseif (is_dir('node_modules/ng_backoffice/po')) {
$baseDir = 'node_modules/ng_backoffice/po/';
} else {
return false;
$projectRoot = \defined('PROJECT_ROOT') ? PROJECT_ROOT : '';
$baseDir = $projectRoot . 'node_modules/ng_client/po/';
if (is_dir($projectRoot . 'node_modules/ng_backoffice/po')) {
$baseDir = $projectRoot . 'node_modules/ng_backoffice/po/';
}
$transConf = [
'locale' => '',
Expand Down

0 comments on commit 413fab2

Please sign in to comment.