95 $areaCode = $this->appState->getAreaCode();
98 $this->filesUtility->getJsFiles(
'base', $themePath),
99 $this->filesUtility->getJsFiles($areaCode, $themePath),
100 $this->filesUtility->getStaticHtmlFiles(
'base', $themePath),
101 $this->filesUtility->getStaticHtmlFiles($areaCode, $themePath)
105 foreach (
$files as $filePath) {
106 $read = $this->fileReadFactory->create($filePath[0], \
Magento\Framework\Filesystem\DriverPool::FILE);
110 $translatedPhrase = $this->
translate->render([$phrase], []);
111 if ($phrase != $translatedPhrase) {
112 $dictionary[$phrase] = $translatedPhrase;
114 }
catch (\Exception $e) {
116 __(
'Error while translating phrase "%s" in file %s.', $phrase, $filePath[0]),
136 foreach ($this->config->getPatterns() as
$pattern) {
137 $concatenatedContent = preg_replace(
'~(["\'])\s*?\+\s*?\1~',
'',
$content);
141 if (isset($matches[2])) {
142 foreach ($matches[2] as $match) {
143 $phrases[] = str_replace([
"\'",
'\"'], [
"'",
'"'], $match);
149 __(
'Error while generating js translation dictionary: "%s"', error_get_last())
__construct(\Magento\Framework\App\State $appState, Config $config, \Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory, \Magento\Framework\Phrase\RendererInterface $translate, \Magento\Framework\Component\ComponentRegistrar $componentRegistrar, \Magento\Framework\Component\DirSearch $dirSearch, \Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList, \Magento\Framework\App\Utility\Files $filesUtility=null)
jquery extjs ext tree mage adminhtml mage translate
foreach($appDirs as $dir) $files