On Fri, 11 Apr 2008, Andreas Schamberger wrote:

> >> Another thing I would recommend to add to the TemplateTranslationTiein
> >> is a developer mode for the TemplateTranslationTieIn. I'd like to see a
> >> development property in ezcTemplateTranslationConfiguration that makes
> >> the ezcTemplateTranslationProvider catch the Exceptions for missing
> >> translations/translation files and just return the string from the
> >> template. This solution makes it possible to develop with a template
> >> that doesn't have a valid translation file yet.
> > 
> > Hmm, I see your point here; however, I don't quite think that this is an 
> > elegant solution. I don't always want to catch the exception, and 
> > rethrow it when the configure option is not set, nor having two bits of 
> > code here for each case. Could you file a feature request for this 
> > please?
> 
> I agree with you that catching the exception in the TranslationProvider 
> is not nice. I propose to extend the TranslationManager and Translation 
> classes to a version that catches all exceptions and uses the given key 
> from the template. This also makes sure we only have to check once if we 
> are in dev mode or not.
> 
> if ( $dev === true )
> {
>      $manager = new ezcTranslationManagerCatchy( $backend );
> }
> else
> {
>      $manager = new ezcTranslationManager( $backend );
> }
> 
> I quickly tried this solution and could provide a patch if you want. 
> Somebody should also come up with a better name :)
> 
> In issue #011865 
> (<http://issues.ez.no/IssueView.php?Id=11865&activeItem=30>) there is 
> already a discussion about the introduction of run modes into the base 
> component. Could this make it into the next version? It doesn't seem to 
> be a lot of work and could be used globally for cases like the catchy 
> translation manager.

I think we should use a concept like this, and then implement the Catchy 
internally so that the exception isn't thrown. I'd be cool to have a 
feature request for this one though. At the moment we don't have time to 
put it in the 2008.1 release, but I think we should have the development 
modes in ezc for the 2008.2 release.

regards,
-- 
Derick Rethans
eZ components Product Manager
eZ systems | http://ez.no
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to