public function export($language)
{
$language_path = $this->language_path . $language->code . '/';
if (File::exists($language_path)) {
$file_name = "doptor_translation_{$language->code}";
$this->export_temp_path = temp_path() . '/translations_export/' . $file_name;
if (File::exists($this->export_temp_path) && !is_file($this->export_temp_path)) {
// delete old exported files
File::deleteDirectory($this->export_temp_path);
}
$temp_lang_path = $this->export_temp_path . '/lang';
File::copyDirectory($language_path, $temp_lang_path);
$this->writeConfig($language);
$zip_file = $this->export_temp_path . ".zip";
Zip($this->export_temp_path, $zip_file, false);
return $zip_file;
}
}