Let's say I use english in my pages,
I will have to have an english translation of english ??
The problem is if I set the locale to "en" english, it will throw me that
exception because I do not want to provide a translation from english to
english. That's why I have no file for "en" in this case and it throws me an
exception.
Thomas Weidner-2 wrote:
>
> 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.
>
>
>
--
View this message in context:
http://www.nabble.com/Zend_Translate-exception-tp14731178s16154p14735844.html
Sent from the Zend Framework mailing list archive at Nabble.com.