mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
faff2c122d
commit
498a3fdf49
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user