Skip to content
This repository
Browse code

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
  • Loading branch information...
commit 498a3fdf49c08ad5eb485bedc7e3bca046188d71 1 parent faff2c1
Ingo Schommer authored July 18, 2012

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  i18n/i18nTextCollector.php
6  i18n/i18nTextCollector.php
@@ -310,9 +310,9 @@ public function collectFromTemplate($content, $fileName, $module) {
310 310
 
311 311
 		// use the old method of getting _t() style translatable entities
312 312
 		// Collect in actual template
313  
-		if(preg_match_all('/<%\s*(_t\(.*)%>/ms', $content, $matches)) {
314  
-			foreach($matches as $match) {
315  
-				$entities = array_merge($entities, $this->collectFromCode($match[0], $module));
  313
+		if(preg_match_all('/(_t\([^\)]*?\))/ms', $content, $matches)) {
  314
+			foreach($matches[1] as $match) {
  315
+				$entities = array_merge($entities, $this->collectFromCode($match, $module));
316 316
 			}
317 317
 		}
318 318
 

0 notes on commit 498a3fd

Please sign in to comment.
Something went wrong with that request. Please try again.