Skip to content

Commit

Permalink
remove empty translation install
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Sep 21, 2023
1 parent b92f0d8 commit 76f1a20
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 27 deletions.
Empty file added config/install/.gitkeep
Empty file.
2 changes: 0 additions & 2 deletions config/install/translations/admin.csv

This file was deleted.

2 changes: 0 additions & 2 deletions config/install/translations/frontend.csv

This file was deleted.

23 changes: 0 additions & 23 deletions src/Tool/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@

namespace DynamicSearchBundle\Tool;

use Pimcore\Extension\Bundle\Installer\Exception\InstallationException;
use Pimcore\Extension\Bundle\Installer\SettingsStoreAwareInstaller;
use Pimcore\Model\Translation;
use Pimcore\Tool\Admin;

class Install extends SettingsStoreAwareInstaller
{
public function install(): void
{
$this->installTranslations();

parent::install();
}

Expand All @@ -21,24 +16,6 @@ public function needsReloadAfterInstall(): bool
return false;
}

private function installTranslations(): void
{
$csvAdmin = $this->getInstallSourcesPath() . '/translations/admin.csv';
$csvFrontend = $this->getInstallSourcesPath() . '/translations/frontend.csv';

try {
Translation::importTranslationsFromFile($csvAdmin, Translation::DOMAIN_ADMIN, true, Admin::getLanguages());
} catch (\Exception $e) {
throw new InstallationException(sprintf('Failed to install admin translations. error was: "%s"', $e->getMessage()));
}

try {
Translation::importTranslationsFromFile($csvFrontend, Translation::DOMAIN_DEFAULT, true, Admin::getLanguages());
} catch (\Exception $e) {
throw new InstallationException(sprintf('Failed to install website translations. error was: "%s"', $e->getMessage()));
}
}

protected function getInstallSourcesPath(): string
{
return __DIR__ . '/../../config/install';
Expand Down

0 comments on commit 76f1a20

Please sign in to comment.