How can I make all i18n-aware components aware of my Zend_Translate object?
A variety of components are translation aware (i.e., accept Zend_Translate objects), including:
Zend_View_Helper_Translate
Zend_Validate_*
Zend_Form
To have them all use the same Zend_Translate instance, simply place it in the registry with the key "Zend_Translate":
How can I use the same locale everywhere?
With ZF 1.7 an application wide locale is supported. You can do the following in your bootstrap file:
From now on, all locale aware components will use your locale object stored in the registry as long as you don't give another one manually.
Why are my dates formatted wrong? Why do I get the false year value?
When using own formats in your code you could come to a situation where you get for example 29.12.2009, but you expected to get 29.12.2008.
There is one year difference: 2009 instead of 2008. You should use the lower cased year constant. See this example:
Note the lower cased "y" which makes the difference and outputs the real year.
How can I debug Zend_Date in a simple way?
When you think that you are getting wrong output from Zend_Date then it's often needed to see what Zend_Date really uses internally.
Well.. a var_dump of Zend_Date is not really helpfull, but you could simply use getIso(). This format has all date informations available:
Note that using toString() and outputting only parts of a date does not show all needed informations. There could be a wrong used timezone, or a DST change which is suppressed by toString() but shown with getIso().