namesco / ZTal

ZTal makes integrating the PHP templating system PHPTAL into Zend Framework easy.
Other
21 stars 3 forks source link

trim() translation key before lookup #5

Closed sir-gawain closed 13 years ago

sir-gawain commented 13 years ago

your translation service should trim the key before using it. we often use something like this:

<td i18n:translate="string: MSG_MSGCTR_m022">MSG_MSGCTR_m022</td>

where a space before the key improves the readability a lot. but your service cannot find the key in this case.

far-blue commented 13 years ago

I've checked with the PHPTAL developers because the PHPTAL code is unclear and they have confirmed whitespace surrounding keys is allowed and will be trimmed in standard PHPTAL. I've implemented the same behaviour in dev and extended it to domains so now singular and plural translation keys as well as domain keys are trimmed.