Project

General

Profile

« Previous | Next » 

Revision 4d0c9c59

Added by Phil Davis over 8 years ago

setHelp formatting for interfaces.php

There was a fair bit of it, so I have put this in its own pull request.
1) Gets HTML out of the strings that go for translation.
2) Line 3365 - the words here about "hexadecimal" now go in the text directly in the setHelp so the translators will get access to them.
3) Line 2213 - a couple of backslash that were attempts at escaping the next char were not actually needed, and were displaying literally in the GUI.

View differences:

src/usr/local/www/interfaces.php
1772 1772
$group = new Form_Group('MAC Address');
1773 1773
$group->add($macaddress);
1774 1774
// $group->add($btnmymac);
1775
$group->setHelp('This field can be used to modify ("spoof") the MAC address of this interface.' . '<br />' .
1776
				'Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx or leave blank.');
1775
$group->setHelp('This field can be used to modify ("spoof") the MAC address of this interface.%s' .
1776
				'Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx or leave blank.', '<br />');
1777 1777
$section->add($group);
1778 1778

  
1779 1779
$section->addInput(new Form_Input(
......
1798 1798
		'Speed and Duplex',
1799 1799
		rtrim($config['interfaces'][$if]['media'] . ' ' . $config['interfaces'][$if]['mediaopt']),
1800 1800
		build_mediaopts_list()
1801
	))->setHelp('Explicitly set speed and duplex mode for this interface.' . '<br />' .
1802
				'WARNING: MUST be set to autoselect (automatically negotiate speed) unless the port this interface connects to has its speed and duplex forced.');
1801
	))->setHelp('Explicitly set speed and duplex mode for this interface.%s' .
1802
				'WARNING: MUST be set to autoselect (automatically negotiate speed) unless the port this interface connects to has its speed and duplex forced.', '<br />');
1803 1803
}
1804 1804

  
1805 1805
$form->add($section);
......
1830 1830
	'fa-plus'
1831 1831
))->setAttribute('type','button')->addClass('btn-success')->setAttribute('data-target', '#newgateway')->setAttribute('data-toggle', 'modal');
1832 1832

  
1833
$group->setHelp('If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the "Add" button.' . '<br />' .
1833
$group->setHelp('If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the "Add" button.%1$s' .
1834 1834
				'On local area network interfaces the upstream gateway should be "none". ' .
1835
				gettext('Gateways can be managed by ') . '<a target="_blank" href="system_gateways.php">' . gettext(" clicking here") . '</a>.');
1835
				'Gateways can be managed by %2$sclicking here%3$s.', '<br />', '<a target="_blank" href="system_gateways.php">', '</a>');
1836 1836

  
1837 1837
$section->add($group);
1838 1838

  
......
1864 1864
	'fa-plus'
1865 1865
))->setAttribute('type','button')->addClass('btn-success')->setAttribute('data-target', '#newgateway6')->setAttribute('data-toggle', 'modal');
1866 1866

  
1867
$group->setHelp('If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the "Add" button.' . '<br />' .
1868
				'On local LANs the upstream gateway should be "none". ');
1867
$group->setHelp('If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the "Add" button.%s' .
1868
				'On local LANs the upstream gateway should be "none". ', '<br />');
1869 1869

  
1870 1870
$section->add($group);
1871 1871
$form->add($section);
......
2053 2053
	'SavedCfg'
2054 2054
))->displayAsRadio();
2055 2055

  
2056
$group->setHelp('The values in these fields are DHCP protocol timings used when requesting a lease.' . '<br />' .
2057
				'<a target="_blank" href="https://www.freebsd.org/cgi/man.cgi?query=dhclient.conf&sektion=5#PROTOCOL_TIMING">' . 'See here more information' . '</a>');
2056
$group->setHelp('The values in these fields are DHCP protocol timings used when requesting a lease.%1$s' .
2057
				'See %2$shere%3$s for more information', '<br />', '<a target="_blank" href="https://www.freebsd.org/cgi/man.cgi?query=dhclient.conf&sektion=5#PROTOCOL_TIMING">', '</a>');
2058 2058

  
2059 2059
$section->add($group);
2060 2060

  
......
2063 2063
	'Configuration File Override',
2064 2064
	'text',
2065 2065
	$pconfig['adv_dhcp_config_file_override_path']
2066
))->setWidth(9)->sethelp('The value in this field is the full absolute path to a DHCP client configuration file.	 [/[dirname/[.../]]filename[.ext]]' . '<br />' .
2067
			'Value Substitutions in Config File: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD}' . '<br />' .
2068
			'Where C is U(pper) or L(ower) Case, and D is ":-." Delimiter (space, colon, hyphen, or period) (omitted for none).' . '<br />' .
2069
			'Some ISPs may require certain options be or not be sent.');
2066
))->setWidth(9)->sethelp('The value in this field is the full absolute path to a DHCP client configuration file.	 [/[dirname/[.../]]filename[.ext]] %1$s' .
2067
			'Value Substitutions in Config File: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD} %1$s'.
2068
			'Where C is U(pper) or L(ower) Case, and D is ":-." Delimiter (space, colon, hyphen, or period) (omitted for none).%1$s' .
2069
			'Some ISPs may require certain options be or not be sent.', '<br />');
2070 2070

  
2071 2071
$form->add($section);
2072 2072

  
......
2078 2078
	'Send options',
2079 2079
	'text',
2080 2080
	$pconfig['adv_dhcp_send_options']
2081
))->setWidth(9)->sethelp('The values in this field are DHCP options to be sent when requesting a DHCP lease.	 [option declaration [, ...]]' . '<br />' .
2082
			'Value Substitutions: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD}' . '<br />' .
2083
			'Where C is U(pper) or L(ower) Case, and D is " :-." Delimiter (space, colon, hyphen, or period) (omitted for none).' . '<br />' .
2084
			'Some ISPs may require certain options be or not be sent.');
2081
))->setWidth(9)->sethelp('The values in this field are DHCP options to be sent when requesting a DHCP lease.	 [option declaration [, ...]] %1$s' .
2082
			'Value Substitutions: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD} %1$s' .
2083
			'Where C is U(pper) or L(ower) Case, and D is " :-." Delimiter (space, colon, hyphen, or period) (omitted for none).%1$s' .
2084
			'Some ISPs may require certain options be or not be sent.', '<br />');
2085 2085

  
2086 2086
$section->addInput(new Form_Input(
2087 2087
	'adv_dhcp_request_options',
2088 2088
	'Request options',
2089 2089
	'text',
2090 2090
	$pconfig['adv_dhcp_request_options']
2091
))->setWidth(9)->sethelp('The values in this field are DHCP option 55 to be sent when requesting a DHCP lease.  [option [, ...]]' . '<br />' .
2092
			'Some ISPs may require certain options be or not be requested.');
2091
))->setWidth(9)->sethelp('The values in this field are DHCP option 55 to be sent when requesting a DHCP lease.  [option [, ...]] %1$s' .
2092
			'Some ISPs may require certain options be or not be requested.', '<br />');
2093 2093

  
2094 2094
$section->addInput(new Form_Input(
2095 2095
	'adv_dhcp_required_options',
......
2103 2103
	'Option modifiers',
2104 2104
	'text',
2105 2105
	$pconfig['adv_dhcp_option_modifiers']
2106
))->setWidth(9)->sethelp('The values in this field are DHCP option modifiers applied to the obtained DHCP lease.	 [modifier option declaration [, ...]]' . '<br />' .
2107
			'modifiers: (default, supersede, prepend, append)' . '<br />' .
2108
			'<a target="_blank" href="https://www.freebsd.org/cgi/man.cgi?query=dhclient.conf&sektion=5#LEASE_REQUIREMENTS_AND_REQUESTS">' . 'See here more information' . '</a>');
2106
))->setWidth(9)->sethelp('The values in this field are DHCP option modifiers applied to the obtained DHCP lease.	 [modifier option declaration [, ...]] %1$s' .
2107
			'modifiers: (default, supersede, prepend, append) %1$s' .
2108
			'See %2$shere%3$s more information', '<br />', '<a target="_blank" href="https://www.freebsd.org/cgi/man.cgi?query=dhclient.conf&sektion=5#LEASE_REQUIREMENTS_AND_REQUESTS">', '</a>');
2109 2109

  
2110 2110
$form->add($section);
2111 2111

  
......
2183 2183
	'Configuration File Override',
2184 2184
	'text',
2185 2185
	$pconfig['adv_dhcp6_config_file_override_path']
2186
))->setWidth(9)->setHelp('The value in this field is the full absolute path to a DHCP client configuration file.	 [/[dirname/[.../]]filename[.ext]]' . '<br />' .
2187
			'Value Substitutions in Config File: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD}' . '<br />' .
2188
			'Where C is U(pper) or L(ower) Case, and D is " :-." Delimiter (space, colon, hyphen, or period) (omitted for none).' . '<br />' .
2189
			'Some ISPs may require certain options be or not be sent.');
2186
))->setWidth(9)->setHelp('The value in this field is the full absolute path to a DHCP client configuration file.	 [/[dirname/[.../]]filename[.ext]] %1$s' .
2187
			'Value Substitutions in Config File: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD} %1$s' .
2188
			'Where C is U(pper) or L(ower) Case, and D is " :-." Delimiter (space, colon, hyphen, or period) (omitted for none).%1$s' .
2189
			'Some ISPs may require certain options be or not be sent.', '<br />');
2190 2190

  
2191 2191
$form->add($section);
2192 2192

  
......
2208 2208
	'Send options',
2209 2209
	'text',
2210 2210
	$pconfig['adv_dhcp6_interface_statement_send_options']
2211
))->setWidth(9)->sethelp('DHCP send options to be sent when requesting a DHCP lease.	 [option declaration [, ...]]' . '<br />' .
2212
			'Value Substitutions: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD}' . '<br />' .
2213
			'Where C is U(pper) or L(ower) Case, and D is \" :-.\" Delimiter (space, colon, hyphen, or period) (omitted for none).' . '<br />' .
2214
			'Some DHCP services may require certain options be or not be sent.');
2211
))->setWidth(9)->sethelp('DHCP send options to be sent when requesting a DHCP lease.	 [option declaration [, ...]] %1$s' .
2212
			'Value Substitutions: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD} %1$s' .
2213
			'Where C is U(pper) or L(ower) Case, and D is " :-." Delimiter (space, colon, hyphen, or period) (omitted for none).%1$s' .
2214
			'Some DHCP services may require certain options be or not be sent.', '<br />');
2215 2215

  
2216 2216
$section->addInput(new Form_Input(
2217 2217
	'adv_dhcp6_interface_statement_request_options',
2218 2218
	'Request Options',
2219 2219
	'text',
2220 2220
	$pconfig['adv_dhcp6_interface_statement_request_options']
2221
))->setWidth(9)->sethelp('DHCP request options to be sent when requesting a DHCP lease.	[option [, ...]]' . '<br />' .
2222
			'Some DHCP services may require certain options be or not be requested.');
2221
))->setWidth(9)->sethelp('DHCP request options to be sent when requesting a DHCP lease.	[option [, ...]] %1$s' .
2222
			'Some DHCP services may require certain options be or not be requested.', '<br />');
2223 2223

  
2224 2224
$section->addInput(new Form_Input(
2225 2225
	'adv_dhcp6_interface_statement_script',
2226 2226
	'Scripts',
2227 2227
	'text',
2228 2228
	$pconfig['adv_dhcp6_interface_statement_script']
2229
))->setWidth(9)->sethelp('Absolute path to a script invoked on certain conditions including when a reply message is received.' . '<br />' .
2230
			'[/[dirname/[.../]]filename[.ext]].');
2229
))->setWidth(9)->sethelp('Absolute path to a script invoked on certain conditions including when a reply message is received.%1$s' .
2230
			'[/[dirname/[.../]]filename[.ext]].', '<br />');
2231 2231

  
2232 2232
$group = new Form_Group('Identity Association Statement');
2233 2233

  
......
2401 2401
	$pconfig['adv_dhcp6_key_info_statement_expire']
2402 2402
))->sethelp('Expire');
2403 2403

  
2404
$group->setHelp('<a target="_blank" href="https://www.freebsd.org/cgi/man.cgi?query=dhcp6c.conf&sektion=5&apropos=0&manpath=FreeBSD+10.1-RELEASE+and+Ports#Interface_statement">' . 'See here more information' . '</a>');
2404
$group->setHelp('See %1$shere%2$s more information', '<a target="_blank" href="https://www.freebsd.org/cgi/man.cgi?query=dhcp6c.conf&sektion=5&apropos=0&manpath=FreeBSD+10.1-RELEASE+and+Ports#Interface_statement">', '</a>');
2405 2405

  
2406 2406
$section->add($group);
2407 2407

  
......
2490 2490
	'IPv6 Prefix ID',
2491 2491
	'text',
2492 2492
	sprintf("%x", $pconfig['track6-prefix-id'])
2493
))->setHelp('<span id="track6-prefix-id-range"></span>The value in this field is the (Delegated) IPv6 prefix ID. This determines the configurable network ID based on the dynamic IPv6 connection. The default value is 0.');
2493
))->setHelp('(%1$shexadecimal%2$s from 0 to %3$s) The value in this field is the (Delegated) IPv6 prefix ID. This determines the configurable network ID based on the dynamic IPv6 connection. The default value is 0.', '<b>', '</b>', '<span id="track6-prefix-id-range"></span>');
2494 2494

  
2495 2495
$section->addInput(new Form_Input(
2496 2496
	'track6-prefix-id-max',
......
2776 2776
	'Advanced and MLPPP',
2777 2777
	isset($pconfig['pppid']) ? 'interfaces_ppps_edit.php?id=' . htmlspecialchars($pconfig['pppid']) : 'interfaces_ppps_edit.php',
2778 2778
	'fa-cog'
2779
))->setAttribute('type','button')->addClass('btn-info')->setAttribute('id')->setHelp($mlppp_text . 'Click for additional PPTP and L2TP configuration options. Save first if changes have been made.');
2779
))->setAttribute('type','button')->addClass('btn-info')->setAttribute('id')->setHelp('%sClick for additional PPTP and L2TP configuration options. Save first if changes have been made.', $mlppp_text);
2780 2780

  
2781 2781
$form->add($section);
2782 2782

  
......
2855 2855
		'Channel',
2856 2856
		$pconfig['channel'],
2857 2857
		$mode_list
2858
	))->setHelp('Legend: wireless standards - channel # (frequency @ max TX power / TX power allowed in reg. domain)' . '<br />' .
2859
				'Not all channels may be supported by some cards.  Auto may override the wireless standard selected above.');
2858
	))->setHelp('Legend: wireless standards - channel # (frequency @ max TX power / TX power allowed in reg. domain) %1$s' .
2859
				'Not all channels may be supported by some cards.  Auto may override the wireless standard selected above.', '<br />');
2860 2860

  
2861 2861
	if (ANTENNAS) {
2862 2862
		if (isset($wl_sysctl["{$wl_sysctl_prefix}.diversity"]) || isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"]) || isset($wl_sysctl["{$wl_sysctl_prefix}.rxantenna"])) {
......
2945 2945
		$pconfig['reglocation'],
2946 2946
		['' => gettext('Default'), 'indoor' => gettext('Indoor'), 'outdoor' => gettext('Outdoor'), 'anywhere' => gettext('Anywhere')]
2947 2947
	))->setHelp('These settings may affect which channels are available and the maximum transmit power allowed on those channels. ' .
2948
				'Using the correct settings to comply with local regulatory requirements is recommended.' . '<br />' .
2948
				'Using the correct settings to comply with local regulatory requirements is recommended.%1$s' .
2949 2949
				'All wireless networks on this interface will be temporarily brought down when changing regulatory settings.  ' .
2950 2950
				'Some of the regulatory domains or country codes may not be allowed by some cards.	' .
2951
				'These settings may not be able to add additional channels that are not already supported.');
2951
				'These settings may not be able to add additional channels that are not already supported.', '<br />');
2952 2952

  
2953 2953
	$form->add($section);
2954 2954

  
......
3164 3164
	$pconfig['blockbogons'],
3165 3165
	'yes'
3166 3166
))->setHelp('Blocks traffic from reserved IP addresses (but not RFC 1918) or not yet assigned by IANA. Bogons are prefixes that should ' .
3167
			'never appear in the Internet routing table, and so should not appear as the source address in any packets received.' . '<br />' .
3168
			'Note: The update frequency can be changed under System->Advanced Firewall/NAT settings.');
3167
			'never appear in the Internet routing table, and so should not appear as the source address in any packets received.%1$s' .
3168
			'Note: The update frequency can be changed under System->Advanced Firewall/NAT settings.', '<br />');
3169 3169

  
3170 3170
$form->add($section);
3171 3171

  
......
3362 3362
		}
3363 3363

  
3364 3364
		track6_prefix_ids = parseInt(track6_prefix_ids).toString(16);
3365
		$('#track6-prefix-id-range').html('(<b>hexadecimal</b> from 0 to ' + track6_prefix_ids + ')');
3365
		$('#track6-prefix-id-range').html(track6_prefix_ids);
3366 3366
	}
3367 3367

  
3368 3368
	// Create the new gateway from the data entered in the modal pop-up

Also available in: Unified diff