public function run() { if (!($language = $this->grid->getCompleteRequest()->get('language'))) { $language = Am_Di::getInstance()->locale->getLanguage(); } $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; //return response without layout $outputDataSource = new TranslationDataSource_PO(); $inputDataSource = $this->grid->getDataSource()->getTDataSource(); $filename = $outputDataSource->getFileName($language); Am_Controller::noCache(); header('Content-type: text/plain'); header("Content-Disposition: attachment; filename={$filename}"); echo $outputDataSource->getFileContent($language, $inputDataSource->getTranslationData($language, TranslationDataSource_Abstract::FETCH_MODE_REWRITTEN)); }