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! You can make it faster by unchecking the Use Google option.";
$tipPot = htmlentities("If you would like to use your own tools to translate (such as poedit), please download the POT file here. Once done with the translation, please send the po file to the plugin author: manoj at thulasidas dot com");
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");
$langs = array('af_AF' => 'Afrikaans',
'sq_SQ' => 'Albanian',
'ar_AR' => 'Arabic',
'hy_HY' => 'Armenian',
'az_AZ' => 'Azerbaijani',
'eu_EU' => 'Basque',
'be_BE' => 'Belarusian',
'bn_BN' => 'Bengali',
'bs_BS' => 'Bosnian',
'bg_BG' => 'Bulgarian',
'ca_CA' => 'Catalan',
'zh-CN' => 'Chinese',
'hr_HR' => 'Croatian',
'cs_CS' => 'Czech',
'da_DA' => 'Danish',
'nl_NL' => 'Dutch',
'eo_EO' => 'Esperanto',
'et_ET' => 'Estonian',
'tl_TL' => 'Filipino',
'fi_FI' => 'Finnish',
'fr_FR' => 'French',
'gl_GL' => 'Galician',
'ka_KA' => 'Georgian',
'de_DE' => 'German',
'el_EL' => 'Greek',
'gu_GU' => 'Gujarati',
'ht_HT' => 'Haitian Creole',
'ha_HA' => 'Hausa',
'iw_IW' => 'Hebrew',
'hi_HI' => 'Hindi',
'hu_HU' => 'Hungarian',
'is_IS' => 'Icelandic',
'ig_IG' => 'Igbo',
'id_ID' => 'Indonesian',
'ga_GA' => 'Irish',
'it_IT' => 'Italian',
'ja_JA' => 'Japanese',
'jw_JW' => 'Javanese',
'kn_KN' => 'Kannada',
'km_KM' => 'Khmer',
'ko_KO' => 'Korean',
'lo_LO' => 'Lao',
'la_LA' => 'Latin',
'lv_LV' => 'Latvian',
'lt_LT' => 'Lithuanian',
'mk_MK' => 'Macedonian',
'ms_MS' => 'Malay',
'mt_MT' => 'Maltese',
'mi_MI' => 'Maori',
'mr_MR' => 'Marathi',
'mn_MN' => 'Mongolian',
'ne_NE' => 'Nepali',
'no_NO' => 'Norwegian',
'fa_FA' => 'Persian',
'pl_PL' => 'Polish',
'pt_PT' => 'Portuguese',
'pa_PA' => 'Punjabi',
'ro_RO' => 'Romanian',
'ru_RU' => 'Russian',
'sr_SR' => 'Serbian',
'sk_SK' => 'Slovak',
'sl_SL' => 'Slovenian',
'so_SO' => 'Somali',
'es_ES' => 'Spanish',
'sw_SW' => 'Swahili',
'sv_SV' => 'Swedish',
'ta_TA' => 'Tamil',
'te_TE' => 'Telugu',
'th_TH' => 'Thai',
'tr_TR' => 'Turkish',
'uk_UK' => 'Ukrainian',
'ur_UR' => 'Urdu',
'vi_VI' => 'Vietnamese',
'cy_CY' => 'Welsh',
'yi_YI' => 'Yiddish',
'yo_YO' => 'Yoruba',
'zu_ZU' => 'Zulu');
$langOptions = '';
foreach ($langs as $k => $v) {
if ($this->target == $k) {
$selected = "selected='selected'";
}
else {
$selected = '';
}
$langOptions .= "\n";
}
$invite = "If you speak another language, please help translate this plugin. You can either use our web interface or download the POT files. "
. "Select a language: "
. " Use Google? "
. " "
. " ";
}
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. $patience");
$invite = " Would you like to improve this translation of $plgName in your langugage ($locale)? "
. " Use Google? "
. " "
. " ";
}
$invite .= '';
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() {
$this->getSessionVars();
echo " \n";
echo " \n";
echo '