Reputation: 59
I am beginner with the Zend Framework.
I have one simple small web application which is in English Language. I want to translate it in Hindi. I referred to Zend_Translate but I wasn't able to understand how it works, would someone be able to help me? I m not getting idea for zend_translate... Please give me a controller, bootstrap and form code which translate a simple english string to hindi...
Upvotes: 0
Views: 776
Reputation: 1204
The steps you have to make depend on which adapter you choose (for example gettext requires using editor for .po files (Poedit)).
Generally you have to:
To my mind, documentation about Zend_Translate on zendframework.com is quite good add one should be able to start using translation based on information from reference guide.
Upvotes: 0
Reputation: 27313
Zend_Translate is a component used for localization, this component enable you to store your different translated string in some various formats(XML, PHP, CSV, gettext). After loading your translated content, you can use the component to show your translated pieces in your view.
Here an example extracted from the manual
$translate = new Zend_Translate(
array(
'adapter' => 'gettext',
'content' => '/my/path/source-de.mo',
'locale' => 'de'
)
);
$translate->addTranslation(
array(
'content' => '/path/to/translation/fr-source.mo',
'locale' => 'fr'
)
);
print $translate->_("Example") . "\n";
print "=======\n";
print $translate->_("Here is line one") . "\n";
printf($translate->_("Today is the %1\$s") . "\n", date('d.m.Y'));
print "\n";
$translate->setLocale('fr');
print $translate->_("Here is line two") . "\n";
Upvotes: 1