Look into the manual for "automatic directory search" in Zend_Translate to see how you can automate such things.

Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com


----- Original Message ----- From: "reto" <[EMAIL PROTECTED]>
To: "Thomas Weidner" <[EMAIL PROTECTED]>
Cc: "Zend Mailing List" <fw-general@lists.zend.com>
Sent: Monday, February 11, 2008 1:32 PM
Subject: Re: [fw-general] Zend_Translate::setCache()


Hi,

Ok I see, I wrote some nonsense here, sorry. I meant the constructor
of the adapter (Zend/Translate/Adapter.php).

Ok your explanations made many things clearer..
So I should actually use something like this:
$translate = new Zend_Translate('gettext', '/some/file.de.mo', 'de');
$translate->addTranslation('/some/file.en.mo', 'en');
....
and this will then add all different languages into one cache?

Until now I loaded a different file with the
Zend_Translate-constructor dependent on the language I want to
output.. And then of course that language was cached, and I couln't
use another one..

Greetings,
Reto Kaiser

On Feb 11, 2008 8:59 AM, Thomas Weidner <[EMAIL PROTECTED]> wrote:
Hy reto,

what do you mean with "not utilized" ?
They are used within the adapter.

And the constructor does not just return if he finds a cache...
He calls setAdapter... and there the adapter is initialised and read.
There is no return statement.

Maybe you have used false settings ?

And no the cache identifier should not contain the locale...
There are formats out there where a file contains multiple locales.
And as you can not know which locale is available you can also not set the
locale there.
This is one of the reasons why a single cache is used.

Of course all translations use the same cache...
To double all messageids for all locales would not only be useless but also
a problem in speed if you use more then 2 languages.

Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com


----- Original Message -----
From: "reto" <[EMAIL PROTECTED]>
To: "Zend Mailing List" <fw-general@lists.zend.com>; "Thomas Weidner"
<[EMAIL PROTECTED]>
Sent: Sunday, February 10, 2008 11:30 PM
Subject: [fw-general] Zend_Translate::setCache()


> Hi Thomas,
>
> I just wanted to try the caching-feature of Zend_Translate.
> The problem I ran over is, that when I give the
> Zend_Translate()-constructor  the parameters "locale" (and probably
> "options") those are not utilized.
> This seems to be because if the constructor finds a cache for the
> translation it just returns.
>
> Another thought: Shouldn't the cache-identifier at least contain the
> locale? Because at the moment it's just "Zend_Translate_Gettext" for
> me. Wouldn't then all different translations use the same cache?
>
> Greetings,
> Reto Kaiser



Reply via email to