Merge pull request #702 from bergware/mutli-language

Multi-language support
This commit is contained in:
tom mortensen
2020-06-08 11:34:46 -07:00
committed by GitHub
3 changed files with 9 additions and 5 deletions
@@ -13,6 +13,10 @@
<?
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
if (!function_exists('_')) {
function _($text) {return $text;}
}
// Invoke the plugin command with indicated method
function plugin($method, $arg = '') {
global $docroot;
@@ -45,7 +49,7 @@ function make_link($method, $arg, $extra='') {
$cmd = "/plugins/dynamix.plugin.manager/scripts/plugin&arg1=$method&arg2=$arg".($extra?"&arg3=$extra":"");
$exec = "loadlist";
}
return "$check<input type='button' id='$id' value='".ucfirst($method)."' onclick='openBox(\"$cmd\",\"".ucwords($method)." Plugin\",600,900,true,\"$exec\",\"$plg\");'$disabled>";
return "$check<input type='button' id='$id' value='"._(ucfirst($method))."' onclick='openBox(\"$cmd\",\"".ucwords($method)." Plugin\",600,900,true,\"$exec\",\"$plg\");'$disabled>";
}
// trying our best to find an icon
@@ -107,7 +107,7 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
//category
$category = plugin('category',$plugin_file) ?: (strpos($version,'-')!==false ? 'next' : 'stable');
//status
$status = 'unknown';
$status = _('unknown');
$changes_file = $plugin_file;
$url = plugin('pluginURL',$plugin_file);
if ($url !== false) {
@@ -124,7 +124,7 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
if (!$os) $updates++;
} else {
//status is considered outdated when older than 1 day
$status = filectime($filename) > (time()-86400) ? 'up-to-date' : 'need check';
$status = filectime($filename) > (time()-86400) ? _('up-to-date') : _('need check');
}
}
}
@@ -147,7 +147,7 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
echo "<td><span class='desc_readmore' style='display:block'>$desc</span> $support</td>";
echo "<td>$author</td>";
echo "<td data='$date'>$version</td>";
echo "<td data='$rank'>"._($status)."</td>";
echo "<td data='$rank'>$status</td>";
echo "<td>";
if ($system) {
if ($os) {
+1 -1
View File
@@ -165,7 +165,7 @@ div.right{float:right;margin:-12px 20px 0 0;text-align:center}
span.ctrl{float:right;margin-right:10px}
span.outer{float:left}
span.inner{width:<?=$theme1?153:140?>px}
span.ups{width:124px;display:inline-block}
span.ups{width:200px;display:inline-block}
span.busy,i.inactive{opacity:0.5}
span#inbound{width:75px;display:inline-block}
span#load{width:90px;display:inline-block}