diff --git a/elementtypes/TranslateElementType.php b/elementtypes/TranslateElementType.php index c39cd50..ad75503 100644 --- a/elementtypes/TranslateElementType.php +++ b/elementtypes/TranslateElementType.php @@ -91,8 +91,8 @@ public function getSources($context = null) $templates = IOHelper::getFolderContents(craft()->path->getSiteTemplatesPath(), false); foreach($templates as $template) { - // Get path/name of html/twig/js/json files and folders - preg_match('/(.*)\/(.*?)(\.(html|twig|js)|\/)$/', $template, $matches); + // Get path/name of template files and folders + preg_match('/(.*)\/(.*?)(\.(html|twig|js|json|atom|rss)|\/)$/', $template, $matches); $path = $matches[2]; $templateSources['templates:'.$path] = array( diff --git a/services/TranslateService.php b/services/TranslateService.php index 0dbb5a0..f0fb2d1 100644 --- a/services/TranslateService.php +++ b/services/TranslateService.php @@ -38,8 +38,11 @@ public function init() // Init parent parent::init(); - // Also use html expressions for twig templates + // Also use html expressions for twig/json/atom/rss templates $this->_expressions['twig'] = $this->_expressions['html']; + $this->_expressions['json'] = $this->_expressions['html']; + $this->_expressions['atom'] = $this->_expressions['html']; + $this->_expressions['rss'] = $this->_expressions['html']; } @@ -97,7 +100,7 @@ public function get($criteria) if(!$isFile) { // Set filter - no vendor folders, only template files - $filter = '^((?!vendor).)*(\.(php|html|twig|js)?)$'; + $filter = '^((?!vendor).)*(\.(php|html|twig|js|json|atom|rss)?)$'; // Get files $files = IOHelper::getFolderContents($path, true, $filter);