Skip to content

Commit 8e3f3ac

Browse files
committed
MC-19247: Broken translations with advanced bundling
- Load translation dictionary from js component;
1 parent aee517e commit 8e3f3ac

File tree

9 files changed

+13
-154
lines changed

9 files changed

+13
-154
lines changed

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

Lines changed: 0 additions & 99 deletions
This file was deleted.

app/code/Magento/Translation/etc/di.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
<preference for="Magento\Framework\Phrase\RendererInterface" type="Magento\Framework\Phrase\Renderer\Composite" />
1616
<preference for="Magento\Translation\Model\Js\DataProviderInterface" type="Magento\Translation\Model\Js\DataProvider"/>
1717
<preference for="Magento\Framework\Translate\Js\Config" type="Magento\Translation\Model\Js\Config"/>
18-
<type name="Magento\Translation\ViewModel\Dictionary">
19-
<arguments>
20-
<argument name="filesystemDriver" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
21-
</arguments>
22-
</type>
2318
<type name="Magento\Framework\Translate\Inline">
2419
<arguments>
2520
<argument name="templateFileName" xsi:type="string">Magento_Translation::translate_inline.phtml</argument>

app/code/Magento/Translation/view/base/templates/dictionary.phtml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'text!js-translation.json'
8+
], function (dict) {
9+
'use strict';
10+
11+
return JSON.parse(dict);
12+
});

app/code/Magento/Translation/view/base/web/js/mageTranslationDictionary.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
<body>
1010
<referenceBlock name="head.additional">
1111
<block class="Magento\Translation\Block\Html\Head\Config" name="translate-config"/>
12-
<block name="translation_dictionary" template="Magento_Translation::dictionary.phtml" before="-">
13-
<arguments>
14-
<argument name="dictionary_view_model" xsi:type="object">Magento\Translation\ViewModel\Dictionary</argument>
15-
</arguments>
16-
</block>
1712
</referenceBlock>
1813
</body>
1914
</page>

app/code/Magento/Translation/view/frontend/requirejs-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var config = {
99
editTrigger: 'mage/edit-trigger',
1010
addClass: 'Magento_Translation/js/add-class',
1111
'Magento_Translation/add-class': 'Magento_Translation/js/add-class',
12-
mageTranslationDictionary: 'Magento_Translation/js/mageTranslationDictionary'
12+
mageTranslationDictionary: 'Magento_Translation/js/mage-translation-dictionary'
1313
}
1414
},
1515
deps: [

dev/tests/js/jasmine/require.conf.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ require.config({
1919
'tests': '../../../../../../dev/tests/js/jasmine',
2020
'squire': '../../../../../../node_modules/squirejs/src/Squire'
2121
},
22-
map: {
23-
'*': {
24-
mageTranslationDictionary: '../../../../../../dev/tests/js/jasmine/tests/lib/mage/fake-dictionary'
25-
}
26-
},
2722
shim: {
2823
squire: {
2924
exports: 'squire'

dev/tests/js/jasmine/tests/lib/mage/fake-dictionary.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)