From f49cd72565cf246c3ce357ad6fc091f198bb811a Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 21 Jan 2016 23:53:25 +0545 Subject: Internationalization graph guiconfig head index --- src/usr/local/www/graph.php | 4 ++-- src/usr/local/www/guiconfig.inc | 45 ++++++++++++++++++++++------------------- src/usr/local/www/head.inc | 6 +++--- src/usr/local/www/index.php | 4 ++-- 4 files changed, 31 insertions(+), 28 deletions(-) (limited to 'src/usr/local') diff --git a/src/usr/local/www/graph.php b/src/usr/local/www/graph.php index 0f3f421..4853114 100755 --- a/src/usr/local/www/graph.php +++ b/src/usr/local/www/graph.php @@ -115,7 +115,7 @@ $attribs['error']='fill="blue" font-family="Arial" font-size="4"'; $attribs['collect_initial']='fill="gray" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="4"'; //Error text if we cannot fetch data : depends on which method is used -$error_text = "Cannot get data about interface " . htmlspecialchars($ifnum); +$error_text = sprintf(gettext("Cannot get data about interface %s"), htmlspecialchars($ifnum)); $height=100; //SVG internal height : do not modify $width=200; //SVG internal width : do not modify @@ -144,7 +144,7 @@ print('' . "\n");?> > () > > - > + > points=" "/> text-anchor="middle"> text-anchor="middle">... diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index b97ae0f..b94018b 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -151,8 +151,8 @@ $ldap_urltypes = array( 'SSL - Encrypted' => 636); $ldap_scopes = array( - 'one' => "One Level", - 'subtree' => "Entire Subtree"); + 'one' => gettext("One Level"), + 'subtree' => gettext("Entire Subtree")); $ldap_protvers = array( 2, @@ -179,9 +179,9 @@ $ldap_templates = array( 'attr_member' => "uniqueMember")); $radius_srvcs = array( - 'both' => "Authentication and Accounting", - 'auth' => "Authentication", - 'acct' => "Accounting"); + 'both' => gettext("Authentication and Accounting"), + 'auth' => gettext("Authentication"), + 'acct' => gettext("Accounting")); $netbios_nodetypes = array( '0' => "none", @@ -240,7 +240,10 @@ $wkports = array( /* TCP flags */ $tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg", "ece", "cwr"); -$specialnets = array("(self)" => "This Firewall", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients"); +$specialnets = array( + "(self)" => gettext("This Firewall"), + "pppoe" => gettext("PPPoE clients"), + "l2tp" => gettext("L2TP clients")); $spiflist = get_configured_interface_with_descr(false, true); foreach ($spiflist as $ifgui => $ifdesc) { @@ -249,16 +252,16 @@ foreach ($spiflist as $ifgui => $ifdesc) { } $medias = array( - "auto" => "autoselect", - "100full" => "100BASE-TX full-duplex", - "100half" => "100BASE-TX half-duplex", - "10full" => "10BASE-T full-duplex", - "10half" => "10BASE-T half-duplex"); + "auto" => gettext("autoselect"), + "100full" => gettext("100BASE-TX full-duplex"), + "100half" => gettext("100BASE-TX half-duplex"), + "10full" => gettext("10BASE-T full-duplex"), + "10half" => gettext("10BASE-T half-duplex")); $wlan_modes = array( - "bss" => "Infrastructure (BSS)", - "adhoc" => "Ad-hoc (IBSS)", - "hostap" => "Access Point"); + "bss" => gettext("Infrastructure (BSS)"), + "adhoc" => gettext("Ad-hoc (IBSS)"), + "hostap" => gettext("Access Point")); function do_input_validation($postdata, $reqdfields, $reqdfieldsn, &$input_errors) { @@ -312,7 +315,7 @@ function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $cl $msg = '
' . $msg . '
'; if (stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) { - $msg .= '
'; + $msg .= ''; if ($_POST['if']) { $msg .= ""; @@ -320,10 +323,10 @@ function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $cl $msg .= '
'; } else if ($showbtn) { - $msg = ''. $msg; + $msg = '' . $msg; } - echo ''; + echo ''; } function print_info_box_np_undo($msg, $name = "apply", $value = "Apply changes", $undo) { @@ -574,9 +577,9 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g $grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert)); } if (is_dir($logfile)) { - $logarr = array("File {$logfile} is a directory."); + $logarr = array(sprintf(gettext("File %s is a directory."), $logfile)); } elseif (file_exists($logfile) && filesize($logfile) == 0) { - $logarr = array("Log file started."); + $logarr = array(gettext("Log file started.")); } else { if ($config['system']['disablesyslogclog']) { exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr); @@ -625,9 +628,9 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert $grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert)); } if (is_dir($logfile)) { - $logarr = array("File {$logfile} is a directory."); + $logarr = array(sprintf(gettext("File %s is a directory."), $logfile)); } elseif (file_exists($logfile) && filesize($logfile) == 0) { - $logarr = array("Log file started."); + $logarr = array(gettext("Log file started.")); } else { if ($config['system']['disablesyslogclog']) { exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr); diff --git a/src/usr/local/www/head.inc b/src/usr/local/www/head.inc index cd9e453..c18461f 100755 --- a/src/usr/local/www/head.inc +++ b/src/usr/local/www/head.inc @@ -539,7 +539,7 @@ $pgtitle_output = true; if ($config['remote_managed_pages']['item']) { foreach ($config['remote_managed_pages']['item'] as $rmp) { if ($rmp == $_SERVER['SCRIPT_NAME']) { - print_info_box_np("This page is currently being managed by a remote machine."); + print_info_box_np(gettext("This page is currently being managed by a remote machine.")); include("foot.inc"); exit; } @@ -558,7 +558,7 @@ if (are_notices_pending()):?> - + diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php index e2e792b..b7a0185 100644 --- a/src/usr/local/www/index.php +++ b/src/usr/local/www/index.php @@ -107,7 +107,7 @@ if ($g['disablecrashreporter'] != true) { } if ($x > 0) { - $savemsg = "{$g['product_name']} has detected a crash report or programming bug. Click here for more information."; + $savemsg = sprintf(gettext("%s has detected a crash report or programming bug. Click here for more information."), $g['product_name']); $class = "warning"; } } @@ -357,7 +357,7 @@ foreach ($available as $widgetname => $widgetconfig):
- +
-- cgit v1.1