Error: {$mail->ErrorInfo} Please save the pot file and contact $author
";
}
}
else {
$this->status = '
In the Pro Version, the Pot file would have been sent to the plugin author. In this Lite version, please download the PO file (using the "Display & Save POT File" button above) and email it using your mail client.
';
}
return $adminNeeded;
}
return $adminNeeded;
}
// Prints out the admin page
function printAdminPage() {
echo '';
echo "
Please Wait. Loading...
";
if ($this->isEmbedded) {
$this->helpers = array('' => 'easy-common', 'easy-adsense' => 'easy-common');
}
$printed = false;
if (!$this->handleSubmits()) {
return $printed;
}
if (!isset($_POST['eztran'])) {
return $printed;
}
if (isset($_POST['ezt-english'])) {
return $printed;
}
$printed = true;
if ($this->isEmbedded) {
$backButtonVal = "Go Back to {$this->plgName} Admin";
}
else {
$backButtonVal = "Go Back to Easy Translator";
}
$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;
$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 if ($this->state == "English") {
$tip = htmlentities("If you would like to translate this plugin into a language you know or speak, please use the translation interface. It picks up the translatable strings in $plgName and presents them and their existing translations in your chosen language 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 = "If you speak another language, please help translate this plugin. Select a language: ";
}
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($target = '', $helper = '', $domain = '') {
$locale = '';
if (empty($target)) {
$target = $this->target;
}
if (empty($target)) {
$target = $this->locale;
}
if (empty($helper)) {
$moDir = "{$this->plgDir}/lang";
}
else {
$moDir = "{$this->plgDir}/../$helper/lang";
}
if (empty($domain)) {
$domain = $this->domain;
$moFile = "$moDir/{$target}.mo";
}
else {
$moFile = "$moDir/{$target}_{$domain}.mo";
}
$foundMO = false;
if (file_exists($moFile) && is_readable($moFile)) {
$foundMO = true;
}
else {
// look for any other similar locale with the same first two characters
$lo = substr($target, 0, 2);
$pattern = str_replace($target, "$lo*", $moFile);
$moFiles = glob($pattern);
if (!empty($moFiles)) {
$moFile = $moFiles[0];
$foundMO = true;
}
}
if ($foundMO) {
load_textdomain($domain, $moFile);
if ($this->isEmbedded) {
$locale = substr(basename($moFile), 0, 5);
}
}
return $locale;
}
function setLang($target = '') {
if (empty($target)) {
$target = $this->target;
}
$this->helpers = array('' => 'easy-common', 'easy-adsense' => 'easy-common');
$lo = substr($target, 0, 2);
if ($lo != 'en') {
$locale = $this->loadTran($target);
// Append translations in the helpers
foreach ($this->helpers as $helper => $domain) {
$this->loadTran($target, $helper, $domain);
}
if (empty($locale)) {
$this->state = "Not Translated";
}
else if ($locale == $this->locale) {
$this->state = "Translated";
}
else {
$this->state = "Alternate MO";
$this->locale = $locale;
}
}
else {
// TODO: Ask English speakers to help translate to their second lang
$this->state = "English";
}
}
function renderTranslator() {
if ($this->state == "English") {
// TODO: Translation interface requires more testing.
// return;
}
echo " \n";
echo " \n";
echo '