summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-01-25 10:21:04 +0545
committerPhil Davis <phil.davis@inf.org>2016-01-25 10:21:04 +0545
commit0fc3de67462f6e735484933e5abf2bbb9be4bd30 (patch)
tree88ed04a3efc64d27c8b833cc2b819ac737741eee
parenta2c5280d92c2707c27cbef318b1ced7122c32b0e (diff)
downloadpfsense-0fc3de67462f6e735484933e5abf2bbb9be4bd30.zip
pfsense-0fc3de67462f6e735484933e5abf2bbb9be4bd30.tar.gz
Internationalize interfaces UI code
-rw-r--r--src/usr/local/www/interfaces.php32
-rw-r--r--src/usr/local/www/interfaces_assign.php4
-rw-r--r--src/usr/local/www/interfaces_bridge_edit.php6
-rw-r--r--src/usr/local/www/interfaces_lagg_edit.php62
-rw-r--r--src/usr/local/www/interfaces_ppps_edit.php2
-rw-r--r--src/usr/local/www/interfaces_wireless_edit.php4
6 files changed, 55 insertions, 55 deletions
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php
index 73755ca..8702bb5 100644
--- a/src/usr/local/www/interfaces.php
+++ b/src/usr/local/www/interfaces.php
@@ -484,7 +484,7 @@ if ($_POST['apply']) {
if (isset($wancfg['wireless'])) {
interface_sync_wireless_clones($wancfg, false);
}
- write_config("Interface {$_POST['descr']}({$if}) is now disabled.");
+ write_config(sprintf(gettext('Interface %1$s (%2$s) is now disabled.'), $_POST['descr'], $if));
mark_subsystem_dirty('interfaces');
if (file_exists("{$g['tmp_path']}/.interfaces.apply")) {
$toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.interfaces.apply"));
@@ -1655,8 +1655,8 @@ $mymac = str_replace("\n", "", $mymac);
function build_mediaopts_list() {
global $mediaopts_list;
- $list = ["" => "Default (no preference, typically autoselect)",
- " " => "------- Media Supported by this interface -------"
+ $list = ["" => gettext("Default (no preference, typically autoselect)"),
+ " " => gettext("------- Media Supported by this interface -------")
];
foreach ($mediaopts_list as $mediaopt) {
@@ -1669,7 +1669,7 @@ function build_mediaopts_list() {
function build_gateway_list() {
global $a_gateways, $if;
- $list = array("none" => "None");
+ $list = array("none" => gettext("None"));
foreach ($a_gateways as $gateway) {
if (($gateway['interface'] == $if) && (is_ipaddrv4($gateway['gateway']))) {
$list[$gateway['name']] = $gateway['name'] . " - " . $gateway['gateway'];
@@ -1682,7 +1682,7 @@ function build_gateway_list() {
function build_gatewayv6_list() {
global $a_gateways, $if;
- $list = array("none" => "None");
+ $list = array("none" => gettext("None"));
foreach ($a_gateways as $gateway) {
if (($gateway['interface'] == $if) && (is_ipaddrv6($gateway['gateway']))) {
$list[$gateway['name']] = $gateway['name'] . " - " . $gateway['gateway'];
@@ -2778,7 +2778,7 @@ if (isset($wancfg['wireless'])) {
'protmode',
'802.11g OFDM Protection Mode',
$pconfig['protmode'],
- ['off' => 'Off', 'cts' => 'CTS to self', 'rtscts' => 'RTS and CTS']
+ ['off' => gettext('Off'), 'cts' => gettext('CTS to self'), 'rtscts' => gettext('RTS and CTS')]
))->setHelp('For IEEE 802.11g, use the specified technique for protecting OFDM frames in a mixed 11b/11g network.');
} else {
$section->addInput(new Form_Input(
@@ -2789,7 +2789,7 @@ if (isset($wancfg['wireless'])) {
));
}
- $mode_list = ['0' => 'Auto'];
+ $mode_list = ['0' => gettext('Auto')];
if (is_array($wl_modes)) {
foreach ($wl_modes as $wl_standard => $wl_channels) {
@@ -2828,7 +2828,7 @@ if (isset($wancfg['wireless'])) {
'diversity',
null,
(isset($pconfig['diversity'])) ? $pconfig['diversity']:'',
- ['' => 'Default', '0' => 'Off', '1' => 'On']
+ ['' => gettext('Default'), '0' => gettext('Off'), '1' => gettext('On')]
))->setHelp('Diversity');
}
@@ -2837,7 +2837,7 @@ if (isset($wancfg['wireless'])) {
'txantenna',
null,
(isset($pconfig['txantenna'])) ? $pconfig['txantenna']:'',
- ['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']
+ ['' => gettext('Default'), '0' => gettext('Auto'), '1' => gettext('#1'), '2' => gettext('#2')]
))->setHelp('Transmit antenna');
}
@@ -2846,7 +2846,7 @@ if (isset($wancfg['wireless'])) {
'rxantenna',
null,
(isset($pconfig['rxantenna'])) ? $pconfig['rxantenna']:'',
- ['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']
+ ['' => gettext('Default'), '0' => gettext('Auto'), '1' => gettext('#1'), '2' => gettext('#2')]
))->setHelp('Receive antenna');
}
@@ -2904,7 +2904,7 @@ if (isset($wancfg['wireless'])) {
'reglocation',
'Location',
$pconfig['reglocation'],
- ['' => 'Default', 'indoor' => 'Indoor', 'outdoor' => 'Outdoor', 'anywhere' => 'Anywhere']
+ ['' => gettext('Default'), 'indoor' => gettext('Indoor'), 'outdoor' => gettext('Outdoor'), 'anywhere' => gettext('Anywhere')]
))->setHelp('These settings may affect which channels are available and the maximum transmit power allowed on those channels. ' .
'Using the correct settings to comply with local regulatory requirements is recommended.' . '<br />' .
'All wireless networks on this interface will be temporarily brought down when changing regulatory settings. ' .
@@ -2919,7 +2919,7 @@ if (isset($wancfg['wireless'])) {
'mode',
'Mode',
$pconfig['mode'],
- ['bss' => 'Infrastructure (BSS)', 'adhoc' => 'Ad-hoc (IBSS)', 'hostap' => 'Access Point']
+ ['bss' => gettext('Infrastructure (BSS)'), 'adhoc' => gettext('Ad-hoc (IBSS)'), 'hostap' => gettext('Access Point')]
));
$section->addInput(new Form_Input(
@@ -2934,7 +2934,7 @@ if (isset($wancfg['wireless'])) {
'puremode',
'Minimum wireless standard',
$pconfig['puremode'],
- ['any' => 'Any', '11g' => '802.11g', '11n' => '802.11n']
+ ['any' => gettext('Any'), '11g' => gettext('802.11g'), '11n' => gettext('802.11n')]
))->setHelp('When operating as an access point, allow only stations capable of the selected wireless standard to associate (stations not capable are not permitted to associate)');
} elseif (isset($wl_modes['11g'])) {
$section->addInput(new Form_Checkbox(
@@ -2994,21 +2994,21 @@ if (isset($wancfg['wireless'])) {
'wpa_mode',
'WPA mode',
(isset($pconfig['wpa_mode'])) ? $pconfig['wpa_mode']: '2',
- ['1' => 'WPA', '2' => 'WPA2', '3' => 'Both']
+ ['1' => gettext('WPA'), '2' => gettext('WPA2'), '3' => gettext('Both')]
));
$section->addInput(new Form_Select(
'wpa_key_mgmt',
'WPA Key Management Mode',
$pconfig['wpa_key_mgmt'],
- ['WPA-PSK' => 'Pre-Shared Key', 'WPA-EAP' => 'Extensible Authentication Protocol', 'WPA-PSK WPA-EAP' => 'Both']
+ ['WPA-PSK' => gettext('Pre-Shared Key'), 'WPA-EAP' => gettext('Extensible Authentication Protocol'), 'WPA-PSK WPA-EAP' => gettext('Both')]
));
$section->addInput(new Form_Select(
'wpa_pairwise',
'WPA Pairwise',
(isset($pconfig['wpa_pairwise'])) ? $pconfig['wpa_pairwise']:'CCMP',
- ['CCMP TKIP' => 'Both', 'CCMP' => 'AES (recommended)', 'TKIP' => 'TKIP']
+ ['CCMP TKIP' => gettext('Both'), 'CCMP' => gettext('AES (recommended)'), 'TKIP' => gettext('TKIP')]
));
$section->addInput(new Form_Input(
diff --git a/src/usr/local/www/interfaces_assign.php b/src/usr/local/www/interfaces_assign.php
index 0494201..06e5b15 100644
--- a/src/usr/local/www/interfaces_assign.php
+++ b/src/usr/local/www/interfaces_assign.php
@@ -336,7 +336,7 @@ if (isset($_POST['add']) && isset($_POST['if_add'])) {
$members = explode(",", strtoupper($bridge['members']));
foreach ($members as $member) {
if ($member == $ifnames[0]) {
- $input_errors[] = sprintf(gettext("You cannot set port %s to interface %s because this interface is a member of %s."), $portname, $member, $portname);
+ $input_errors[] = sprintf(gettext('You cannot set port %1$s to interface %2$s because this interface is a member of %3$s.'), $portname, $member, $portname);
break;
}
}
@@ -347,7 +347,7 @@ if (isset($_POST['add']) && isset($_POST['if_add'])) {
if (is_array($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
if (does_interface_exist($vlan['if']) == false) {
- $input_errors[] = "Vlan parent interface {$vlan['if']} does not exist anymore so vlan id {$vlan['tag']} cannot be created please fix the issue before continuing.";
+ $input_errors[] = sprintf(gettext('Vlan parent interface %1$s does not exist anymore so vlan id %2$s cannot be created please fix the issue before continuing.'), $vlan['if'], $vlan['tag']);
}
}
}
diff --git a/src/usr/local/www/interfaces_bridge_edit.php b/src/usr/local/www/interfaces_bridge_edit.php
index fd889ab..7425d42 100644
--- a/src/usr/local/www/interfaces_bridge_edit.php
+++ b/src/usr/local/www/interfaces_bridge_edit.php
@@ -180,7 +180,7 @@ if ($_POST) {
}
foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST[$ifn] <> "" && !is_numericint($_POST[$ifn])) {
- $input_errors[] = "{$ifdescr} " . gettext("interface priority for STP needs to be an integer between 0 and 240.");
+ $input_errors[] = sprintf(gettext("%s interface priority for STP needs to be an integer between 0 and 240."), $ifdescr);
}
}
@@ -188,7 +188,7 @@ if ($_POST) {
foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"])) {
- $input_errors[] = "{$ifdescr} " . gettext("interface path cost for STP needs to be an integer between 1 and 200000000.");
+ $input_errors[] = sprintf(gettext("%s interface path cost for STP needs to be an integer between 1 and 200000000."), $ifdescr);
}
$i++;
}
@@ -216,7 +216,7 @@ if ($_POST) {
$a_members = explode(',', $a_bridge['members']);
foreach ($a_members as $a_member) {
if ($ifmembers === $a_member) {
- $input_errors[] = $ifmembers . gettext(" is part of another bridge. Remove the interface from bridge members to continue.");
+ $input_errors[] = sprintf(gettext("%s is part of another bridge. Remove the interface from bridge members to continue."), $ifmembers);
}
}
}
diff --git a/src/usr/local/www/interfaces_lagg_edit.php b/src/usr/local/www/interfaces_lagg_edit.php
index 6c38740..8417834 100644
--- a/src/usr/local/www/interfaces_lagg_edit.php
+++ b/src/usr/local/www/interfaces_lagg_edit.php
@@ -70,56 +70,56 @@ $a_laggs = &$config['laggs']['lagg'];
$portlist = get_interface_list();
$laggprotos = array("none", "lacp", "failover", "fec", "loadbalance", "roundrobin");
-$laggprotosuc = array("NONE", "LACP", "FAILOVER", "FEC", "LOADBALANCE", "ROUNDROBIN");
+$laggprotosuc = array(gettext("NONE"), gettext("LACP"), gettext("FAILOVER"), gettext("FEC"), gettext("LOADBALANCE"), gettext("ROUNDROBIN"));
$protohelp =
'<ul>' .
'<li>' .
- '<strong>' . gettext($laggprotos[0]) . '</strong><br />' .
- gettext('This protocol is intended to do nothing: it disables any ' .
- 'traffic without disabling the lagg interface itself') .
+ '<strong>' . $laggprotosuc[0] . '</strong><br />' .
+ gettext('This protocol is intended to do nothing: it disables any ' .
+ 'traffic without disabling the lagg interface itself') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[1]) . '</strong><br />' .
- gettext('Supports the IEEE 802.3ad Link Aggregation Control Protocol ' .
- '(LACP) and the Marker Protocol. LACP will negotiate a set ' .
- 'of aggregable links with the peer in to one or more Link ' .
- 'Aggregated Groups. Each LAG is composed of ports of the ' .
- 'same speed, set to full-duplex operation. The traffic will ' .
- 'be balanced across the ports in the LAG with the greatest ' .
- 'total speed, in most cases there will only be one LAG which ' .
- 'contains all ports. In the event of changes in physical ' .
- 'connectivity, Link Aggregation will quickly converge to a ' .
- 'new configuration.') .
+ '<strong>' . $laggprotosuc[1] . '</strong><br />' .
+ gettext('Supports the IEEE 802.3ad Link Aggregation Control Protocol ' .
+ '(LACP) and the Marker Protocol. LACP will negotiate a set ' .
+ 'of aggregable links with the peer in to one or more Link ' .
+ 'Aggregated Groups. Each LAG is composed of ports of the ' .
+ 'same speed, set to full-duplex operation. The traffic will ' .
+ 'be balanced across the ports in the LAG with the greatest ' .
+ 'total speed, in most cases there will only be one LAG which ' .
+ 'contains all ports. In the event of changes in physical ' .
+ 'connectivity, Link Aggregation will quickly converge to a ' .
+ 'new configuration.') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[2]) . '</strong><br />' .
+ '<strong>' . $laggprotosuc[2] . '</strong><br />' .
gettext('Sends and receives traffic only through the master port. If ' .
'the master port becomes unavailable, the next active port is ' .
'used. The first interface added is the master port; any ' .
'interfaces added after that are used as failover devices.') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[3]) . '</strong><br />' .
+ '<strong>' . $laggprotosuc[3] . '</strong><br />' .
gettext('Supports Cisco EtherChannel. This is a static setup and ' .
- 'does not negotiate aggregation with the peer or exchange ' .
- 'frames to monitor the link.') .
+ 'does not negotiate aggregation with the peer or exchange ' .
+ 'frames to monitor the link.') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[4]) . '</strong><br />' .
- gettext('Balances outgoing traffic across the active ports based on ' .
- 'hashed protocol header information and accepts incoming ' .
- 'traffic from any active port. This is a static setup and ' .
- 'does not negotiate aggregation with the peer or exchange ' .
- 'frames to monitor the link. The hash includes the Ethernet ' .
- 'source and destination address, and, if available, the VLAN ' .
- 'tag, and the IP source and destination address') .
+ '<strong>' . $laggprotosuc[4] . '</strong><br />' .
+ gettext('Balances outgoing traffic across the active ports based on ' .
+ 'hashed protocol header information and accepts incoming ' .
+ 'traffic from any active port. This is a static setup and ' .
+ 'does not negotiate aggregation with the peer or exchange ' .
+ 'frames to monitor the link. The hash includes the Ethernet ' .
+ 'source and destination address, and, if available, the VLAN ' .
+ 'tag, and the IP source and destination address') .
'</li>' .
'<li>' .
- '<strong>' . gettext($laggprotos[5]) . '</strong><br />' .
- gettext('Distributes outgoing traffic using a round-robin scheduler ' .
- 'through all active ports and accepts incoming traffic from ' .
- 'any active port') .
+ '<strong>' . $laggprotosuc[5] . '</strong><br />' .
+ gettext('Distributes outgoing traffic using a round-robin scheduler ' .
+ 'through all active ports and accepts incoming traffic from ' .
+ 'any active port') .
'</li>' .
'</ul>';
diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php
index bfeb81f..8f06a58 100644
--- a/src/usr/local/www/interfaces_ppps_edit.php
+++ b/src/usr/local/www/interfaces_ppps_edit.php
@@ -452,7 +452,7 @@ $pgtitle = array(gettext("Interfaces"), gettext("PPPs"), gettext("Edit"));
$shortcut_section = "interfaces";
include("head.inc");
-$types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/);
+$types = array("select" => gettext("Select"), "ppp" => gettext("PPP"), "pppoe" => gettext("PPPoE"), "pptp" => gettext("PPTP"), "l2tp" => gettext("L2TP")/*, "tcp" => "TCP", "udp" => "UDP"*/);
$serviceproviders_xml = "/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml";
$serviceproviders_contents = file_get_contents($serviceproviders_xml);
diff --git a/src/usr/local/www/interfaces_wireless_edit.php b/src/usr/local/www/interfaces_wireless_edit.php
index adfaf29..198c589 100644
--- a/src/usr/local/www/interfaces_wireless_edit.php
+++ b/src/usr/local/www/interfaces_wireless_edit.php
@@ -221,8 +221,8 @@ $section->addInput(new Form_Select(
'Mode',
$pconfig['mode'],
array(
- 'bss' => 'Infrastructure (BSS)',
- 'adhoc' => 'Ad-hoc (IBSS)',
+ 'bss' => gettext('Infrastructure (BSS)'),
+ 'adhoc' => gettext('Ad-hoc (IBSS)'),
'hostap' => gettext('Access Point')
)
));
OpenPOWER on IntegriCloud