Currently, I'm trying to apply Zend_Translate to the project I'm working on. Regular text works perfectly fine, but I ran into a problem with the translation of forms.
The translation adapter is registered in Zend_Registry, using Zend_Translate as key. This works fine for most of the time, except for when the translation should happen before displaying the form.
Code example:
$subformBusiness->setLegend(_('Bedrijfsgegevens') . ':');
$subformBusiness->setLegend(_('Bedrijfsgegevens'));
Assuming 'Bedrijfsgegevens' is translated in the corresponding translation source files, the upper line will be outputted as 'Bedrijfsgegevens:', whereas the lower line outputs 'Business information'.
As far as I know, there are three ways of solving this. It can be solved by calling the stored Zend_Translate_Adapter before concatenating it with the colon, but that gives a lot of unnecessary code. Another option is to incorporate punctuation in the translation files, but that would mean there should be a translation for each type of punctuation. The thrid option is to simply remove the colon from the legend, but that's not what I'm looking for.
My question: is there a way to tell Zend_Translate to disregard punctuation?
Why don't you add the punctuation to the strings? OK, you will have to translate both 'Legend' and 'Legend:', but that works perfectly for me.
E.g.: