BUG Fixed i18n text collection in templates

- Non-greedy regex matching to collect more than
one entity per template...
- Regex failed to collect sprintf() properly
This commit is contained in:
Ingo Schommer 2012-07-18 14:58:53 +02:00
parent faff2c122d
commit 498a3fdf49

View File

@ -310,9 +310,9 @@ class i18nTextCollector extends Object {
// use the old method of getting _t() style translatable entities
// Collect in actual template
if(preg_match_all('/<%\s*(_t\(.*)%>/ms', $content, $matches)) {
foreach($matches as $match) {
$entities = array_merge($entities, $this->collectFromCode($match[0], $module));
if(preg_match_all('/(_t\([^\)]*?\))/ms', $content, $matches)) {
foreach($matches[1] as $match) {
$entities = array_merge($entities, $this->collectFromCode($match, $module));
}
}