File tree 2 files changed +8
-1
lines changed
app/code/Magento/Translation
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,13 @@ public function process(Chain $chain)
77
77
if ($ context instanceof FallbackContext) {
78
78
$ themePath = $ context ->getThemePath ();
79
79
$ areaCode = $ context ->getAreaCode ();
80
- $ this ->translate ->setLocale ($ context ->getLocale ());
81
80
}
82
81
83
82
$ area = $ this ->areaList ->getArea ($ areaCode );
84
83
$ area ->load (\Magento \Framework \App \Area::PART_TRANSLATE );
85
84
85
+ $ this ->translate ->setLocale ($ context ->getLocale ())->loadData ($ areaCode , true );
86
+
86
87
$ chain ->setContent (json_encode ($ this ->dataProvider ->getData ($ themePath )));
87
88
$ chain ->setContentType ('json ' );
88
89
}
Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ public function testGetData()
80
80
$ context ->expects ($ this ->once ())
81
81
->method ('getAreaCode ' )
82
82
->willReturn ($ areaCode );
83
+ $ context ->expects ($ this ->once ())
84
+ ->method ('getLocale ' )
85
+ ->willReturn ('en_US ' );
83
86
84
87
$ this ->areaListMock ->expects ($ this ->once ())
85
88
->method ('getArea ' )
@@ -97,6 +100,9 @@ public function testGetData()
97
100
->method ('setContentType ' )
98
101
->with ('json ' );
99
102
103
+ $ this ->translateMock ->expects ($ this ->once ())->method ('setLocale ' )->with ('en_US ' )->willReturnSelf ();
104
+ $ this ->translateMock ->expects ($ this ->once ())->method ('loadData ' )->with ($ areaCode , true );
105
+
100
106
$ this ->model ->process ($ chain );
101
107
}
102
108
}
You can’t perform that action at this time.
0 commit comments