You can translate order statuses manually in «Stores
» → «Order Status
» admin section.
But it is inconvenient because:
you must do it manullay for each new Magento installation
it works for a single language but does not work for multistore Magento installation with multiple languages.
The problem code line is:
* @param array $components
* @param array $data
*/
public function __construct(
ContextInterface $context,
UiComponentFactory $uiComponentFactory,
CollectionFactory $collectionFactory,
array $components = [],
array $data = []
) {
$this->statuses = $collectionFactory->create()->toOptionHash();
parent::__construct($context, $uiComponentFactory, $components, $data);
}
/**
* Prepare Data Source
*
* @param array $dataSource
* @return void
*/
public function prepareDataSource(array & $dataSource)
My fix is to replace the problem line with the new one:
$this->statuses = array_map('__', $collectionFactory->create()->toOptionHash());
1 Like
This was a problem in Magento 1 as well.
Actually, in Magento 1 the grid as well did not translate but the order view page translated them using the translate csv.
But we have a database table with labels for each store view. Way not use that? That is only used in front end I think.
I wrote why it is inconvenient in the post above. Please read posts before commenting them.