Changeset 133
- Timestamp:
- 08/29/07 22:09:49 (17 months ago)
- Location:
- trunk
- Files:
-
- 17 added
- 6 modified
-
CHANGELOG (modified) (1 diff)
-
README (modified) (1 diff)
-
config-sample.php (modified) (1 diff)
-
index.php (modified) (6 diffs)
-
locale (added)
-
locale/en_GB.UTF-8 (added)
-
locale/en_GB.UTF-8/LC_MESSAGES (added)
-
locale/en_GB.UTF-8/LC_MESSAGES/messages.mo (added)
-
locale/en_GB.UTF-8/LC_MESSAGES/messages.po (added)
-
locale/en_US.UTF-8 (added)
-
locale/en_US.UTF-8/LC_MESSAGES (added)
-
locale/en_US.UTF-8/LC_MESSAGES/messages.mo (added)
-
locale/en_US.UTF-8/LC_MESSAGES/messages.po (added)
-
locale/nl_NL.UTF-8 (added)
-
locale/nl_NL.UTF-8/LC_MESSAGES (added)
-
locale/nl_NL.UTF-8/LC_MESSAGES/messages.mo (added)
-
locale/nl_NL.UTF-8/LC_MESSAGES/messages.po (added)
-
locale/sv_SE.UTF-8 (added)
-
locale/sv_SE.UTF-8/LC_MESSAGES (added)
-
locale/sv_SE.UTF-8/LC_MESSAGES/messages.mo (added)
-
locale/sv_SE.UTF-8/LC_MESSAGES/messages.po (added)
-
templates/default.php (modified) (9 diffs)
-
templates/rarpass.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r131 r133 22 22 * Made sorting take advantage of the multi-call support, speeding up queue 23 23 sorting significantly. 24 25 * Added gettext multi-language support. For information on translating 26 HellaWorld to your language, please see the GNU Gettext documentation. 27 28 * Added partial translation into Dutch (Thanks Stevuu) 29 30 * Added partial translation into Swedish (Thanks Toxik) 24 31 25 32 1.7 -
trunk/README
r131 r133 8 8 Then upload and view the site within your web browser. That should 9 9 be all that's necessary. 10 11 *Supported Languages* 12 13 Multiple languages are supported using GNU Gettext. Language codes are 14 in the form of lang_COUNTRY, so en_GB for English or sv_SE for Swedish. 15 16 Language codes with translations available are: 17 en_GB - English (Default) 18 en_US - American English 19 nl_NL - Dutch 20 sv_SE - Swedish 21 22 If you would like to translate HellaWorld into your native language, 23 please read the GNU Gettext documentation, the standard English messages 24 are located in locale/en_GB.UTF-8/messages.po 10 25 11 26 *Tracking Finished Items* -
trunk/config-sample.php
r131 r133 16 16 'password' => 'changeme', // The password specified in hellanzb.conf 17 17 'showfinished' => true, // Show finished items, see README for details 18 'language' => 'en_GB', // The language code HellaWorld should use 18 19 ); 19 20 -
trunk/index.php
r131 r133 48 48 } 49 49 50 if (!function_exists('_')) { 51 function _($string) { 52 return $string; 53 } 54 } else { 55 putenv('LC_ALL=' . $config['language'] . '.UTF-8'); 56 setlocale(LC_ALL, $config['language'] . '.UTF-8'); 57 bindtextdomain('messages', 'locale'); 58 textdomain('messages'); 59 } 60 50 61 $hellaworldversion = "1.8-SVN"; 51 62 $protocol = (($_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http'); … … 59 70 header('WWW-Authenticate: Basic realm="HellaWorld"'); 60 71 header('HTTP/1.0 401 Unauthorized'); 61 throw new Exception( 'Unauthorized access');72 throw new Exception(_('Unauthorized access')); 62 73 } else { 63 74 $config['username'] = $_SERVER['PHP_AUTH_USER']; … … 72 83 header('WWW-Authenticate: Basic realm="HellaWorld"'); 73 84 header('HTTP/1.0 401 Unauthorized'); 74 throw new Exception( 'Unauthorized access');85 throw new Exception(_('Unauthorized access')); 75 86 } else { 76 87 $_SESSION['login'] = 0; 77 88 header('HTTP/1.0 403 Forbidden'); 78 throw new Exception( 'Access Forbidden');89 throw new Exception(_('Access Forbidden')); 79 90 } 80 91 } else { … … 266 277 $fp = @fopen('completed.xml', 'w'); 267 278 if (!$fp) { 268 throw new Exception( 'Unable to write to completed.xml, please check permissions');279 throw new Exception(_('Unable to write to completed.xml, please check permissions')); 269 280 } 270 281 fwrite($fp, $x->asXML()); … … 281 292 $fp = @fopen('completed.xml', 'w'); 282 293 if (!$fp) { 283 throw new Exception( 'Unable to write to completed.xml, please check permissions');294 throw new Exception(_('Unable to write to completed.xml, please check permissions')); 284 295 } 285 296 fwrite($fp, $x->asXML()); … … 287 298 header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . $self); 288 299 } else { 289 throw new Exception( 'Invalid ID provided');300 throw new Exception(_('Invalid ID provided')); 290 301 } 291 302 } -
trunk/templates/default.php
r132 r133 60 60 <h1>HellaWorld</h1> 61 61 <div> 62 <p> HellaNZB v<?php echo $c->version; ?> - Uptime: <?php echo $c->uptime; ?></p>63 <p> Downloaded: <?php echo $c->totalFiles; ?> files in <?php echo $c->totalSegments; ?> segments totalling <?php echo $c->totalMB; ?>MB via <?php echo $c->totalNZBs; ?> NZB files</p>62 <p><?php printf(_('HellaNZB %s - Uptime: %s'), $c->version, $c->uptime); ?></p> 63 <p><?php printf(_('Downloaded: %s files in %s segments totalling %sMB via %s NZB files'), $c->totalfiles, $c->totalSegments, $c->totalMB, $c->totalNZBz); ?></p> 64 64 </div> 65 65 </div> 66 66 <div id="container"> 67 67 <div id="modules"> 68 <h2> Add NZB Via Newzbin ID Or URL</h2>68 <h2><?php echo _('Add NZB Via Newzbin ID Or URL'); ?></h2> 69 69 <div> 70 70 <form method="get" action="<?php echo $self; ?>"> 71 71 <fieldset> 72 72 <input type="submit" value="Go" style="float:right;" /> 73 <label for="nzbdownload"> Article ID or URL:<input type="text" name="nzbdownload" id="nzbdownload" /></label>73 <label for="nzbdownload"><?php echo _('Article ID or URL:'); ?> <input type="text" name="nzbdownload" id="nzbdownload" /></label> 74 74 </fieldset> 75 75 </form> 76 76 </div> 77 <h2> Set Rate Limit</h2>77 <h2><?php echo _('Set Rate Limit'); ?></h2> 78 78 <div> 79 79 <form method="get" action="<?php echo $self; ?>"> 80 80 <fieldset> 81 81 <input type="submit" value="Go" style="float:right" /> 82 <label for="maxrate"> Limit (KB/s):<input type="text" name="maxrate" id="maxrate" value="<?php echo $c->rateLimit; ?>" /></label>82 <label for="maxrate"><?php echo _('Limit (KB/s):'); ?> <input type="text" name="maxrate" id="maxrate" value="<?php echo $c->rateLimit; ?>" /></label> 83 83 </fieldset> 84 84 </form> … … 89 89 <ul> 90 90 <?php if ($c->paused): ?> 91 <li><a href="<?php echo $self; ?>?action=8" title=" Resume">Resume downloading</a></li>91 <li><a href="<?php echo $self; ?>?action=8" title="<?php echo _('Resume downloading'); ?>"><?php echo _('Resume downloading'); ?></a></li> 92 92 <?php else: ?> 93 <li><a href="<?php echo $self; ?>?action=7" title=" Pause">Pause current download</a></li>93 <li><a href="<?php echo $self; ?>?action=7" title="<?php echo _('Pause current download'); ?>"><?php echo _('Pause current download'); ?></a></li> 94 94 <?php endif; ?> 95 <li><a href="<?php echo $self; ?>?action=9" title=" Cancel" onclick="return confirm('This will cancel the current download and remove it from the queue, continue?');">Cancel current download</a></li>96 <li><a href="<?php echo $self; ?>?action=11" title=" Shut down" onclick="return confirm('HellaNZB cannot be restarted without shell access, continue?');">Shut down HellaNZB</a></li>97 <li><a href="<?php echo $self; ?>?action=10" title=" Clear queue" onclick="return confirm('This cannot be undone, continue?');">Clear the queue</a></li>95 <li><a href="<?php echo $self; ?>?action=9" title="<?php echo _('Cancel current download'); ?>" onclick="return confirm('<?php echo _('This will cancel the current download and remove it from the queue, continue?'); ?>');"><?php echo _('Cancel current download'); ?></a></li> 96 <li><a href="<?php echo $self; ?>?action=11" title="<?php echo _('Shut down HellaNZB'); ?>" onclick="return confirm('<?php echo _('HellaNZB cannot be restarted without shell access, continue?'); ?>');"><?php echo _('Shut down HellaNZB'); ?></a></li> 97 <li><a href="<?php echo $self; ?>?action=10" title="<?php echo _('Clear the queue'); ?>" onclick="return confirm('<?php echo _('This cannot be undone, continue?'); ?>');"><?php echo _('Clear the queue'); ?></a></li> 98 98 </ul> 99 99 </div> 100 100 <div id="info"> 101 <h2> Currently Downloading</h2>101 <h2><?php echo _('Currently Downloading'); ?></h2> 102 102 <?php if ($c->downloadCount > 0): foreach($c->downloads as $download): ?> 103 103 <div><?php echo htmlspecialchars($download['nzbName']); ?></div> 104 <div class="queuestats"><img src="progress.php?percentage=<?php echo $c->completed; ?>" alt="progress bar" /> <?php echo $c->completed; ?>% complete</div>105 <div class="queuestats"><?php echo $c->remaining; ?>MB of <?php echo $download['total_mb']; ?>MB remaining</div>106 <div class="queuestats" style="margin-bottom: 5px;"><?php echo ((!$c->paused) ? 'ETA ' . $c->formatTimeStamp($c->eta) . ' at ' . $c->transferRate . 'KB/s' : 'PAUSED'); ?></div>104 <div class="queuestats"><img src="progress.php?percentage=<?php echo $c->completed; ?>" alt="progress bar" /> <?php printf(_('%s%% complete'), $c->completed); ?></div> 105 <div class="queuestats"><?php printf(_('%sMB of %sMB remaining'), $c->remaining, $download['total_mb']); ?></div> 106 <div class="queuestats" style="margin-bottom: 5px;"><?php if (!$c->paused): printf(_('ETA %s at %sKB/s'), $c->formatTimeStamp($c->eta), $c->transferRate); else: echo _('PAUSED'); endif; ?></div> 107 107 <?php endforeach; else: ?> 108 <div style="margin-bottom: 5px;"> Nothing</div>108 <div style="margin-bottom: 5px;"><?php echo _('Nothing'); ?></div> 109 109 <?php endif; ?> 110 <h2> Currently Processing</h2>110 <h2><?php echo _('Currently Processing'); ?></h2> 111 111 <?php if ($c->processCount > 0): foreach($c->processing as $processing): ?> 112 112 <div><?php echo htmlspecialchars($processing); ?></div> 113 113 <?php endforeach; else: ?> 114 <div> Nothing</div>114 <div><?php echo _('Nothing'); ?></div> 115 115 <?php endif; ?> 116 116 </div> … … 118 118 <div id="content"> 119 119 <div class="queuebox first"> 120 Queued: <?php echo $c->queueLength; ?> items totalling <?php echo $c->queueSize; ?>MB120 <?php printf(_('Queued: %s items totalling %sMB'), $c->queueLength, $c->queueSize); ?> 121 121 </div> 122 122 <?php if ($c->queueLength > 0): ?> … … 128 128 <div class="queuetitle"><?php echo htmlspecialchars($queue['nzbName']); ?></div> 129 129 <ul class="queuecontrols"> 130 <li class="handle"> Drag me</li><li class="control"><a href="index.php?info=<?php echo $i; ?>&KeepThis=true&TB_iframe=true&height=200&width=500" class="thickbox"><img src="images/information.png" alt="Info" /></a></li><li class="control"><a title="Cancel" href="<?php echo $self; ?>?action=1&id=<?php echo $queue['id']; ?>"><img src="images/delete.png" alt="Cancel" /></a></li><li class="control"><a title="Up" href="<?php echo $self; ?>?action=2&id=<?php echo $queue['id']; ?>"><img src="images/up.png" alt="Up" /></a></li><li class="control"><a title="Down" href="<?php echo $self; ?>?action=3&id=<?php echo $queue['id']; ?>"><img src="images/down.png" alt="Down" /></a></li><li class="control"><a title="Top" href="<?php echo $self; ?>?action=4&id=<?php echo $queue['id']; ?>"><img src="images/top.png" alt="Top" /></a></li><li class="control"><a title="Bottom" href="<?php echo $self; ?>?action=5&id=<?php echo $queue['id']; ?>"><img src="images/bottom.png" alt="Bottom" /></a></li><li class="control"><a title="Force" href="<?php echo $self; ?>?action=6&id=<?php echo $queue['id']; ?>"><img src="images/force.png" alt="Force" /></a></li>130 <li class="handle"><?php echo _('Drag me'); ?></li><li class="control"><a href="index.php?info=<?php echo $i; ?>&KeepThis=true&TB_iframe=true&height=200&width=500" class="thickbox"><img src="images/information.png" alt="Info" /></a></li><li class="control"><a title="Cancel" href="<?php echo $self; ?>?action=1&id=<?php echo $queue['id']; ?>"><img src="images/delete.png" alt="Cancel" /></a></li><li class="control"><a title="Up" href="<?php echo $self; ?>?action=2&id=<?php echo $queue['id']; ?>"><img src="images/up.png" alt="Up" /></a></li><li class="control"><a title="Down" href="<?php echo $self; ?>?action=3&id=<?php echo $queue['id']; ?>"><img src="images/down.png" alt="Down" /></a></li><li class="control"><a title="Top" href="<?php echo $self; ?>?action=4&id=<?php echo $queue['id']; ?>"><img src="images/top.png" alt="Top" /></a></li><li class="control"><a title="Bottom" href="<?php echo $self; ?>?action=5&id=<?php echo $queue['id']; ?>"><img src="images/bottom.png" alt="Bottom" /></a></li><li class="control"><a title="Force" href="<?php echo $self; ?>?action=6&id=<?php echo $queue['id']; ?>"><img src="images/force.png" alt="Force" /></a></li> 131 131 </ul> 132 <div class="queuestats"><?php echo $queue['total_mb']; ?>MB<?php echo ($c->transferRate > 0) ? ' ETA: ' . $c->formatTimeStamp($queue['eta']) : ''; ?></div>132 <div class="queuestats"><?php printf(_('%sMB'), $queue['total_mb']); if ($c->transferRate > 0): printf(_(' ETA: %s'), $c->formatTimeStamp($queue['eta'])); endif; ?></div> 133 133 </li> 134 134 <?php endforeach; ?> … … 137 137 <div id="controls"> 138 138 <span id="refresher"> 139 <input type="checkbox" name="refresh" id="refresh" onclick="if (this.checked) { createCookie('HHRefresh', 1, 30);startRefresher(); } else { createCookie('HHRefresh', 0, 30);stopRefresher(); }" /> <label for="refresh" class="refresher"> Refresh every 15 seconds</label>139 <input type="checkbox" name="refresh" id="refresh" onclick="if (this.checked) { createCookie('HHRefresh', 1, 30);startRefresher(); } else { createCookie('HHRefresh', 0, 30);stopRefresher(); }" /> <label for="refresh" class="refresher"><?php echo _('Refresh every 15 seconds'); ?></label> 140 140 </span> 141 141 <?php if ($c->queueLength > 0): ?> 142 <input type="submit" name="reorder" value=" Reorder Items" /> by <select name="sorttype" id="sorttype" onchange="showstatus(this);"><option value="1">Provided Order</option><option value="2">Name</option><option value="3">Size</option></select> <select name="sortdirection" id="sortdirection"><option value="1">Ascending</option><option value="2">Descending</option></select>142 <input type="submit" name="reorder" value="<?php echo _('Reorder Items'); ?>" /> <?php echo _('by'); ?> <select name="sorttype" id="sorttype" onchange="showstatus(this);"><option value="1"><?php echo _('Provided Order'); ?></option><option value="2"><?php echo _('Name'); ?></option><option value="3"><?php echo _('Size'); ?></option></select> <select name="sortdirection" id="sortdirection"><option value="1"><?php echo _('Ascending'); ?></option><option value="2"><?php echo _('Descending'); ?></option></select> 143 143 <?php endif; ?> 144 144 </div> … … 150 150 <div id="tabcontainer"> 151 151 <ul> 152 <li><a accesskey="1" href="#fragment-1"><span> Log entries</span></a></li>153 <?php if (isset($config['showfinished']) && $config['showfinished']): ?><li><a accesskey="2" href="#fragment-2"><span> Finished Items</span></a></li><?php endif; ?>154 <li><a accesskey="3" href="#fragment-3"><span> Bookmarklet</span></a></li>152 <li><a accesskey="1" href="#fragment-1"><span><?php echo _('Log Entries'); ?></span></a></li> 153 <?php if (isset($config['showfinished']) && $config['showfinished']): ?><li><a accesskey="2" href="#fragment-2"><span><?php echo _('Finished Items'); ?></span></a></li><?php endif; ?> 154 <li><a accesskey="3" href="#fragment-3"><span><?php echo _('Bookmarklet'); ?></span></a></li> 155 155 </ul> 156 156 <div id="fragment-1"> … … 162 162 <form action="<?php echo $self; ?>" method="post"> 163 163 <div id="finishedcontrols"> 164 <span id="finishedcount"> Finished items: <?php echo $finishedcount; ?></span>164 <span id="finishedcount"><?php printf(_('Finished items: %s'), $finishedcount); ?></span> 165 165 <?php if ($finishedcount > 0): ?> 166 <input type="submit" name="clearnzbs" value=" Clear Finished NZBs" />166 <input type="submit" name="clearnzbs" value="<?php echo _('Clear Finished NZBs'); ?>" /> 167 167 <?php endif; ?> 168 168 </div> … … 176 176 </div> 177 177 <ul class="queuecontrols"> 178 <li class="control"><a href="<?php echo $self; ?>?removefinished=<?php echo $i; ?>"> Remove</a></li>178 <li class="control"><a href="<?php echo $self; ?>?removefinished=<?php echo $i; ?>"><?php echo _('Remove'); ?></a></li> 179 179 </ul> 180 <div class="queuestats"> Finished on: <?php echo date('M dS - H:i:s', (int)$item->finishedTime); ?> Processing Time: <?php echo $item->elapsedTime; ?><?php if (trim($item->parMessage) != ""): ?> Par message: <?php echo $item->parMessage; endif; ?></div>180 <div class="queuestats"><?php printf(_('Finished on: %s Processing Time: %s'), date('M dS - H:i:s', (int)$item->finishedTime), $time->elapsedTime); if (trim($item->parMessage) != ''): printf(_(' Par message: %s'), $item->parMessage); endif; ?></div> 181 181 </li> 182 182 <?php endforeach; ?> … … 187 187 <?php endif; ?> 188 188 <div id="fragment-3"> 189 <h2> HellaWorld Bookmarklet</h2>190 <p class="bkmark"> Right click on this link and bookmark it, or drag it to your bookmarks/favorites to create a Newzbin shortcut. Clicking on this shortcut when on a Newzbin article will add the NZB to HellaNZB's queue.</p>191 <p class="bkmark"><a href="javascript:c=location.href;if(document.title.indexOf('Newzbin'+String.fromCharCode(32)+'-'+String.fromCharCode(32)+'Report')!=-1){location.href='<?php echo $protocol . '://' . htmlentities($_SERVER['HTTP_HOST']) . $self ?>?bookmarklet='+encodeURIComponent(c);}else{void(0);}"> Send to HellaWorld</a></p>189 <h2><?php echo _('HellaWorld Bookmarklet'); ?></h2> 190 <p class="bkmark"><?php echo _("Right click on this link and bookmark it, or drag it to your bookmarks/favorites to create a Newzbin shortcut. Clicking on this shortcut when on a Newzbin article will add the NZB to HellaNZB's queue."); ?></p> 191 <p class="bkmark"><a href="javascript:c=location.href;if(document.title.indexOf('Newzbin'+String.fromCharCode(32)+'-'+String.fromCharCode(32)+'Report')!=-1){location.href='<?php echo $protocol . '://' . htmlentities($_SERVER['HTTP_HOST']) . $self ?>?bookmarklet='+encodeURIComponent(c);}else{void(0);}"><?php echo _('Send to HellaWorld'); ?></a></p> 192 192 </div> 193 193 </div> -
trunk/templates/rarpass.php
r80 r133 42 42 <head> 43 43 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 44 <title> Set Rar Password</title>44 <title><?php echo _('Set Rar Password'); ?></title> 45 45 <link rel="stylesheet" type="text/css" href="style/rarpass.css" /> 46 46 </head> … … 49 49 <?php if (isset($submitted)): ?> 50 50 <div id="response"> 51 Rar password updated51 <?php echo _('Rar password updated'); ?> 52 52 </div> 53 53 <?php else: ?> … … 55 55 <p><?php echo htmlspecialchars($c->queue[$index]['nzbName']); ?></p> 56 56 <form action="index.php?id=<?php echo $c->queue[$index]['id']; ?>" method="post"> 57 <label for="password"> Password:<input type="password" name="password" id="password" /></label>58 <input type="submit" value=" Set Password" />57 <label for="password"><?php echo _('Password:'); ?> <input type="password" name="password" id="password" /></label> 58 <input type="submit" value="<?php echo _('Set Password'); ?>" /> 59 59 </form> 60 60 </div>
