Skip to content

Commit 3092740

Browse files
committed
MC-19247: Broken translations with advanced bundling
- Remove translation dependency from theme module;
1 parent 11ce1b7 commit 3092740

File tree

4 files changed

+2
-4
lines changed

4 files changed

+2
-4
lines changed

app/code/Magento/Theme/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"magento/module-media-storage": "*",
1616
"magento/module-require-js": "*",
1717
"magento/module-store": "*",
18-
"magento/module-translation": "*",
1918
"magento/module-ui": "*",
2019
"magento/module-widget": "*"
2120
},

app/code/Magento/Theme/view/frontend/layout/default.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<block name="require.js" class="Magento\Framework\View\Element\Template" template="Magento_Theme::page/js/require_js.phtml" />
1212
<referenceContainer name="after.body.start">
1313
<block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/>
14-
<block class="Magento\Translation\Block\Html\Head\Config" name="translate-config"/>
1514
<block class="Magento\Framework\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme::js/cookie.phtml"/>
1615
<block class="Magento\Theme\Block\Html\Notices" name="global_notices" template="Magento_Theme::html/notices.phtml"/>
1716
</referenceContainer>

app/code/Magento/Translation/ViewModel/Dictionary.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,13 @@ public function __construct(
6868
*/
6969
public function getTranslationDictionary(): string
7070
{
71+
$asset = $this->assetRepo->createAsset(JsConfig::DICTIONARY_FILE_NAME);
7172
if ($this->appState->getMode() === AppState::MODE_PRODUCTION) {
72-
$asset = $this->assetRepo->createAsset(JsConfig::DICTIONARY_FILE_NAME);
7373
$staticViewFilePath = $this->filesystem->getDirectoryRead(
7474
DirectoryList::STATIC_VIEW
7575
)->getAbsolutePath();
7676
$content = $this->filesystemDriver->fileGetContents($staticViewFilePath . $asset->getPath());
7777
} else {
78-
$asset = $this->assetRepo->createAsset(JsConfig::DICTIONARY_FILE_NAME);
7978
$content = $asset->getContent();
8079
}
8180

app/code/Magento/Translation/view/frontend/layout/default.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceBlock name="head.additional">
11+
<block class="Magento\Translation\Block\Html\Head\Config" name="translate-config"/>
1112
<block name="translation_dictionary" template="Magento_Translation::dictionary.phtml" before="-">
1213
<arguments>
1314
<argument name="dictionary_view_model" xsi:type="object">Magento\Translation\ViewModel\Dictionary</argument>

0 commit comments

Comments
 (0)