Zend_Translate

1 message Options
Embed this post
Permalink
Joseph Crawford

Zend_Translate

Reply Threaded More More options
Print post
Permalink
Hello,

I have been working on getting a feel for Zend_Translate and the gettext integration.  I have it working properly with the following code.

$translate = new Zend_Translate('gettext', dirname(__FILE__) . '/languages/', null, array('scan' => Zend_Translate::LOCALE_FILENAME));
if(!empty($_GET['locale'])) $translate->setLocale($_GET['locale']);
Zend_Registry::set('Zend_Translate', $translate);

For the time being I am just using a quick query string to test out the translations by setting the Locale.  The issue that I am having is that I have found no way to tell Zend_Translate what the default locale will be.  By this I mean the language I use in the translate calls.

I keep getting notices like the following because I do not have an en.po file.  English is the default so why should I be given warnings that the en file does not exist.  There should be a way to tell it that en_EN is the default so it does not need to look for the translation file.

Is there something I am doing wrong?  I know the notices are not important since they will only show in development mode but still shouldn't there be a way to set the default?