Skip to content

Fix #8691 #8694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/internal/Magento/Framework/App/Language/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,15 @@ public function getUses()
{
return $this->_data['use'];
}

/**
* Set sort order
*
* @param string|int $value
* @return void
*/
public function setSortOrder($value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't add setter method to the Config object which suppose to be immutable by design.
So, after initialization it shouldn't be modified

{
$this->_data['sort_order'] = $value;
}
}
3 changes: 2 additions & 1 deletion lib/internal/Magento/Framework/App/Language/Dictionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ private function collectInheritedPacks($languageConfig, &$result, $level = 0, ar
'language' => $languageConfig,
'key' => $packKey,
];
foreach ($languageConfig->getUses() as $reuse) {
foreach ($languageConfig->getUses() as $index => $reuse) {
if (isset($this->packList[$reuse['vendor']][$reuse['package']])) {
$parentLanguageConfig = $this->packList[$reuse['vendor']][$reuse['package']];
$parentLanguageConfig->setSortOrder($index);
$this->collectInheritedPacks($parentLanguageConfig, $result, $level + 1, $visitedPacks);
}
}
Expand Down