/** * Return translations according to definition in help.ini. */ public function getTranslation() { // load translations in order specified in help.ini $helpConfig = new Zend_Config_Ini(APPLICATION_PATH . '/application/configs/help/help.ini'); $helpConfigArray = $helpConfig->toArray(); $tmxData = parent::getTranslation(); $filteredTmxData = array(); foreach ($helpConfigArray as $helpKey => $helpContents) { if (isset($tmxData[$helpKey])) { $filteredTmxData[$helpKey] = $tmxData[$helpKey]; } foreach ($helpContents as $value) { if (isset($tmxData["help_title_{$value}"])) { $filteredTmxData["help_title_{$value}"] = $tmxData["help_title_{$value}"]; } if (isset($tmxData["help_content_{$value}"])) { $filteredTmxData["help_content_{$value}"] = $tmxData["help_content_{$value}"]; } } } return $filteredTmxData; }
/** * Set paths to directories where the translation source files resides. * The complete path to the files is generated from the page name, * i.e. each file must be named after the page name. * @param array $tmxSourcePaths Array of directory paths used for reading tmx content * */ public function setTranslationSourcePaths(array $tmxSourcePaths) { $filePaths = array(); foreach ($tmxSourcePaths as $tmxsrc) { $filePaths[] = $tmxsrc . DIRECTORY_SEPARATOR . $this->pageName . '.tmx'; } parent::setTranslationSources($filePaths); }