Revision 814f9e64
Added by Carlos Eduardo Ramos about 15 years ago
etc/inc/config.console.inc | ||
---|---|---|
55 | 55 |
|
56 | 56 |
if($avail < $g['minimum_ram_warning']) { |
57 | 57 |
echo "\n\n\n"; |
58 |
echo "DANGER! WARNING! ACHTUNG!\n\n";
|
|
59 |
echo "{$g['product_name']} requires *AT LEAST* {$g['minimum_ram_warning_text']} RAM to function correctly.\n";
|
|
60 |
echo "Only ({$avail}) MB RAM has been detected.\n";
|
|
61 |
echo "\nPress ENTER to continue. ";
|
|
58 |
echo gettext("DANGER! WARNING! ACHTUNG!") . "\n\n";
|
|
59 |
printf(gettext("%s requires *AT LEAST* %s RAM to function correctly.%s"), $g['product_name'], $g['minimum_ram_warning_text'], "\n");
|
|
60 |
printf(gettext("Only (%s) MB RAM has been detected.%s"), $avail, "\n");
|
|
61 |
echo "\n" . gettext("Press ENTER to continue.") . " ";
|
|
62 | 62 |
fgets($fp); |
63 | 63 |
echo "\n"; |
64 | 64 |
} |
... | ... | |
80 | 80 |
EOD; |
81 | 81 |
|
82 | 82 |
if(!is_array($iflist)) { |
83 |
echo "No interfaces found!\n";
|
|
83 |
echo gettext("No interfaces found!") . "\n";
|
|
84 | 84 |
$iflist = array(); |
85 | 85 |
} else { |
86 | 86 |
foreach ($iflist as $iface => $ifa) { |
... | ... | |
178 | 178 |
|
179 | 179 |
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { |
180 | 180 |
|
181 |
echo "\n\nVLAN interfaces:\n\n";
|
|
181 |
echo "\n\n" . gettext("VLAN interfaces:") . "\n\n";
|
|
182 | 182 |
foreach ($config['vlans']['vlan'] as $vlan) { |
183 | 183 |
|
184 | 184 |
echo sprintf("% -16s%s\n", "{$vlan['if']}_vlan{$vlan['tag']}", |
... | ... | |
204 | 204 |
EOD; |
205 | 205 |
|
206 | 206 |
do { |
207 |
echo "\nEnter the WAN interface name or 'a' for auto-detection: ";
|
|
207 |
echo "\n" . gettext("Enter the WAN interface name or 'a' for auto-detection:") . " ";
|
|
208 | 208 |
$wanif = chop(fgets($fp)); |
209 | 209 |
if ($wanif === "") { |
210 | 210 |
return; |
... | ... | |
212 | 212 |
if ($wanif === "a") |
213 | 213 |
$wanif = autodetect_interface("WAN", $fp); |
214 | 214 |
else if (!array_key_exists($wanif, $iflist)) { |
215 |
echo "\nInvalid interface name '{$wanif}'\n";
|
|
215 |
printf(gettext("%sInvalid interface name '%s'%s"), "\n", $wanif, "\n");
|
|
216 | 216 |
unset($wanif); |
217 | 217 |
continue; |
218 | 218 |
} |
219 | 219 |
} while (!$wanif); |
220 | 220 |
|
221 | 221 |
do { |
222 |
echo "\nEnter the LAN interface name or 'a' for auto-detection \n" .
|
|
223 |
"NOTE: this enables full Firewalling/NAT mode.\n" .
|
|
224 |
"(or nothing if finished): ";
|
|
222 |
printf(gettext("%sEnter the LAN interface name or 'a' for auto-detection %s" .
|
|
223 |
"NOTE: this enables full Firewalling/NAT mode.%s" .
|
|
224 |
"(or nothing if finished):%s"), "\n", "\n", "\n", " ");
|
|
225 | 225 |
|
226 | 226 |
$lanif = chop(fgets($fp)); |
227 | 227 |
|
... | ... | |
241 | 241 |
if ($lanif === "a") |
242 | 242 |
$lanif = autodetect_interface("LAN", $fp); |
243 | 243 |
else if (!array_key_exists($lanif, $iflist)) { |
244 |
echo "\nInvalid interface name '{$lanif}'\n";
|
|
244 |
printf(gettext("%sInvalid interface name '%s'%s)", "\n", $lanif), "\n");
|
|
245 | 245 |
unset($lanif); |
246 | 246 |
continue; |
247 | 247 |
} |
... | ... | |
258 | 258 |
$i1 = $i + 1; |
259 | 259 |
|
260 | 260 |
if($config['interfaces']['opt' . $i1]['descr']) |
261 |
echo "\nOptional interface {$i1} description found: {$config['interfaces']['opt' . $i1]['descr']}";
|
|
261 |
printf(gettext("%sOptional interface %s description found: %s"), "\n", $config['interfaces']['opt' . $i1]['descr']);
|
|
262 | 262 |
|
263 |
echo "\nEnter the Optional {$i1} interface name or 'a' for auto-detection\n" .
|
|
264 |
"(or nothing if finished): ";
|
|
263 |
printf(gettext("%sEnter the Optional %s{$i1} interface name or 'a' for auto-detection%s" .
|
|
264 |
"(or nothing if finished):%s"), "\n", $i1, "\n", " ");
|
|
265 | 265 |
|
266 | 266 |
$optif[$i] = chop(fgets($fp)); |
267 | 267 |
|
268 | 268 |
if ($optif[$i]) { |
269 | 269 |
if ($optif[$i] === "a") { |
270 |
$ad = autodetect_interface("Optional " . $i1, $fp);
|
|
270 |
$ad = autodetect_interface(gettext("Optional") . " " . $i1, $fp);
|
|
271 | 271 |
if ($ad) |
272 | 272 |
$optif[$i] = $ad; |
273 | 273 |
else |
274 | 274 |
unset($optif[$i]); |
275 | 275 |
} else if (!array_key_exists($optif[$i], $iflist)) { |
276 |
echo "\nInvalid interface name '{$optif[$i]}'\n";
|
|
276 |
printf(gettext("%sInvalid interface name '%s'%s"), "\n", $optif[$i], "\n");
|
|
277 | 277 |
unset($optif[$i]); |
278 | 278 |
continue; |
279 | 279 |
} |
... | ... | |
301 | 301 |
} |
302 | 302 |
} |
303 | 303 |
|
304 |
echo "\nThe interfaces will be assigned as follows: \n\n";
|
|
304 |
printf(gettext("%sThe interfaces will be assigned as follows: %s%s"), "\n", "\n", "\n");
|
|
305 | 305 |
|
306 | 306 |
if ($lanif != "") |
307 | 307 |
echo "LAN -> " . $lanif . "\n"; |
... | ... | |
407 | 407 |
for (; isset($config['interfaces']['opt' . ($i+1)]); $i++) |
408 | 408 |
unset($config['interfaces']['opt' . ($i+1)]); |
409 | 409 |
|
410 |
echo "\nWriting configuration...";
|
|
410 |
printf(gettext("%sWriting configuration..."), "\n");
|
|
411 | 411 |
write_config(); |
412 |
echo "done.\n";
|
|
412 |
printf(gettext("done.%s"), "\n");
|
|
413 | 413 |
|
414 | 414 |
fclose($fp); |
415 | 415 |
|
416 | 416 |
if($g['booting']) |
417 | 417 |
return; |
418 | 418 |
|
419 |
echo "One moment while we reload the settings...";
|
|
419 |
echo gettext("One moment while we reload the settings...");
|
|
420 | 420 |
|
421 | 421 |
$g['booting'] = false; |
422 | 422 |
|
... | ... | |
426 | 426 |
reload_all_sync(); |
427 | 427 |
*/ |
428 | 428 |
|
429 |
echo " done!\n";
|
|
429 |
echo " " . gettext("done!") . "\n";
|
|
430 | 430 |
|
431 | 431 |
touch("{$g['tmp_path']}/assign_complete"); |
432 | 432 |
|
... | ... | |
446 | 446 |
|
447 | 447 |
foreach ($iflist_prev as $ifn => $ifa) { |
448 | 448 |
if (!$ifa['up'] && $iflist[$ifn]['up']) { |
449 |
echo "Detected link-up on interface {$ifn}.\n";
|
|
449 |
printf(gettext("Detected link-up on interface %s.%s"), $ifn, "\n");
|
|
450 | 450 |
return $ifn; |
451 | 451 |
} |
452 | 452 |
} |
453 | 453 |
|
454 |
echo "No link-up detected.\n";
|
|
454 |
printf(gettext("No link-up detected.%s"), "\n");
|
|
455 | 455 |
|
456 | 456 |
return null; |
457 | 457 |
} |
... | ... | |
490 | 490 |
while (1) { |
491 | 491 |
$vlan = array(); |
492 | 492 |
|
493 |
echo "\n\nVLAN Capable interfaces:\n\n";
|
|
493 |
echo "\n\n" . gettext("VLAN Capable interfaces:") . "\n\n";
|
|
494 | 494 |
if(!is_array($iflist)) { |
495 |
echo "No interfaces found!\n";
|
|
495 |
echo gettext("No interfaces found!") . "\n";
|
|
496 | 496 |
} else { |
497 | 497 |
$vlan_capable=0; |
498 | 498 |
foreach ($iflist as $iface => $ifa) { |
... | ... | |
505 | 505 |
} |
506 | 506 |
|
507 | 507 |
if($vlan_capable == 0) { |
508 |
echo "No VLAN capable interfaces detected.\n";
|
|
508 |
echo gettext("No VLAN capable interfaces detected.") . "\n";
|
|
509 | 509 |
return; |
510 | 510 |
} |
511 | 511 |
|
512 |
echo "\nEnter the parent interface name for the new VLAN (or nothing if finished): ";
|
|
512 |
echo "\n" . gettext("Enter the parent interface name for the new VLAN (or nothing if finished):") . " ";
|
|
513 | 513 |
$vlan['if'] = chop(fgets($fp)); |
514 | 514 |
|
515 | 515 |
if ($vlan['if']) { |
516 | 516 |
if (!array_key_exists($vlan['if'], $iflist) or |
517 | 517 |
!is_jumbo_capable($vlan['if'])) { |
518 |
echo "\nInvalid interface name '{$vlan['if']}'\n";
|
|
518 |
printf(gettext("%sInvalid interface name '%s'%s"), "\n", $vlan['if'], "\n");
|
|
519 | 519 |
continue; |
520 | 520 |
} |
521 | 521 |
} else { |
522 | 522 |
break; |
523 | 523 |
} |
524 | 524 |
|
525 |
echo "Enter the VLAN tag (1-4094): ";
|
|
525 |
echo gettext("Enter the VLAN tag (1-4094):") . " ";
|
|
526 | 526 |
$vlan['tag'] = chop(fgets($fp)); |
527 | 527 |
$vlan['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; |
528 | 528 |
if (!is_numericint($vlan['tag']) || ($vlan['tag'] < 1) || ($vlan['tag'] > 4094)) { |
529 |
echo "\nInvalid VLAN tag '{$vlan['tag']}'\n";
|
|
529 |
printf(gettext("%sInvalid VLAN tag '%s'%s"), "\n", $vlan['tag'], "\n");
|
|
530 | 530 |
continue; |
531 | 531 |
} |
532 | 532 |
|
... | ... | |
535 | 535 |
} |
536 | 536 |
} |
537 | 537 |
|
538 |
?> |
|
538 |
?> |
Also available in: Unified diff
Implement gettext() calls on config.console.inc