The registry key "Zend_Translate" is used by all components which provide
translation capabilities when no other translation object is set.
It is used application wide and this approach is also described within the
manual.
By setting this key into registry there is nothing more you have to do.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "kusum" <[email protected]>
To: <[email protected]>
Sent: Friday, November 20, 2009 7:38 PM
Subject: Re: [fw-general] Problem with Zend_translate
Thanks to all the suggestions...
I read all and tried them...
Finally my translate worked with.....
application.ini :-
resources.translate.data = APPLICATION_PATH "/languages"
resources.translate.adapter = "array"
resources.translate.locale = "nl"
resources.translate.options.scan = "filename"
resources.translate.options.logUntranslated = true
i made three files in languages folder :-
en.php,nl.php,fr.php
each had the required translation
for eg en.php
<?php
return array(
'application' => 'application',
);
?>
and nl.php
<?php
return array(
'application' => 'applicatie',
);
?>
then when i tried <?php echo
Zend_Registry::get('Zend_Translate')->_("application"); ?>
in one of my files
with locale en it showed :- application
with locale nl it showed :- applicatie
This all is wonderfull :clap:
Just one last request :-
we can set the default translator for forms by
$tr = Zend_Registry::get('Zend_Translate');
Zend_Registry::set('tr', $tr);
Zend_Form::setDefaultTranslator($tr);
but by this $tr we are able to do translation just for forms
If i need to use it for any messages i have to write
echo Zend_Registry::get('Zend_Translate')->
Is there any other way to setDefaultTranslator for the whole application
at
one place ???????????????
Thanks and Regards
Kusum
--
View this message in context:
http://old.nabble.com/Problem-with-Zend_translate-tp26400093p26443620.html
Sent from the Zend Framework mailing list archive at Nabble.com.