Aleksey V. Zapparov posts a very nice solution to a very common question when dealing with Bootstrap resources; Hello, You can either register precious resources in registry, e.g.: protected function _initMyResource() { $res = ‘foobar’; Zend_Registry::set(‘myResource’, $res); return $res; } Or you can register the whole bootstrap, so you […]
A very common question is how do I get a localized / translated list of countries, currencies etc for a company registration form or similar. Here is a easy to use sample; For your cut’n’paste pleasure <?php class Form_Company extends Zend_Form { private $elementDecorators = array( […]
As an update to the method of having everything related to Zend_Translate and Zend_Locale in the Bootstrap, here is an alternative using an Controller Plugin that does the grunt work of validating, selecting and updating the Zend_Locale, Zend_Registry & Zend_Session using Zend_Session_Namespace. And we are using poedit .po & .mo files as the source as usual.
A recurring problem for site developers is implementing a solid way to create and maintain multilingual sites, this article series is my feeble attempt to guide you through how to quickly implement the Zend_Translate in an Zend Framework 1.9.x site.
The procedures and best practices for this is unfortunately like training a dog, everyone has a different way of doing it and an opinion, so the methods and code I show here are take out of applications that are running in production so if you have a better way of doing it please feel free to comment!.