Ok, so actually your conclusion is: don't use Zend_Translate. You're saying it *is* possible, but that's actually using something it isn't meant for.
The example with the blog post: of course I need an overview of some (eg the latest) posts, so I'm loading more than one model. Thus requiring multiple instances, it's better to write a custom translater (which is especially for these translations and light weight) and avoid the overhead. Thanks for helping me out! Regards, Jurian -- Jurian Sluiman Soflomo.com Op Friday 28 August 2009 13:43:59 schreef Thomas Weidner: > When you are heading for the problem that "Title" can hold different > content based on a selection and not based on a locale then you are not > heading for translation. > > Translation means that the same key is always translated the same when the > locale is identical. > What you describe is not translation but a sort of selection. > > Translation is not captable to solve this out of the box. > Still it would be possible: > > Load your application wide translations within your bootstrap and cache > them. > Then add translations by your model but dont cache them. > > But this would only work if you don't load 2 models at the same time when > they use the same selection. > In the latter case you would have to use multiple instances. > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > ----- Original Message ----- > From: "Jurian Sluiman" <[email protected]> > To: <[email protected]> > Sent: Friday, August 28, 2009 1:26 PM > Subject: Re: [fw-general] Integrate translation into models > > Op Friday 28 August 2009 13:18:16 schreef Thomas Weidner: > > Why would you need to use multiple instances of Zend_Translate ? > > You should use one application wide instance which holds your > > translations. > > You can add translations manually (addTranslation) when you splitted them > > model-based. > > > > Or do you think that "Enter your name" is different between models ? > > It's always the same translation regardless of the model behind. > > > > Greetings > > Thomas Weidner, I18N Team Leader, Zend Framework > > http://www.thomasweidner.com > > Hi Thomas, > Thanks for you fast answer! What you mean are things I manage inside my > view (I agree "enter your name" is a more global managed translation). I > mean the models I fetch from db. E.g. having a blog post. That's a model > Blog_Model_Post, having a title, lead and body text. All three are > translated. > > Ideal, I'd like to have in my view "echo $blog->getTitle()" and the model > itself fetches the right translation of the title. Therefore, it has some > translation logic inside. But for every model the translation of "title" is > completely different, so having the same instance is not possible. > > What's you opinion about these more "dynamic" translations fetched from the > database? > > Thanks in advance, > Jurian > > -- > Jurian Sluiman > Soflomo.com
signature.asc
Description: This is a digitally signed message part.
