i m creating a website with multilingual features. and i have search and found the zend_translate is the best way to translating the text. but i have started my website with simple php(no framework) and completed many modules. but now i want to use translator in my site which translate the php texts and the text come from the database(mysql)
i can use gettext() but i have no rights to install the gettext() on my live server so i have choose zend_translate. so can anybody help me to use zend_translate with using the zend framework and without copying the whole zend library files. or give me some another way.
Thanks.
You can't pull just Zend_Translate unless you decide to modify its code, by using Zend_Translate you will have to get Zend_Exception, Zend_Registry (not sure about this), Zend_Cache (if you want caching) and thats it I think.
Copy the needed code to you project, with the appropriate adapter you want to use, and then just create instance of Zend_Translate as following
Then somewhere in your code do
To add more languages do something like:
And to output with french locale write:
For more information please see http://framework.zend.com/manual/en/zend.translate.html Good luck!