2009年1月30日星期五

Re: [fw-mvc] Zend_Dojo & I18N

-- Kostyantyn Shakhov <kshakhov@gmail.com> wrote
(on Friday, 30 January 2009, 05:33 PM +0200):
> I'm trying to setup I18N for Zend_Dojo namely for elements of
> Zend_Dojo_Form like drop-down calendar of DateTextBox etc.
>
> My steps are:
>
> 1) In the layout script:
> $this->dojo()->setDjConfigOption('extraLocale', 'fr-fr')
> ->requireModule('dojo.i18n');
>
> Nothing happened. The calendar's month name and week names are in English still;
>
> 2) Add 'locale' to the form element declaration:
> $this->addElement(
> 'DateTextBox',
> 'foo',
> array(
> 'decorators' => $this->elementDecorators,
> 'label' => 'Date',
> 'required' => true,
> 'invalidMessage' => 'Invalid date specified.',
> 'formatLength' => 'long',
> 'locale' => 'fr-fr'
> )
> );
>
> Nothing is changed still. The calendar's locale is en_US still.
>
> Also, in the Dojo Internationalization manual written that Dojo has
> dojo.requireLocalization() which is used to declare usage of I18N
> resources and load them. I haven't found a corresponding method in
> Zend_Dojo package.

You should be able to add that line using the addJavascript() method:

$view->dojo()->addJavascript('dojo.requireLocalization();');


--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: