Hy,
you missunderstood something...
Expect the following:
You have english as standard language and used as messageids.
You have german and english translations.....
Now one of your messageid is not translated in german so the original
english will be returned instead of throwing an exception.
BUT:
If you set an language which Zend_Locale does not know it throws you an
exception.
Reading through the returned message you see:
Uncaught exception 'Zend_Translate_Exception' with message 'Language (nl)
has to be added before it can be used.
So what you will have to do before you can use a language is
$translate->addLanguage('myfile.mo', 'nl');
If something is not translated within a file... no problem...
But if there is no file we have no way to do anything but throw an exception
:-)
Greetings
Thomas
I18N Team Leader
----- Original Message -----
From: "debussy007" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, January 10, 2008 12:46 PM
Subject: [fw-general] Zend_Translate exception
Hi,
I am using Zend_Translate to internationalize my application.
$translate = new Zend_Translate('gettext', './public/ress/source-fr.mo',
'fr');
$translate->addTranslation('./public/ress/source-en.mo', 'en');
$translate->setLocale("nl");
Zend_Registry::set(Constants::REG_TRANSLATE, $translate);
The text is translated well if I set the local "fr" or "en" and it output
the string from the appropriate .mo file.
But once that I set it to "nl", I have the following exception:
Uncaught exception 'Zend_Translate_Exception' with message 'Language (nl)
has to be added before it can be used.
But I was excepting to have the untranslated string back ! Because in the
manual it says that if no translation is found for "nl", the original
message is returned.
Thank you for any help !
--
View this message in context:
http://www.nabble.com/Zend_Translate-exception-tp14731178s16154p14731178.html
Sent from the Zend Framework mailing list archive at Nabble.com.