In Magento 2, I get wrong locale which I set in system config?
The first, I go to admin->set config locale is Japanese.
And then, I go to class "\Magento\Framework\Stdlib\DateTime\Timezone"
....
/**
* {@inheritdoc}
*/
public function getDateFormat($type = \IntlDateFormatter::SHORT)
{
var_dump($this->_localeResolver->getLocale());
return (new \IntlDateFormatter(
$this->_localeResolver->getLocale(),
$type,
\IntlDateFormatter::NONE
))->getPattern();
}
.......
And then I got the result: "en_US".
Did you see the same issue in your system?
If you have solution, may you help me please?
Best Answer
I see only one reason why this happens - incorrect locale was set in the configuration. Please check your configuration ("store view" scope):
In a debug I see that magento works fine.
Configuration (
ja_JP
):Result (
ja_JP
as set):