Google Groups

Re: [silverstripe-dev] _t() and in 3.0

Sam Minnée Nov 20, 2011 1:12 PM
Posted in group: SilverStripe Core Development
Zend_Translate should be able to be plugged into that without too much bother, but this is another argument for leaving all the existing APIs as the primary APIs rather than deprecating them in favor over some Zend thing.

It does raise a question, however:

 - Does the new template system work with TextCollector?
 - Does TextCollector have a plug-in API so that text collection for the template system can be part of the template system?  I can see need for 3 text collector modules so far: PHP, JavaScript, and Templates.

On 21/11/2011, at 9:29 AM, Hamish Friedlander wrote:

Just to add more confusion to the mix, somehow we missed merging Julian's ssviewer enhancements for the alpha, but that includes the new _t replacement for templates (I suspect there'll be merge clashes with whatever you've done Ingo, sorry).

This change also improves the php version of _t to support the named arguments in the replacement string.

We had a long discussion at that stage about how translate calls should look. I don't think we need to have another one. If Zend_Translate can't be made to support the syntax from that discussion and patch, I'm against using it. We already have a working translation system, and I'm against replacing a working component with a third party one just to reduce our maintenance surface.

However I think replacing the data structure with yaml or something else is perfectly sensible. The config system uses yaml, so if that looks good I'd vote for that.