Changeset 2908

Show
Ignore:
Timestamp:
11/02/06 04:54:46 (7 years ago)
Author:
gregmac
Message:

i18n of module admin page (#1194)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/page.modules.php

    r2907 r2908  
    3737 
    3838?> 
    39  
    40 <!-- <div class="rnav"> 
    41   <li><a id="<?php echo ($extdisplay=='' ? 'current':'') ?>" href="config.php?display=modules&type=tool&extdisplay="><?php echo _("Local Modules") ?></a></li> 
    42   <li><a id="<?php echo ($extdisplay=='online' ? 'current':'') ?>" href="config.php?display=modules&type=tool&extdisplay=online"><?php echo _("Online Modules") ?></a></li> 
    43 </div> 
    44 --> 
    45  
    4639<script type="text/javascript" src="common/tabber-minimized.js"></script> 
    4740<script type="text/javascript"> 
     
    218211        case 'downloadinstall': 
    219212          if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    220             echo 'Downloading '.$modulename.' <span id="downloadprogress_'.$modulename.'"></span>'; 
     213            echo sprintf(_('Downloading %s'), $modulename).' <span id="downloadprogress_'.$modulename.'"></span>'; 
    221214            if (is_array($errors = module_download($modulename, false, 'download_progress'))) { 
    222               echo '<span class="error">Error(s) downloading '.$modulename.': '; 
     215              echo '<span class="error">'.sprintf(_("Error(s) downloading %s"),$modulename).': '; 
    223216              echo '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'; 
    224217              echo '</span>'; 
     
    226219             
    227220              if (is_array($errors = module_install($modulename))) { 
    228                 echo '<span class="error">Error(s) installing '.$modulename.': '; 
     221                echo '<span class="error">'.sprintf(_("Error(s) installing %s"),$modulename).': '; 
    229222                echo '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'; 
    230223                echo '</span>'; 
    231224              } else { 
    232                 echo '<span class="success">'.$modulename.' installed successfully</span>'; 
     225                echo '<span class="success">'.sprintf(_("%s installed successfully"),$modulename).'</span>'; 
    233226              } 
    234227            } 
     
    238231          if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    239232            if (is_array($errors = module_install($modulename))) { 
    240               echo '<span class="error">Error(s) installing '.$modulename.': '; 
     233              echo '<span class="error">'.sprintf(_("Error(s) installing %s"),$modulename).': '; 
    241234              echo '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'; 
    242235              echo '</span>'; 
    243236            } else { 
    244               echo '<span class="success">'.$modulename.' installed successfully</span>'; 
     237              echo '<span class="success">'.sprintf(_("%s installed successfully"),$modulename).'</span>'; 
    245238            } 
    246239          } 
     
    248241        case 'enable': 
    249242          if (is_array($errors = module_enable($modulename))) { 
    250             echo '<span class="error">Error(s) enabling '.$modulename.': '; 
     243            echo '<span class="error">'.sprintf(_("Error(s) enabling %s"),$modulename).': '; 
    251244            echo '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'; 
    252245            echo '</span>'; 
    253246          } else { 
    254             echo '<span class="success">'.$modulename.' enabled successfully</span>'; 
     247            echo '<span class="success">'.sprintf(_("%s enabled successfully"),$modulename).'</span>'; 
    255248          } 
    256249        break; 
    257250        case 'disable': 
    258251          if (is_array($errors = module_disable($modulename))) { 
    259             echo '<span class="error">Error(s) disabling '.$modulename.': '; 
     252            echo '<span class="error">'.sprintf(_("Error(s) disabling %s"),$modulename).': '; 
    260253            echo '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'; 
    261254            echo '</span>'; 
    262255          } else { 
    263             echo '<span class="success">'.$modulename.' disabled successfully</span>'; 
     256            echo '<span class="success">'.sprintf(_("%s disabled successfully"),$modulename).'</span>'; 
    264257          } 
    265258        break; 
     
    267260          if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    268261            if (is_array($errors = module_uninstall($modulename))) { 
    269               echo '<span class="error">Error(s) uninstalling '.$modulename.': '; 
     262              echo '<span class="error">'.sprintf(_("Error(s) uninstalling %s"),$modulename).': '; 
    270263              echo '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'; 
    271264              echo '</span>'; 
    272265            } else { 
    273               echo '<span class="success">'.$modulename.' uninstalled successfully</span>'; 
     266              echo '<span class="success">'.sprintf(_("%s uninstalled successfully"),$modulename).'</span>'; 
    274267            } 
    275268          } 
     
    347340      echo "<p>"._("Please select at least one action to perform by clicking on the module, and selecting an action on the \"Action\" tab.")."</p>"; 
    348341    } 
    349     echo "\t<input type=\"button\" value=\"Cancel\" onclick=\"location.href = 'config.php?display=modules&amp;type=tool&amp;online=1';\" />"; 
     342    echo "\t<input type=\"button\" value=\""._("Cancel")."\" onclick=\"location.href = 'config.php?display=modules&amp;type=tool&amp;online=1';\" />"; 
    350343     
    351344    echo "</form>"; 
     
    372365      if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    373366        echo "<a href='config.php?display=modules&amp;type=tool&amp;online=0'>"._("Manage local modules")."</a>\n"; 
    374         echo "<input type=\"checkbox\" id=\"show_upgradable_only\" onclick=\"showhide_upgrades();\" />Show only upgradable"; 
     367        echo "<input type=\"checkbox\" id=\"show_upgradable_only\" onclick=\"showhide_upgrades();\" /><label for=\"show_upgradable_only\">"._("Show only upgradable")."</label>"; 
    375368      } 
    376369    } else { 
     
    389382    if ($online) { 
    390383      //echo "\t<input type=\"button\" value=\"Upgrade all\" onClick=\"check_upgrade_all();\" />"; 
    391       echo "\t<a href=\"javascript:void(null);\" onclick=\"check_upgrade_all();\">Upgrade all</a>"; 
    392     } 
    393     echo "\t<input type=\"reset\" value=\"Reset\" />"; 
    394     echo "\t<input type=\"submit\" value=\"Process\" name=\"process\" />"; 
     384      echo "\t<a href=\"javascript:void(null);\" onclick=\"check_upgrade_all();\">"._("Upgrade all")."</a>"; 
     385    } 
     386    echo "\t<input type=\"reset\" value=\""._("Reset")."\" />"; 
     387    echo "\t<input type=\"submit\" value=\""._("Process")."\" name=\"process\" />"; 
    395388    echo "</div>"; 
    396389 
     
    398391 
    399392    echo "\t<div id=\"modulelist-header\">"; 
    400     echo "\t\t<span class=\"modulename\">Module</span>\n"; 
    401     echo "\t\t<span class=\"moduletype\">Type</span>\n"; 
    402     echo "\t\t<span class=\"moduleversion\">Version</span>\n"; 
     393    echo "\t\t<span class=\"modulename\">"._("Module")."</span>\n"; 
     394    echo "\t\t<span class=\"moduletype\">"._("Type")."</span>\n"; 
     395    echo "\t\t<span class=\"moduleversion\">"._("Version")."</span>\n"; 
    403396    echo "\t\t<span class=\"clear\">&nbsp;</span>\n"; 
    404397    echo "\t</div>"; 
     
    420413        // start a new category header, and associated html blocks 
    421414        $category = $modules[$name]['category']; 
    422         echo "\t<div class=\"category\" id=\"category_".prep_id($category)."\"><h3>".$category."</h3>\n"; 
     415        echo "\t<div class=\"category\" id=\"category_".prep_id($category)."\"><h3>"._($category)."</h3>\n"; 
    423416        echo "\t<ul>"; 
    424417      } 
     
    436429        case MODULE_STATUS_NOTINSTALLED: 
    437430          if (isset($modules_local[$name])) { 
    438             echo '<span class="alert">Not Installed (Locally available)</span>'; 
     431            echo '<span class="alert">'._('Not Installed (Locally available)').'</span>'; 
    439432          } else { 
    440             echo 'Not Installed (Available online: '.$modules_online[$name]['version'].')'
     433            echo sprintf(_('Not Installed (Available online: %s)'), $modules_online[$name]['version'])
    441434          } 
    442435        break; 
     
    445438            $vercomp = version_compare($modules_local[$name]['version'], $modules_online[$name]['version']); 
    446439            if ($vercomp < 0) { 
    447               echo '<span class="alert">Disabled; Online upgrade available ('.$modules_online[$name]['version'].')</span>'; 
     440              echo '<span class="alert">'.sprintf(_('Disabled; Online upgrade available (%s)'),$modules_online[$name]['version']).'</span>'; 
    448441            } else if ($vercomp > 0) { 
    449               echo 'Disabled; Newer than online version ('.$modules_online[$name]['version'].')'
     442              echo sprintf(_('Disabled; Newer than online version (%s)'), $modules_online[$name]['version'])
    450443            } else { 
    451               echo 'Disabled; up to date'
     444              echo _('Disabled; up to date')
    452445            } 
    453446          } else { 
     
    456449        break; 
    457450        case MODULE_STATUS_NEEDUPGRADE: 
    458           echo '<span class="alert">Disabled; Pending upgrade to '.$modules[$name]['version'].'</span>'; 
     451          echo '<span class="alert">'.sprintf(_('Disabled; Pending upgrade to %s'),$modules[$name]['version']).'</span>'; 
    459452        break; 
    460453        case MODULE_STATUS_BROKEN: 
    461           echo '<span class="alert">Broken</span>'; 
     454          echo '<span class="alert">'._('Broken').'</span>'; 
    462455        break; 
    463456        default: 
     
    466459            $vercomp = version_compare($modules_local[$name]['version'], $modules_online[$name]['version']); 
    467460            if ($vercomp < 0) { 
    468               echo '<span class="alert">Online upgrade available ('.$modules_online[$name]['version'].')</span>'; 
     461              echo '<span class="alert">'.sprintf(_('Online upgrade available (%s)'), $modules_online[$name]['version']).'</span>'; 
    469462            } else if ($vercomp > 0) { 
    470               echo 'Newer than online version ('.$modules_online[$name]['version'].')'
     463              echo sprintf(_('Newer than online version (%s)'),$modules_online[$name]['version'])
    471464            } else { 
    472               echo 'Enabled and up to date'
     465              echo _('Enabled and up to date')
    473466            } 
    474467          } else if (isset($modules_online)) { 
    475468            // we're connected to online, but didn't find this module 
    476             echo 'Enabled; Not available online'
     469            echo _('Enabled; Not available online')
    477470          } else { 
    478             echo 'Enabled'
     471            echo _('Enabled')
    479472          } 
    480473        break; 
     
    495488       
    496489      if (isset($modules_online[$name]['attention']) && !empty($modules_online[$name]['attention'])) { 
    497         echo "\t\t\t\t<div class=\"tabbertab\" title=\"Attention\">\n"; 
     490        echo "\t\t\t\t<div class=\"tabbertab\" title=\""._("Attention")."\">\n"; 
    498491        echo nl2br($modules_online[$name]['attention']); 
    499492        echo "\t\t\t\t</div>\n"; 
    500493      } 
    501494       
    502       echo "\t\t\t\t<div class=\"tabbertab actiontab\" title=\"Action\">\n"; 
     495      echo "\t\t\t\t<div class=\"tabbertab actiontab\" title=\""._("Action")."\">\n"; 
    503496       
    504497      echo '<input type="radio" checked="CHECKED" id="noaction_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="0" /> '. 
    505          '<label for="noaction_'.prep_id($name).'">No Action</label> <br />';  
     498         '<label for="noaction_'.prep_id($name).'">'._('No Action').'</label> <br />';   
    506499      switch ($modules[$name]['status']) { 
    507500       
     
    510503            if (isset($modules_local[$name])) { 
    511504              echo '<input type="radio" id="install_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="install" /> '. 
    512                  '<label for="install_'.prep_id($name).'">Install</label> <br />'; 
     505                 '<label for="install_'.prep_id($name).'">'._('Install').'</label> <br />'; 
    513506            } else { 
    514507              echo '<input type="radio" id="upgrade_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="downloadinstall" /> '. 
    515                  '<label for="upgrade_'.prep_id($name).'">Download and Install</label> <br />'; 
     508                 '<label for="upgrade_'.prep_id($name).'">'._('Download and Install').'</label> <br />'; 
    516509            } 
    517510          } 
     
    519512        case MODULE_STATUS_DISABLED: 
    520513          echo '<input type="radio" id="enable_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="enable" /> '. 
    521              '<label for="enable_'.prep_id($name).'">Enable</label> <br />'; 
     514             '<label for="enable_'.prep_id($name).'">'._('Enable').'</label> <br />'; 
    522515          if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    523516            echo '<input type="radio" id="uninstall_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="uninstall" /> '. 
    524                '<label for="uninstall_'.prep_id($name).'">Uninstall</label> <br />'; 
     517               '<label for="uninstall_'.prep_id($name).'">'._('Uninstall').'</label> <br />'; 
    525518            if (isset($modules_online[$name]['version'])) { 
    526519              $vercomp = version_compare($modules_local[$name]['version'], $modules_online[$name]['version']); 
    527520              if ($vercomp < 0) { 
    528521                echo '<input type="radio" id="upgrade_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="upgrade" /> '. 
    529                    '<label for="upgrade_'.prep_id($name).'">Download and Upgrade to '.$modules_online[$name]['version'].', and Enable</label> <br />'; 
     522                   '<label for="upgrade_'.prep_id($name).'">'.sprintf(_('Download and Upgrade to %s, and Enable'),$modules_online[$name]['version']).'</label> <br />'; 
    530523              } 
    531524            } 
     
    535528          if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    536529            echo '<input type="radio" id="install_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="install" /> '. 
    537                '<label for="install_'.prep_id($name).'">Upgrade to '.$modules_local[$name]['version'].' and Enable</label> <br />'; 
     530               '<label for="install_'.prep_id($name).'">'.sprintf(_('Upgrade to %s and Enable'),$modules_local[$name]['version']).'</label> <br />'; 
    538531            echo '<input type="radio" id="uninstall_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="uninstall" /> '. 
    539                '<label for="uninstall_'.prep_id($name).'">Uninstall</label> <br />'; 
     532               '<label for="uninstall_'.prep_id($name).'">'._('Uninstall').'</label> <br />'; 
    540533          } 
    541534        break; 
     
    543536          if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    544537            echo '<input type="radio" id="install_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="install" /> '. 
    545                '<label for="install_'.prep_id($name).'">Install</label> <br />'; 
     538               '<label for="install_'.prep_id($name).'">'._('Install').'</label> <br />'; 
    546539            echo '<input type="radio" id="uninstall_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="uninstall" /> '. 
    547                '<label for="uninstall_'.prep_id($name).'">Uninstall</label> <br />'; 
     540               '<label for="uninstall_'.prep_id($name).'">'._('Uninstall').'</label> <br />'; 
    548541          } 
    549542        break; 
     
    555548              if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    556549                echo '<input type="radio" id="upgrade_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="upgrade" /> '. 
    557                    '<label for="upgrade_'.prep_id($name).'">Download and Upgrade to '.$modules_online[$name]['version'].'</label> <br />'; 
     550                   '<label for="upgrade_'.prep_id($name).'">'.sprintf(_('Download and Upgrade to %s'), $modules_online[$name]['version']).'</label> <br />'; 
    558551              } 
    559552            } 
    560553          } 
    561554          echo '<input type="radio" id="disable_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="disable" /> '. 
    562              '<label for="disable_'.prep_id($name).'">Disable</label> <br />'; 
     555             '<label for="disable_'.prep_id($name).'">'._('Disable').'</label> <br />'; 
    563556          if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    564557            echo '<input type="radio" id="uninstall_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="uninstall" /> '. 
    565                '<label for="uninstall_'.prep_id($name).'">Uninstall</label> <br />'; 
     558               '<label for="uninstall_'.prep_id($name).'">'._('Uninstall').'</label> <br />'; 
    566559          } 
    567560        break; 
     
    569562      echo "\t\t\t\t</div>\n"; 
    570563       
    571       echo "\t\t\t\t<div class=\"tabbertab\" title=\"Description\">\n"; 
     564      echo "\t\t\t\t<div class=\"tabbertab\" title=\""._("Description")."\">\n"; 
    572565      if (isset($modules[$name]['description']) && !empty($modules[$name]['description'])) { 
    573         echo "<h5>Description for version ".$modules[$name]['version']."</h5>"; 
     566        echo "<h5>".sprintf(_("Description for version %s"),$modules[$name]['version'])."</h5>"; 
    574567        echo nl2br($modules[$name]['description']); 
    575568      } else { 
    576         echo "No description is available."
     569        echo _("No description is available.")
    577570      } 
    578571      if (isset($modules[$name]['info']) && !empty($modules[$name]['info'])) { 
    579         echo '<p>More info: <a href="'.$modules[$name]['info'].'" target="_new">'.$modules[$name]['info'].'</a></p>'; 
     572        echo '<p>'._('More info').': <a href="'.$modules[$name]['info'].'" target="_new">'.$modules[$name]['info'].'</a></p>'; 
    580573      } 
    581574      echo "\t\t\t\t</div>\n"; 
    582575       
    583576      if (isset($modules[$name]['changelog']) && !empty($modules[$name]['changelog'])) { 
    584         echo "\t\t\t\t<div class=\"tabbertab\" title=\"Changelog\">\n"; 
    585         echo "<h5>Change Log for version ".$modules[$name]['version']."</h5>"; 
     577        echo "\t\t\t\t<div class=\"tabbertab\" title=\""._("Changelog")."\">\n"; 
     578        echo "<h5>".sprintf(_("Change Log for version %s"), $modules[$name]['version'])."</h5>"; 
    586579        // convert "1.x.x:" and "*1.x.x*" into bold, and do nl2br 
    587580        $changelog = nl2br($modules[$name]['changelog']); 
     
    593586       
    594587      if (isset($amp_conf['AMPDEVEL']) && $amp_conf['AMPDEVEL'] == 'true') { 
    595         echo "\t\t\t\t<div class=\"tabbertab\" title=\"Debug\">\n"; 
     588        echo "\t\t\t\t<div class=\"tabbertab\" title=\""._("Debug")."\">\n"; 
    596589        echo "\t\t\t\t<h5>".$name."</h5><pre>\n"; 
    597590        print_r($modules_local[$name]); 
     
    618611    if ($numdisplayed == 0) { 
    619612      if (isset($modules_online) && count($modules_online) > 0) { 
    620         echo "All available modules are up-to-date and installed."
     613        echo _("All available modules are up-to-date and installed.")
    621614      } else { 
    622         echo "No modules to display."
     615        echo _("No modules to display.")
    623616      } 
    624617    } 
     
    630623    if ($online) { 
    631624      //echo "\t<input type=\"button\" value=\"Upgrade all\" onClick=\"check_upgrade_all();\" />"; 
    632       echo "\t<a href=\"javascript:void(null);\" onclick=\"check_upgrade_all();\">Upgrade all</a>"; 
    633     } 
    634     echo "\t<input type=\"reset\" value=\"Reset\" />"; 
    635     echo "\t<input type=\"submit\" value=\"Process\" name=\"process\" />"; 
     625      echo "\t<a href=\"javascript:void(null);\" onclick=\"check_upgrade_all();\">"._("Upgrade all")."</a>"; 
     626    } 
     627    echo "\t<input type=\"reset\" value=\""._("Reset")."\" />"; 
     628    echo "\t<input type=\"submit\" value=\""._("Process")."\" name=\"process\" />"; 
    636629    echo "</div>"; 
    637630