vendor/asioso/pimcore-quicktranslate-module/src/QuickTranslateBundle/QuickTranslateBundle.php line 18

Open in your IDE?
  1. <?php
  2. /**
  3.  * This source file is available under  GNU General Public License version 3 (GPLv3)
  4.  *
  5.  * Full copyright and license information is available in LICENSE.md which is distributed with this source code.
  6.  *
  7.  *  @copyright  Copyright (c) Asioso GmbH (https://www.asioso.com)
  8.  *
  9.  */
  10. namespace Asioso\QuickTranslateBundle;
  11. use PackageVersions\Versions;
  12. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  13. use Pimcore\Extension\Bundle\PimcoreBundleInterface;
  14. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  15. class QuickTranslateBundle extends AbstractPimcoreBundle implements PimcoreBundleInterface
  16. {
  17.     use PackageVersionTrait;
  18.     const PACKAGE_NAME 'asioso/pimcore-quicktranslate-module';
  19.     public function getJsPaths()
  20.     {
  21.         return [
  22.             'https://code.jquery.com/jquery-3.6.0.min.js',
  23.             '/bundles/quicktranslate/js/pimcore/startup.js',
  24.             '/bundles/quicktranslate/js/quick-translate-btn/quickTranslateObjectBtn.js',
  25.             '/bundles/quicktranslate/js/quick-translate-btn/quickTranslateDocument.js',
  26.             '/bundles/quicktranslate/js/quick-translate-api/quickTranslate.js',
  27.             '/bundles/quicktranslate/js/utilities/xml2json.js',
  28.             '/bundles/quicktranslate/js/utilities/quickTranslateWindow.js',
  29.             '/bundles/quicktranslate/js/utilities/xmlRegReplace.js',
  30.             '/bundles/quicktranslate/js/utilities/progressBar.js',
  31.             '/bundles/quicktranslate/js/utilities/createDeeplApiUrl.js',
  32.             '/bundles/quicktranslate/js/utilities/isDeeplLanguage.js',
  33.             '/bundles/quicktranslate/js/utilities/reloadDocument.js',
  34.         ];
  35.     }
  36.     public function getEditmodeJsPaths()
  37.     {
  38.         return [
  39.             '/bundles/quicktranslate/js/quick-translate-btn/areablock.js',
  40.             '/bundles/quicktranslate/js/utilities/xml2json.js',
  41.             '/bundles/quicktranslate/js/utilities/quickTranslateWindow.js',
  42.             '/bundles/quicktranslate/js/utilities/xmlRegReplace.js',
  43.             '/bundles/quicktranslate/js/utilities/progressBar.js',
  44.             '/bundles/quicktranslate/js/utilities/createDeeplApiUrl.js',
  45.             '/bundles/quicktranslate/js/utilities/reloadDocument.js',
  46.             '/bundles/quicktranslate/js/utilities/isDeeplLanguage.js',
  47.         ];
  48.     }
  49.     public function getEditmodeCssPaths()
  50.     {
  51.         return [
  52.             '/bundles/quicktranslate/css/quick-translate.css'
  53.         ];
  54.     }
  55.     public function getCssPaths()
  56.     {
  57.         return [
  58.             '/bundles/quicktranslate/css/quick-translate.css'
  59.         ];
  60.     }
  61.     public function getNiceName()
  62.     {
  63.         return 'Asioso - QuickTranslate Bundle';
  64.     }
  65.     /**
  66.      * Bundle description as shown in extension manager
  67.      *
  68.      * @return string
  69.      */
  70.     public function getDescription()
  71.     {
  72.         return "";
  73.     }
  74.     public static function getSolutionVersion(){
  75.         //code duplication from PackageVersionTrait... sorry
  76.         $version Versions::getVersion(self::PACKAGE_NAME);
  77.         // normalizes v2.3.0@9e016f4898c464f5c895c17993416c551f1697d3 to 2.3.0
  78.         $version preg_replace('/^v/'''$version);
  79.         $version preg_replace('/@(.+)$/'''$version);
  80.         return $version;
  81.     }
  82.     /**
  83.      * Returns the composer package name used to resolve the version
  84.      *
  85.      * @return string
  86.      */
  87.     protected function getComposerPackageName(): string
  88.     {
  89.         return self::PACKAGE_NAME;
  90.     }
  91. }