Php IntlDateFormatter始终为月/日名称提供输出

Php IntlDateFormatter始终为月/日名称提供输出,php,locale,intl,Php,Locale,Intl,我正在尝试使用Intl包实现区域设置支持。NumberFormatter在区域设置更改时工作并更改输出样式,但IntlDateFormatter似乎无法检测到区域设置更改 我正在使用这段代码设置区域设置,在en_US和sv_sv之间切换 setlocale(LC_ALL, $locale . ".UTF-8"); return \Locale::setDefault($locale); 然后使用以下代码初始化IntlDateFormatter // _locale is set on each

我正在尝试使用Intl包实现区域设置支持。NumberFormatter在区域设置更改时工作并更改输出样式,但IntlDateFormatter似乎无法检测到区域设置更改

我正在使用这段代码设置区域设置,在en_US和sv_sv之间切换

setlocale(LC_ALL, $locale . ".UTF-8");
return \Locale::setDefault($locale);
然后使用以下代码初始化IntlDateFormatter

// _locale is set on each pass, since locale may change during runtime
$this->_locale = \Locale::getDefault(); // en_US or sv_SV
$this->_dateFormatter = new \IntlDateFormatter($this->_locale, null, null);
当我现在尝试格式化一天的名称时,例如星期三,我总是得到该名称的英文表示形式——即使预期是瑞典表示形式

$this->_dateFormatter->setPattern("EEEE");
return mb_convert_case($this->_dateFormatter->format($this->getDateTime($argument)), MB_CASE_LOWER);
这应该输出onsdag,但是对于这两个地区都输出星期三。 我做错了什么