Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend GetText and .mo .po files

I have inherited from an application made a developement company, and i need to get the .mo and .po files generated for my website.

Here's what i have in the bootstrap :

$translate = new Zend_Translate ('gettext', ROOT_PATH.'/languages/en/default.mo', 'en', array('disableNotices' => true));
$translate->setLocale($locale);

I'm using the translate helper everywhere i have to set up text on my website but my .mo and .po files do not contain all the strings that are set up in my application.

Is there some command that i need to run for the gettext files to be populated?

Thanks !

like image 584
user1159791 Avatar asked Feb 22 '23 15:02

user1159791


1 Answers

You can use Poedit, and configure it to scan your sources (*.php and *.phtml), which generates .po and .mo files. Since I guess you're already using Poedit to enter translations - so you can as well use its ability to scan source files and collect all the translation strings from your code.

Here is a good tutorial how to configure Poedit so it will recognize Zend Framework files and $this->translate('') commands from templates.

Good luck.

like image 73
KoviNET Avatar answered Mar 06 '23 17:03

KoviNET