Hy,

Maybe we must rethink the whole filtering thingy. I would propose to
split out the locale-dependant filters from Zend_Filter and put them
into - let's say - Zend_Locale_Filter. Zend_Locale_Filter has a lot of
subclasses, for instance Zend_Locale_Filter_German,
Zend_Locale_Filter_English, Zend_Locale_Filter_Japanese, etc. which
implements the filters for there own needs. Zend_Locale_Filter has a
factory class, were you can pass a Zend_Locale object or a simple locale
string to make sure, the correct subclass is instanced. Maybe there is
no other chance to ship around this locale-aware filter problem.

Making 126 subclasses, one for every language, is a very bad design idea.

Why not making the filter locale aware ?
Exactly therefor we created the complete Zend_Locale classes bunch.

Filter without locale only recognising a-z
getAlpha($content);

Filtering with locale recognising locale letters for example german including ä, ö, ü, ß
getAlpha($content, $locale);

Zend_Locale is not meant to be extended for every usecase from other classes.

There is a general approach for usage which should be used by all classes
which want to be locale aware.

Greeting
Thomas
(I18N Team Leader and Author)

Reply via email to