/** * Extracts translatables from .ss templates (Self referencing) * * @param string $content The text content of a parsed template-file * @param string $fileName The name of a template file when method is used in self-referencing mode * @param string $module Module's name or 'themes' * @param array $parsedFiles * @return array $entities An array of entities representing the extracted template function calls */ public function collectFromTemplate($content, $fileName, $module, &$parsedFiles = array()) { // use parser to extract <%t style translatable entities $entities = i18nTextCollector_Parser::GetTranslatables($content); // use the old method of getting _t() style translatable entities // Collect in actual template if (preg_match_all('/(_t\\([^\\)]*?\\))/ms', $content, $matches)) { foreach ($matches[1] as $match) { $entities = array_merge($entities, $this->collectFromCode($match, $module)); } } foreach ($entities as $entity => $spec) { unset($entities[$entity]); $entities[$this->normalizeEntity($entity, $module)] = $spec; } ksort($entities); return $entities; }