Zend_Date语言翻译

hsz*_*hsz 0 php translation zend-framework zend-date

我有一个函数,使用返回日期字符串Zend_Date.

$date = new Zend_Date();
$date->setOptions(array('format_type' => 'php'));
$date->setTimestamp($timestamp);
return $date->toString($format);
Run Code Online (Sandbox Code Playgroud)

当我设置$format'l, d F Y'我期望类似:

?roda, 13 stycznia 2010(正确的抛光字符串是什么意思Wedneseday, 13 january 2010),它的效果很好.

但是当我在浏览器中将语言环境设置为英语时打开此页面时,它会返回英语中的日期字符串而不是我希望看到的波兰语.

无论浏览器设置如何,我应该设置什么以及在哪里获得始终抛光日期?

Emi*_*nov 5

将第3个参数传递给toString():

$a = Zend_Date::now();
$a->setOptions(array('format_type' => 'php'));
$a->toString('l, d F Y', null, 'pl'); // wtorek, 12 stycznia 2010
Run Code Online (Sandbox Code Playgroud)