Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
DeployTranslationsDictionary Class Reference

Public Member Functions

 __construct (JsTranslationConfig $jsTranslationConfig, DeployStaticFile $deployStaticFile, State $state, LoggerInterface $logger)
 
 deploy ($area, $theme, $locale)
 

Detailed Description

Deploy translation dictionaries service

Definition at line 15 of file DeployTranslationsDictionary.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( JsTranslationConfig  $jsTranslationConfig,
DeployStaticFile  $deployStaticFile,
State  $state,
LoggerInterface  $logger 
)
Parameters
JsTranslationConfig$jsTranslationConfig
DeployStaticFile$deployStaticFile
State$state
LoggerInterface$logger

Definition at line 43 of file DeployTranslationsDictionary.php.

48  {
49  $this->jsTranslationConfig = $jsTranslationConfig;
50  $this->deployStaticFile = $deployStaticFile;
51  $this->state = $state;
52  $this->logger = $logger;
53  }

Member Function Documentation

◆ deploy()

deploy (   $area,
  $theme,
  $locale 
)
Parameters
string$area
string$theme
string$locale
Returns
void

Definition at line 61 of file DeployTranslationsDictionary.php.

62  {
63  try {
64  $this->state->emulateAreaCode($area, function () use ($area, $theme, $locale) {
65  $this->deployStaticFile->deployFile(
66  $this->jsTranslationConfig->getDictionaryFileName(),
67  [
68  'fileName' => $this->jsTranslationConfig->getDictionaryFileName(),
69  'area' => $area,
70  'theme' => $theme,
71  'locale' => $locale
72  ]
73  );
74  });
75  } catch (\Exception $e) {
76  $this->logger->error($e->getMessage());
77  }
78  }
$theme

The documentation for this class was generated from the following file: