static function isLocaleValid($locale) { if (empty($locale)) { return false; } if (!preg_match('/^[a-z][a-z]_[A-Z][A-Z]$/', $locale)) { return false; } if (file_exists('locale/' . $locale)) { return true; } return false; }
function getMainEmailTemplateDataFilename($locale = null) { if ($locale !== null && !PKPLocale::isLocaleValid($locale)) { return null; } if ($locale === null) { $locale = '{$installedLocale}'; } return "locale/{$locale}/emailTemplates.xml"; }