diff options
22 files changed, 114 insertions, 106 deletions
diff --git a/src/usr/local/www/diag_backup.php b/src/usr/local/www/diag_backup.php index cc48bc7..30da41b 100644 --- a/src/usr/local/www/diag_backup.php +++ b/src/usr/local/www/diag_backup.php @@ -108,7 +108,7 @@ function restore_rrddata() { $rrd_file = "{$g['vardb_path']}/rrd/{$rrd['filename']}"; $xml_file = preg_replace('/\.rrd$/', ".xml", $rrd_file); if (file_put_contents($xml_file, gzinflate(base64_decode($rrd['xmldata']))) === false) { - log_error("Cannot write $xml_file"); + log_error(sprintf(gettext("Cannot write %s"), $xml_file)); continue; } $output = array(); @@ -123,7 +123,7 @@ function restore_rrddata() { $rrd_file = "{$g['vardb_path']}/rrd/{$rrd['filename']}"; $rrd_fd = fopen($rrd_file, "w"); if (!$rrd_fd) { - log_error("Cannot write $rrd_file"); + log_error(sprintf(gettext("Cannot write %s"), $rrd_file)); continue; } $data = base64_decode($rrd['data']); @@ -132,18 +132,18 @@ function restore_rrddata() { if ($dcomp) { /* If the decompression worked, write the decompressed data */ if (fwrite($rrd_fd, $dcomp) === false) { - log_error("fwrite $rrd_file failed"); + log_error(sprintf(gettext("fwrite %s failed"), $rrd_file)); continue; } } else { /* If the decompression failed, it wasn't compressed, so write raw data */ if (fwrite($rrd_fd, $data) === false) { - log_error("fwrite $rrd_file failed"); + log_error(sprintf(gettext("fwrite %s failed"), $rrd_file)); continue; } } if (fclose($rrd_fd) === false) { - log_error("fclose $rrd_file failed"); + log_error(sprintf(gettext("fclose %s failed"), $rrd_file)); continue; } } @@ -370,7 +370,7 @@ if ($_POST) { $loaderconf = file_get_contents("/boot/loader.conf"); if (strpos($loaderconf, "console=\"comconsole")) { $config['system']['enableserial'] = true; - write_config("Restore serial console enabling in configuration."); + write_config(gettext("Restore serial console enabling in configuration.")); } unset($loaderconf); } diff --git a/src/usr/local/www/diag_confbak.php b/src/usr/local/www/diag_confbak.php index 2ada62c..554c6ca 100644 --- a/src/usr/local/www/diag_confbak.php +++ b/src/usr/local/www/diag_confbak.php @@ -69,9 +69,9 @@ if (isset($_POST['backupcount'])) { $changedescr = $config['system']['backupcount']; } else { unset($config['system']['backupcount']); - $changedescr = "(platform default)"; + $changedescr = gettext("(platform default)"); } - write_config("Changed backup revision count to {$changedescr}"); + write_config(sprintf(gettext("Changed backup revision count to %s"), $changedescr)); } elseif ($_GET) { if (!isset($_GET['newver']) && !isset($_GET['rmver']) && !isset($_GET['getcfg']) && !isset($_GET['diff'])) { header("Location: diag_confbak.php"); diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php index 0acf06f..c9d5ba6 100755 --- a/src/usr/local/www/diag_dns.php +++ b/src/usr/local/www/diag_dns.php @@ -111,7 +111,7 @@ if (isset($_POST['create_alias']) && (is_hostname($host) || is_ipaddr($host))) { $newalias['name'] = $aliasname; $newalias['type'] = "network"; $newalias['address'] = $addresses; - $newalias['descr'] = "Created from Diagnostics-> DNS Lookup"; + $newalias['descr'] = gettext("Created from Diagnostics-> DNS Lookup"); if ($override) { $a_aliases[$id] = $newalias; } else { diff --git a/src/usr/local/www/diag_halt.php b/src/usr/local/www/diag_halt.php index 5d7fc5d..7e45554 100755 --- a/src/usr/local/www/diag_halt.php +++ b/src/usr/local/www/diag_halt.php @@ -87,7 +87,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { <?php if (DEBUG) { - print("Not actually halting (DEBUG is set true)<br>"); + print(sprintf(gettext("Not actually halting (DEBUG is set true)%s"), "<br />")); } else { print('<pre>'); system_halt(); diff --git a/src/usr/local/www/diag_nanobsd.php b/src/usr/local/www/diag_nanobsd.php index 2ecc2a1..26ab828 100644 --- a/src/usr/local/www/diag_nanobsd.php +++ b/src/usr/local/www/diag_nanobsd.php @@ -131,10 +131,10 @@ if ($_POST['setrw']) { unset($config['system']['nanobsd_force_rw']); } - write_config("Changed Permanent Read/Write Setting"); + write_config(gettext("Changed Permanent Read/Write Setting")); conf_mount_ro(); } else { - $savemsg = 'Saved r/w permanently'; + $savemsg = gettext('Saved r/w permanently'); $class = 'alert-success'; } } diff --git a/src/usr/local/www/diag_packet_capture.php b/src/usr/local/www/diag_packet_capture.php index 5258f9b..be6f5d5 100644 --- a/src/usr/local/www/diag_packet_capture.php +++ b/src/usr/local/www/diag_packet_capture.php @@ -263,20 +263,22 @@ if ($_POST) { $do_tcpdump = false; } +$excl = gettext("Exclude"); + $protocollist = array( '' => 'Any', 'icmp' => 'ICMP', - '!icmp' => 'Exclude ICMP', + '!icmp' => $excl . ' ICMP', 'icmp6' => 'ICMPv6', - '!icmp6' => 'Exclude ICMPv6', + '!icmp6' => $excl . ' ICMPv6', 'tcp' => 'TCP', - '!tcp' => 'Exclude TCP', + '!tcp' => $excl . ' TCP', 'udp' => 'UDP', - '!udp' => 'Exclude UDP', + '!udp' => $excl . ' UDP', 'arp' => 'ARP', - '!arp' => 'Exclude ARP', + '!arp' => $excl . ' ARP', 'carp' => 'CARP (VRRP)', - '!carp' => 'Exclude CARP (VRRP)', + '!carp' => $excl . ' CARP (VRRP)', 'esp' => 'ESP' ); @@ -311,8 +313,8 @@ $section->addInput(new Form_Select( 'Address Family', $fam, array('' => 'Any', - 'ip' => 'IPv4 Only', - 'ip6' => 'IPv6 Only' + 'ip' => gettext('IPv4 Only'), + 'ip6' => gettext('IPv6 Only') ) ))->setHelp('Select the type of traffic to be captured'); @@ -361,10 +363,10 @@ $section->addInput(new Form_Select( 'detail', 'Level of detail', $detail, - array('normal' => 'Normal', - 'medium' => 'Medium', - 'high' => 'High', - 'full' => 'Full', + array('normal' => gettext('Normal'), + 'medium' => gettext('Medium'), + 'high' => gettext('High'), + 'full' => gettext('Full'), ) ))->setHelp('This is the level of detail that will be displayed after hitting "Stop" when the packets have been captured.' . '<br />' . 'This option does not affect the level of detail when downloading the packet capture. '); diff --git a/src/usr/local/www/diag_pftop.php b/src/usr/local/www/diag_pftop.php index cece7aa..b7604d6 100644 --- a/src/usr/local/www/diag_pftop.php +++ b/src/usr/local/www/diag_pftop.php @@ -125,15 +125,21 @@ $form->addGlobal(new Form_Input( $section = new Form_Section('pfTop Configuration'); $validViews = array( - 'default', 'label', 'long', - 'queue', 'rules', 'size', - 'speed', 'state', 'time', + 'default' => gettext('default'), + 'label' => gettext('label'), + 'long' => gettext('long'), + 'queue' => gettext('queue'), + 'rules' => gettext('rules'), + 'size' => gettext('size'), + 'speed' => gettext('speed'), + 'state' => gettext('state'), + 'time' => gettext('time'), ); $section->addInput(new Form_Select( 'viewtype', 'View', $viewtype, - array_combine($validViews, $validViews) + $validViews )); $section->addInput(new Form_Select( @@ -141,18 +147,18 @@ $section->addInput(new Form_Select( 'Sort by', $sorttype, array( - 'none' => 'None', - 'age' => 'Age', - 'bytes' => 'Bytes', - 'dest' => 'Destination Address', - 'dport' => 'Destination Port', - 'exp' => 'Expiry', - 'peak' => 'Peak', - 'pkt' => 'Packet', - 'rate' => 'Rate', - 'size' => 'Size', - 'sport' => 'Source Port', - 'src' => 'Source Address', + 'none' => gettext('None'), + 'age' => gettext('Age'), + 'bytes' => gettext('Bytes'), + 'dest' => gettext('Destination Address'), + 'dport' => gettext('Destination Port'), + 'exp' => gettext('Expiry'), + 'peak' => gettext('Peak'), + 'pkt' => gettext('Packet'), + 'rate' => gettext('Rate'), + 'size' => gettext('Size'), + 'sport' => gettext('Source Port'), + 'src' => gettext('Source Address'), ) )); diff --git a/src/usr/local/www/diag_ping.php b/src/usr/local/www/diag_ping.php index b99f595..c35ee7e 100644 --- a/src/usr/local/www/diag_ping.php +++ b/src/usr/local/www/diag_ping.php @@ -77,7 +77,7 @@ $count = DEFAULT_COUNT; function create_sourceaddresslist() { $sourceips = get_possible_traffic_source_addresses(true); - $list = array("" => 'Default'); + $list = array("" => gettext('Default')); foreach ($sourceips as $sipvalue => $sipname) { $list[$sipvalue] = $sipname; diff --git a/src/usr/local/www/diag_reboot.php b/src/usr/local/www/diag_reboot.php index d1f3393..b347d30 100755 --- a/src/usr/local/www/diag_reboot.php +++ b/src/usr/local/www/diag_reboot.php @@ -79,7 +79,7 @@ include("head.inc"); if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (DEBUG) { - print_info_box("Not actually rebooting (DEBUG is set true)", 'success'); + print_info_box(gettext("Not actually rebooting (DEBUG is set true)"), 'success'); } else { print('<div><pre>'); system_reboot(); @@ -94,7 +94,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { //<![CDATA[ events.push(function() { - var timeoutmsg = '<h4>Rebooting<br />Page will automatically reload in '; + var timeoutmsg = '<h4><?=gettext("Rebooting");?><br /><?=gettext("Page will automatically reload in ");?>'; var time = 0; function checkonline() { @@ -110,11 +110,11 @@ events.push(function() { function startCountdown() { setInterval(function() { if (time > 0) { - $('#countdown').html(timeoutmsg + time + ' seconds.</h4>'); + $('#countdown').html(timeoutmsg + time + ' <?=gettext("seconds");?>.</h4>'); time--; } else { time = "<?=$guiretry?>"; - timeoutmsg = '<h4>Not yet ready<br />Retrying in another '; + timeoutmsg = '<h4><?=gettext("Not yet ready");?><br /><?=gettext("Retrying in another ");?>'; checkonline(); } }, 1000); diff --git a/src/usr/local/www/diag_resetstate.php b/src/usr/local/www/diag_resetstate.php index e492550..45589eb 100644 --- a/src/usr/local/www/diag_resetstate.php +++ b/src/usr/local/www/diag_resetstate.php @@ -97,20 +97,17 @@ if ($savemsg) { print_info_box($savemsg, 'alert-success'); } -$statetablehelp = 'Resetting the state tables will remove all entries from the corresponding tables. This means that all open connections ' . +$statetablehelp = sprintf(gettext('Resetting the state tables will remove all entries from the corresponding tables. This means that all open connections ' . 'will be broken and will have to be re-established. This may be necessary after making substantial changes to the ' . - 'firewall and/or NAT rules, especially if there are IP protocol mappings (e.g. for PPTP or IPv6) with open connections.' . - '<br /><br />' . - 'The firewall will normally leave the state tables intact when changing rules.' . - '<br /><br />' . - '<strong>NOTE:</strong> If you reset the firewall state table, the browser session may appear to be hung after clicking "Reset". ' . - 'Simply refresh the page to continue.'; - -$sourcetablehelp = 'Resetting the source tracking table will remove all source/destination associations. ' . + 'firewall and/or NAT rules, especially if there are IP protocol mappings (e.g. for PPTP or IPv6) with open connections.%s' . + 'The firewall will normally leave the state tables intact when changing rules.%s' . + '%sNOTE:%s If you reset the firewall state table, the browser session may appear to be hung after clicking "Reset". ' . + 'Simply refresh the page to continue.'), "<br /><br />", "<br /><br />", "<strong>", "</strong>"); + +$sourcetablehelp = sprintf(gettext('Resetting the source tracking table will remove all source/destination associations. ' . 'This means that the \"sticky\" source/destination association ' . - 'will be cleared for all clients.' . - ' <br /><br />' . - 'This does not clear active connection states, only source tracking.'; + 'will be cleared for all clients.%s' . + 'This does not clear active connection states, only source tracking.'), "<br /><br />"); $tab_array = array(); $tab_array[] = array(gettext("States"), false, "diag_dump_states.php"); diff --git a/src/usr/local/www/diag_smart.php b/src/usr/local/www/diag_smart.php index ad878dc..7ea6efa 100644 --- a/src/usr/local/www/diag_smart.php +++ b/src/usr/local/www/diag_smart.php @@ -111,7 +111,7 @@ $action = (isset($_POST['action']) ? $_POST['action'] : $_GET['action']); $targetdev = basename($_POST['device']); if (!file_exists('/dev/' . $targetdev)) { - echo "Device does not exist, bailing."; + echo gettext("Device does not exist, bailing."); return; } @@ -126,7 +126,7 @@ switch ($action) { { $test = $_POST['testType']; if (!in_array($test, $valid_test_types)) { - echo "Invalid test type, bailing."; + echo gettext("Invalid test type, bailing."); return; } diff --git a/src/usr/local/www/diag_traceroute.php b/src/usr/local/www/diag_traceroute.php index 2ccd98e..f0b22b0 100644 --- a/src/usr/local/www/diag_traceroute.php +++ b/src/usr/local/www/diag_traceroute.php @@ -81,7 +81,7 @@ $ipproto = 'ipv4'; $sourceip = 'any'; function create_sourceaddresslist() { - $list = array('any' => 'Any'); + $list = array('any' => gettext('Any')); $sourceips = get_possible_traffic_source_addresses(true); diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php index e4aebde..926c579 100644 --- a/src/usr/local/www/firewall_nat_out_edit.php +++ b/src/usr/local/www/firewall_nat_out_edit.php @@ -397,7 +397,7 @@ function build_target_list() { global $config, $sn, $a_aliases; $list = array(); - $list[""] = 'Interface Address'; + $list[""] = gettext('Interface Address'); if (is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $sn) { @@ -427,10 +427,10 @@ function build_target_list() { continue; } - $list[$alias['name']] = 'Host Alias: ' . $alias['name'] . ' (' . $alias['descr'] . ')'; + $list[$alias['name']] = gettext('Host Alias: ') . $alias['name'] . ' (' . $alias['descr'] . ')'; } - $list['other-subnet'] = 'Other Subnet (Enter Below)'; + $list['other-subnet'] = gettext('Other Subnet (Enter Below)'); return($list); } @@ -510,7 +510,7 @@ $group->add(new Form_Select( 'source_type', null, (($pconfig['source'] == "any") || ($pconfig['source'] == "(self)")) ? $pconfig['source'] : "network", - array('any' => 'Any', '(self)' => 'This Firewall (self)', 'network' => 'Network') + array('any' => gettext('Any'), '(self)' => gettext('This Firewall (self))', 'network' => gettext('Network')) ))->setHelp('Type')->setWidth('3'); $group->add(new Form_IpAddress( @@ -534,7 +534,7 @@ $group->add(new Form_Select( 'destination_type', null, $pconfig['destination'] == "any" ? "any":"network", - array('any' => 'Any', 'network' => 'Network') + array('any' => gettext('Any'), 'network' => gettext('Network')) ))->setHelp('Type')->setWidth('3'); $group->add(new Form_IpAddress( @@ -587,13 +587,13 @@ $section->addInput(new Form_Select( 'Pool options', $pconfig['poolopts'], array( - '' => 'Default', - 'round-robin' => 'Round Robin', - 'round-robin sticky-address' => 'Round Robin with Sticky Address', - 'random' => 'Random', - 'random sticky-address' => 'Random with Sticky Address', - 'source-hash' => 'Source hash', - 'bitmask' => 'Bit mask' + '' => gettext('Default'), + 'round-robin' => gettext('Round Robin'), + 'round-robin sticky-address' => gettext('Round Robin with Sticky Address'), + 'random' => gettext('Random'), + 'random sticky-address' => gettext('Random with Sticky Address'), + 'source-hash' => gettext('Source hash'), + 'bitmask' => gettext('Bit mask') ) ))->setHelp('Only Round Robin types work with Host Aliases. Any type can be used with a Subnet.' . '<br />' . '</span><ul class="help-block">' . diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index c0d2042..46f4856 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1399,7 +1399,7 @@ $section->addInput(new Form_Select( 'os', 'Source OS', (empty($pconfig['os']) ? '':$pconfig['os']), - ['' => 'Any'] + array_combine($ostypes, $ostypes) + ['' => gettext('Any')] + array_combine($ostypes, $ostypes) ))->setHelp('Note: this only works for TCP rules. General OS choice matches all subtypes.'); $section->addInput(new Form_Select( 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('<?xml version="1.0" encoding="UTF-8"?>' . "\n");?> <text id="switch_scale" x="<?=$width*0.55?>" y="11" <?=$attribs['switch_scale']?>><?=gettext("AutoScale"); ?> (<?=$scale_type?>)</text> <text id="date" x="<?=$width*0.33?>" y="5" <?=$attribs['legend']?>> </text> <text id="time" x="<?=$width*0.33?>" y="11" <?=$attribs['legend']?>> </text> - <text id="graphlast" x="<?=$width*0.55?>" y="17" <?=$attribs['legend']?>><?=gettext("Graph shows last"); ?> <?=$time_interval*$nb_plot?> <?=gettext("seconds"); ?></text> + <text id="graphlast" x="<?=$width*0.55?>" y="17" <?=$attribs['legend']?>><?=sprintf(gettext("Graph shows last %s seconds"), $time_interval*$nb_plot)?></text> <polygon id="axis_arrow_x" <?=$attribs['axis']?> points="<?=($width) . "," . ($height)?> <?=($width-2) . "," . ($height-2)?> <?=($width-2) . "," . $height?>"/> <text id="error" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['error']?> text-anchor="middle"><?=$error_text?></text> <text id="collect_initial" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['collect_initial']?> text-anchor="middle"><?=gettext("Collecting initial data, please wait"); ?>...</text> 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 = '<div class="pull-left">' . $msg . '</div>'; if (stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) { - $msg .= '<form method="post" class="pull-right"><button type="submit" class="btn btn-default" name="'. $name .'" value="'.$value.'">'.$name.'</button>'; + $msg .= '<form method="post" class="pull-right"><button type="submit" class="btn btn-default" name="'. $name .'" value="' . $value . '">' . $name . '</button>'; if ($_POST['if']) { $msg .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />"; @@ -320,10 +323,10 @@ function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $cl $msg .= '</form>'; } else if ($showbtn) { - $msg = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'. $msg; + $msg = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' . $msg; } - echo '<div class="alert ' . $class . ' clearfix" role="alert">'.$msg.'</div>'; + echo '<div class="alert ' . $class . ' clearfix" role="alert">' . $msg . '</div>'; } 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()):?> <span aria-hidden="true">×</span> </button> - <h3 class="modal-title" id="myModalLabel">Notices</h3> + <h3 class="modal-title" id="myModalLabel"><?=gettext("Notices")?></h3> </div> <div class="modal-body"> @@ -597,7 +597,7 @@ if (are_notices_pending()):?> </div> <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> + <button type="button" class="btn btn-default" data-dismiss="modal"><?=gettext("Close")?></button> <button type="button" id="clearallnotices" class="btn btn-primary"><?=gettext("Mark all as read")?></button> </div> </div> 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 <a href='crash_reporter.php'>here</a> for more information."; + $savemsg = sprintf(gettext("%s has detected a crash report or programming bug. Click <a href='crash_reporter.php'>here</a> for more information."), $g['product_name']); $class = "warning"; } } @@ -357,7 +357,7 @@ foreach ($available as $widgetname => $widgetconfig): <form action="/" method="post" id="widgetSequence_form" name="widgetForm"> <input type="hidden" name="sequence" value="" /> - <button type="submit" id="btnstore" class="btn btn-primary">Store widget configuration</button> + <button type="submit" id="btnstore" class="btn btn-primary"><?=gettext("Store widget configuration")?></button> </form> </div> diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 84824be..7fed324 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -2587,7 +2587,7 @@ $section->addInput(new Form_Select( 'pppoe-reset-type', 'Periodic reset', $pconfig['pppoe-reset-type'], - ['' => 'Disabled', 'custom' => 'Custom', 'preset' => 'Pre-set'] + ['' => gettext('Disabled'), 'custom' => gettext('Custom'), 'preset' => gettext('Pre-set')] ))->setHelp('Select a reset timing type'); $group = new Form_Group('Custom reset'); diff --git a/src/usr/local/www/interfaces_bridge_edit.php b/src/usr/local/www/interfaces_bridge_edit.php index 5397625..fd889ab 100644 --- a/src/usr/local/www/interfaces_bridge_edit.php +++ b/src/usr/local/www/interfaces_bridge_edit.php @@ -315,7 +315,7 @@ if ($_POST) { function build_spanport_list() { global $ifacelist; - $splist = array('none' => 'None'); + $splist = array('none' => gettext('None')); foreach ($ifacelist as $ifn => $ifdescr) { $splist[$ifn] = $ifdescr; diff --git a/src/usr/local/www/interfaces_wireless_edit.php b/src/usr/local/www/interfaces_wireless_edit.php index d920cd7..10a43ef 100644 --- a/src/usr/local/www/interfaces_wireless_edit.php +++ b/src/usr/local/www/interfaces_wireless_edit.php @@ -223,7 +223,7 @@ $section->addInput(new Form_Select( array( 'bss' => 'Infrastructure (BSS)', 'adhoc' => 'Ad-hoc (IBSS)', - 'hostap' => 'Access Point' + 'hostap' => gettext('Access Point)' ) )); diff --git a/src/usr/local/www/load_balancer_pool_edit.php b/src/usr/local/www/load_balancer_pool_edit.php index b2ae2f4..b19cbe3 100644 --- a/src/usr/local/www/load_balancer_pool_edit.php +++ b/src/usr/local/www/load_balancer_pool_edit.php @@ -354,8 +354,8 @@ $section->addInput(new Form_Select( 'Mode', $pconfig['mode'], array( - 'loadbalance' => 'Load Balance', - 'failover' => 'Manual Failover' + 'loadbalance' => gettext('Load Balance'), + 'failover' => gettext('Manual Failover') ) )); |