[fw-general] Re: Problem with form translation - strangle logs

2010-05-27 Thread Саша Стаменковић
Also, I noticed the labels that are not translated at all (not found in sr
or en version of Zend_Form.php) are logged twice, ex:

2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Gorivo:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Gorivo:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Lokacija:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Lokacija:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Sortiraj po:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Sortiraj po:

Even if there is only one element with that label. Maybe I'm doing something
wrong with my base form.

I'm extending all forms from this one http://pastie.org/980646

Thanks in advance.

Regards,
Saša Stamenković


2010/5/27 Саша Стаменковић umpir...@gmail.com

 Hi.

 i have in bootstrap

 protected function _initTranslate() {
 $translate = new Zend_Translate(
  Zend_Translate::AN_ARRAY,
 realpath(APPLICATION_PATH . '/../data/languages'),
  null,
 array(
 'scan' = Zend_Translate::LOCALE_DIRECTORY,
  'log' = $this-getResource('log'),
 'logUntranslated' = true
  )
 );
 Zend_Form::setDefaultTranslator($translate);
  return $translate;
 }

 under /../data/languages folder I have subfolder for each language (sr, en,
 ru...). Under each of them I have Zend_Form.php and Zend_Validate.php

  Zend_Validate.php is from svn, and Zend_Form.php looks like:

 // sr
 ?php
 return array(
 Cena: = Cena:,
 Godište: = Godište:,
 );

 //en
 ?php
 return array(
 Cena: = Price:,
 Godište: = Year:,
 );


 When I set locale to sr_RS it's ok, but when I switch to en_Gb I get log:

 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
 Price:
 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
 Year:

 and labels get correctly translated! Why I get this log then?!?!?!

 This is just case for strings defined in Zend_Form.php, Zend_Validate.php
 strings are perfect.

 Please help.

 Regards,
 Saša Stamenković



Re: [fw-general] Re: Problem with form translation - strangle logs

2010-05-27 Thread James Carr

Саша Стаменковић wrote:
Also, I noticed the labels that are not translated at all (not found in 
sr or en version of Zend_Form.php) are logged twice, ex:


2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en': 
Gorivo:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en': 
Gorivo:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en': 
Lokacija:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en': 
Lokacija:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en': 
Sortiraj po:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en': 
Sortiraj po:


Even if there is only one element with that label. Maybe I'm doing 
something wrong with my base form.


I'm extending all forms from this one http://pastie.org/980646

Thanks in advance.

Regards,
Saša Stamenković


2010/5/27 Саша Стаменковић umpir...@gmail.com mailto:umpir...@gmail.com

Hi.

i have in bootstrap

protected function _initTranslate() {
$translate = new Zend_Translate(
Zend_Translate::AN_ARRAY,
realpath(APPLICATION_PATH . '/../data/languages'),
null,
array(
'scan' = Zend_Translate::LOCALE_DIRECTORY,
'log' = $this-getResource('log'),
'logUntranslated' = true
)
);
Zend_Form::setDefaultTranslator($translate);
return $translate;
}

under /../data/languages folder I have subfolder for each language
(sr, en, ru...). Under each of them I have Zend_Form.php
and Zend_Validate.php

 Zend_Validate.php is from svn, and Zend_Form.php looks like:

// sr
?php
return array(
Cena: = Cena:,
Godište: = Godište:,
);

//en
?php
return array(
Cena: = Price:,
Godište: = Year:,
);


When I set locale to sr_RS it's ok, but when I switch to en_Gb I get
log:

2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within
'en': Price:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within
'en': Year:

and labels get correctly translated! Why I get this log then?!?!?!

This is just case for strings defined
in Zend_Form.php, Zend_Validate.php strings are perfect.

Please help.

Regards,
Saša Stamenković




It's probably related to one of the following bug reports (they're all 
inter-related):


http://framework.zend.com/issues/browse/ZF-8694
http://framework.zend.com/issues/browse/ZF-8764
http://framework.zend.com/issues/browse/ZF-9371

There is a patch attached to the 8764 bug which works for me.

Hope that helps,
James.


Re: [fw-general] Re: Problem with form translation - strangle logs

2010-05-27 Thread Саша Стаменковић
Thanks, when it will be included into release?

Regards,
Saša Stamenković


On Thu, May 27, 2010 at 10:52 PM, James Carr j...@purpleankh.com wrote:

 Саша Стаменковић wrote:

 Also, I noticed the labels that are not translated at all (not found in sr
 or en version of Zend_Form.php) are logged twice, ex:

 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
 Gorivo:
 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
 Gorivo:
 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
 Lokacija:
 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
 Lokacija:
 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
 Sortiraj po:
 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
 Sortiraj po:

 Even if there is only one element with that label. Maybe I'm doing
 something wrong with my base form.

 I'm extending all forms from this one http://pastie.org/980646

 Thanks in advance.

 Regards,
 Saša Stamenković


 2010/5/27 Саша Стаменковић umpir...@gmail.com mailto:umpir...@gmail.com
 


Hi.

i have in bootstrap

protected function _initTranslate() {
$translate = new Zend_Translate(
Zend_Translate::AN_ARRAY,
realpath(APPLICATION_PATH . '/../data/languages'),
null,
array(
'scan' = Zend_Translate::LOCALE_DIRECTORY,
'log' = $this-getResource('log'),
'logUntranslated' = true
)
);
Zend_Form::setDefaultTranslator($translate);
return $translate;
}

under /../data/languages folder I have subfolder for each language
(sr, en, ru...). Under each of them I have Zend_Form.php
and Zend_Validate.php

 Zend_Validate.php is from svn, and Zend_Form.php looks like:

// sr
?php
return array(
Cena: = Cena:,
Godište: = Godište:,
);

//en
?php
return array(
Cena: = Price:,
Godište: = Year:,
);


When I set locale to sr_RS it's ok, but when I switch to en_Gb I get
log:

2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within
'en': Price:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within
'en': Year:

and labels get correctly translated! Why I get this log then?!?!?!

This is just case for strings defined
in Zend_Form.php, Zend_Validate.php strings are perfect.

Please help.

Regards,
Saša Stamenković



 It's probably related to one of the following bug reports (they're all
 inter-related):

 http://framework.zend.com/issues/browse/ZF-8694
 http://framework.zend.com/issues/browse/ZF-8764
 http://framework.zend.com/issues/browse/ZF-9371

 There is a patch attached to the 8764 bug which works for me.

 Hope that helps,
 James.