setProperties([ 'id' => 'po2php', 'name' => __('Translation files'), 'description' => __('Compile existing translation .po files to fresh .lang.php files'), 'priority' => 310, 'types' => ['plugin', 'theme'], ]); return true; } public function isConfigured(): bool { return true; } public function closeFile(): ?bool { if (!in_array($this->path_extension, ['po'])) { return null; } if (l10n::generatePhpFileFromPo(substr($this->path_full, 0, -3), $this->license)) { $this->setSuccess(__('Compile .po file to .lang.php')); } else { $this->setError(__('Failed to compile .po file')); } return true; } }