5
5
*/
6
6
namespace Magento \Deploy \Service ;
7
7
8
+ use Magento \Framework \Locale \ResolverInterfaceFactory ;
9
+ use Magento \Framework \Locale \ResolverInterface ;
8
10
use Magento \RequireJs \Model \FileManagerFactory ;
9
11
use Magento \Framework \View \DesignInterfaceFactory ;
10
12
use Magento \Framework \View \Design \Theme \ListInterface ;
@@ -46,6 +48,11 @@ class DeployRequireJsConfig
46
48
*/
47
49
private $ requireJsConfigFactory ;
48
50
51
+ /**
52
+ * @var ResolverInterfaceFactory
53
+ */
54
+ private $ localeFactory ;
55
+
49
56
/**
50
57
* DeployRequireJsConfig constructor
51
58
*
@@ -54,31 +61,40 @@ class DeployRequireJsConfig
54
61
* @param RepositoryFactory $assetRepoFactory
55
62
* @param FileManagerFactory $fileManagerFactory
56
63
* @param ConfigFactory $requireJsConfigFactory
64
+ * @param ResolverInterfaceFactory $localeFactory
57
65
*/
58
66
public function __construct (
59
67
ListInterface $ themeList ,
60
68
DesignInterfaceFactory $ designFactory ,
61
69
RepositoryFactory $ assetRepoFactory ,
62
70
FileManagerFactory $ fileManagerFactory ,
63
- ConfigFactory $ requireJsConfigFactory
71
+ ConfigFactory $ requireJsConfigFactory ,
72
+ ResolverInterfaceFactory $ localeFactory
64
73
) {
65
74
$ this ->themeList = $ themeList ;
66
75
$ this ->designFactory = $ designFactory ;
67
76
$ this ->assetRepoFactory = $ assetRepoFactory ;
68
77
$ this ->fileManagerFactory = $ fileManagerFactory ;
69
78
$ this ->requireJsConfigFactory = $ requireJsConfigFactory ;
79
+ $ this ->localeFactory = $ localeFactory ;
70
80
}
71
81
72
82
/**
73
83
* @param string $areaCode
74
84
* @param string $themePath
85
+ * @param string $localeCode
75
86
* @return bool true on success
76
87
*/
77
- public function deploy ($ areaCode , $ themePath )
88
+ public function deploy ($ areaCode , $ themePath, $ localeCode )
78
89
{
79
90
/** @var \Magento\Framework\View\Design\ThemeInterface $theme */
80
91
$ theme = $ this ->themeList ->getThemeByFullPath ($ areaCode . '/ ' . $ themePath );
92
+ /** @var \Magento\Theme\Model\View\Design $design */
81
93
$ design = $ this ->designFactory ->create ()->setDesignTheme ($ theme , $ areaCode );
94
+ /** @var ResolverInterface $locale */
95
+ $ locale = $ this ->localeFactory ->create ();
96
+ $ locale ->setLocale ($ localeCode );
97
+ $ design ->setLocale ($ locale );
82
98
83
99
$ assetRepo = $ this ->assetRepoFactory ->create (['design ' => $ design ]);
84
100
/** @var \Magento\RequireJs\Model\FileManager $fileManager */
0 commit comments