Error: ' . $mail->ErrorInfo .
' Please save the pot file and contact the author
';
}
return $adminNeeded;
}
return $adminNeeded;
}
// Prints out the admin page
function printAdminPage() {
$printed = false;
if (!$this->handleSubmits()) {
return $printed;
}
if (!isset($_POST['eztran'])) {
return $printed;
}
if (isset($_POST['ezt-english'])) {
return $printed;
}
$printed = true;
$backButton = " If you are done with translating, You can continue later, and your translation for the session will be remembered until you close the browser window.";
echo '
';
echo '
EOF1;
echo $makeStr;
echo $pot;
}
echo "\n";
return $printed;
}
function getInvite() {
$locale = $this->locale;
$lo = substr($locale, 0, 2);
if ($lo == 'en') {
return "";
}
$plgName = $this->plgName;
$patience = "I will include your translation in the next release.
Please note that the page may take a while to load because the plugin will query Google Translator for each string. Please be patient!";
if ($this->state == "Not Translated") {
$tip = htmlentities("It is easy to have $plgName in your language. All you have to do is to translate some strings, and email the file to the author.
If you would like to help, please use the translation interface. It picks up the translatable strings in $plgName and presents them (and their existing translations in $locale, if any) in an easy-to-edit form. You can then generate a translation file and email it to the author all from the same form. $patience");
$invite = " Would you like to see $plgName in your langugage ($locale)? ";
}
else {
$tip = htmlentities("If you would like to improve this translation, please use the translation interface. It picks up the translatable strings in $plgName and presents them and their existing translations in $locale in an easy-to-edit form. You can then generate a translation file and email it to the author all from the same form. Slick, isn\'t it? $patience");
$invite = " Would you like to improve this translation of $plgName in your langugage ($locale)? ";
}
return $invite;
}
function loadTran($helper = '') {
$locale = '';
if (empty($helper)) {
$moDir = "{$this->plgDir}/lang";
}
else {
$moDir = "{$this->plgDir}/../$helper/lang";
}
$moFile = "$moDir/{$this->locale}.mo";
$lo = substr($this->locale, 0, 2);
if (file_exists($moFile) && is_readable($moFile)) {
load_textdomain($this->domain, $moFile);
$locale = basename(dirname($moFile));
}
else {
// look for any other similar locale with the same first two characters
$moFiles = glob("$moDir/$lo*.mo");
if (!empty($moFiles)) {
$moFile = $moFiles[0];
load_textdomain($this->domain, $moFile);
$locale = basename(dirname($moFile));
}
}
return $locale;
}
function setLang() {
$locale = $this->locale;
$lo = substr($locale, 0, 2);
if ($lo != 'en') {
$locale = $this->loadTran();
// Append translations in the helpers
foreach ($this->helpers as $helper) {
$this->loadTran($helper);
}
}
if (empty($locale)) {
$this->state = "Not Translated";
}
else if ($locale == $this->locale) {
$this->state = "Translated";
}
else {
$this->state = "Alternate MO";
}
return $locale;
}
function renderTranslator() {
if (strncmp($this->locale, "en", 2) == 0) {
return;
}
echo " \n";
echo " \n";
echo '