Project

General

Profile

« Previous | Next » 

Revision 82b15b70

Added by Carlos Eduardo Ramos about 15 years ago

Implement gettext()

View differences:

usr/local/www/pkg_mgr.php
44 44
require_once("guiconfig.inc");
45 45
require_once("pkg-utils.inc");
46 46

  
47
$pkg_info = get_pkg_info('all', array('noembedded', 'name', 'category', 'website', 'version', 'status', 'descr', 'maintainer', 'required_version', 'maximum_version', 'pkginfolink'));
47
$pkg_info = get_pkg_info('all', array(gettext("noembedded"), gettext("name"), gettext("category"), gettext("website"), gettext("version"), gettext("status"), gettext("descr"), gettext("maintainer"), gettext("required_version"), gettext("maximum_version"), gettext("pkginfolink")));
48 48
if($pkg_info) {
49 49
	$fout = fopen("{$g['tmp_path']}/pkg_info.cache", "w");
50 50
	fwrite($fout, serialize($pkg_info));
......
54 54
	$using_cache = true;
55 55
	$xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl'];
56 56
	if(file_exists("{$g['tmp_path']}/pkg_info.cache")) {
57
		$savemsg = "Unable to retrieve package info from {$xmlrpc_base_url}. Cached data will be used.";
57
		$savemsg = sprintf(gettext("Unable to retrieve package info from '%s'. Cached data will be used."), $xmlrpc_base_url);
58 58
		$pkg_info = unserialize(@file_get_contents("{$g['tmp_path']}/pkg_info.cache"));
59 59
	} else {
60
		$savemsg = "Unable to communicate with {$xmlrpc_base_url}. Please verify DNS and interface configuration, and that {$g['product_name']} has functional Internet connectivity.";
60
		$savemsg = sprintf(gettext("Unable to communicate with '%s'. Please verify DNS and interface configuration, and that '%s' has functional Internet connectivity."), $xmlrpc_base_url, $g['product_name']);
61 61
	}
62 62
}
63 63

  
......
65 65
	if (isset($_GET['ver']))
66 66
		$requested_version = htmlspecialchars($_GET['ver']);
67 67

  
68
$pgtitle = array("System","Package Manager");
68
$pgtitle = array(gettext("System"),gettext("Package Manager"));
69 69
include("head.inc");
70 70

  
71 71
?>
......
88 88
			$testing_version = substr($version, $hyphen + 1, strlen($version) - $hyphen);
89 89

  
90 90
			$tab_array = array();
91
			$tab_array[] = array("{$version} packages", $requested_version <> "" ? false : true, "pkg_mgr.php");
91
			$tab_array[] = array($version . gettext("packages"), $requested_version <> "" ? false : true, "pkg_mgr.php");
92 92
//			$tab_array[] = array("Packages for any platform", $requested_version == "none" ? true : false, "pkg_mgr.php?ver=none");
93 93
//			$tab_array[] = array("Packages with a different version", $requested_version == "other" ? true : false, "pkg_mgr.php?ver=other");
94
			$tab_array[] = array("Installed Packages", false, "pkg_mgr_installed.php");
94
			$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php");
95 95
			display_top_tabs($tab_array);
96 96
		?>
97 97
		</td>
......
101 101
			<div id="mainarea">
102 102
				<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0">
103 103
					<tr>
104
						<td width="10%" class="listhdrr">Package Name</td>
105
						<td width="25%" class="listhdrr">Category</td>
104
						<td width="10%" class="listhdrr"><?=gettext("Package Name"); ?></td>
105
						<td width="25%" class="listhdrr"><?=gettext("Category"); ?></td>
106 106
<!--					<td width="10%" class="listhdrr">Size</td>	-->
107
						<td width="5%" class="listhdrr">Status</td>
108
						<td width="5%" class="listhdrr">Package Info</td>
109
						<td width="50%" class="listhdr">Description</td>
107
						<td width="5%" class="listhdrr"><?=gettext("Status"); ?></td>
108
						<td width="5%" class="listhdrr"><?=gettext("Package Info"); ?></td>
109
						<td width="50%" class="listhdr"><?=gettext("Description"); ?></td>
110 110
					</tr>
111 111
					<?php
112 112
						if(!$pkg_info) {
113
							echo "<tr><td colspan=\"5\"><center>There are currently no packages available for installation.</td></tr>";
113
							echo "<tr><td colspan=\"5\"><center>" . gettext("There are currently no packages available for installation.") . "</td></tr>";
114 114
						} else {
115 115
							$installed_pfsense_version = rtrim(file_get_contents("/etc/version"));
116 116
							$dash = strpos($installed_pfsense_version, "-");
......
181 181
						</td>
182 182
-->
183 183
						<td class="listr">
184
							<?= $index['status'] ?>
184
							<?=$index['status'] ?>
185 185
							<br/>
186
							<?= $index['version'] ?>
186
							<?=$index['version'] ?>
187 187
							<br/>
188
							platform: <?= $index['required_version'] ?>
188
							<?=gettext("platform:") . $index['required_version'] ?>
189 189
							<br/>
190
							<?= $index['maximum_version']; ?>
190
							<?=$index['maximum_version'] ?>
191 191
						</td>
192 192
						<td class="listr">
193 193
						<?php
......
195 195
							$pkginfolink = $index['pkginfolink'];
196 196
							echo "<a target='_new' href='$pkginfolink'>Package Info</a>";
197 197
						} else {
198
							echo "No info, check the <a href='http://forum.pfsense.org/index.php/board,15.0.html'>forum</a>";
198
							echo gettext("No info, check the") . "<a href='http://forum.pfsense.org/index.php/board,15.0.html'>" . gettext("forum") . "</a>";
199 199
						}
200 200
						?>
201 201
						</td>
......
203 203
							<?= $index['descr'] ?>
204 204
						</td>
205 205
						<td valign="middle" class="list" nowrap>
206
							<a onclick="return confirm('Do you really want to install this package?')" href="pkg_mgr_install.php?id=<?=$index['name'];?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a>
206
							<a onclick="return confirm('<?=gettext("Do you really want to install this package?"); ?>')" href="pkg_mgr_install.php?id=<?=$index['name'];?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a>
207 207
						</td>
208 208
					</tr>
209 209
					<?php
210 210
								}
211 211
							} else {
212
								echo '<tr><td colspan="5"><center>There are currently no packages available for installation.</center></td></tr>';
212
								echo "<tr><td colspan='5'><center>" . gettext("There are currently no packages available for installation.") . "</center></td></tr>";
213 213
							}
214 214
						}
215 215
					?>

Also available in: Unified diff