git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 7db24c32 authored by Siebrand Mazeland's avatar Siebrand Mazeland

* fix some i18n and L10n issues

* update/add translator documentation
* remove superfluous whitespace
parent c0bb1a57
...@@ -331,8 +331,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction ...@@ -331,8 +331,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
if (Event::handle('StartAtomPubNewActivity', array(&$activity, $this->user, &$saved))) { if (Event::handle('StartAtomPubNewActivity', array(&$activity, $this->user, &$saved))) {
if ($activity->verb != ActivityVerb::POST) { if ($activity->verb != ActivityVerb::POST) {
// TRANS: Client error displayed when not using the POST verb. // TRANS: Client error displayed when not using the POST verb. Do not translate POST.
// TRANS: Do not translate POST.
$this->clientError(_('Can only handle POST activities.')); $this->clientError(_('Can only handle POST activities.'));
return; return;
} }
......
...@@ -244,8 +244,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction ...@@ -244,8 +244,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
if (Event::handle('StartAtomPubNewActivity', array(&$activity))) { if (Event::handle('StartAtomPubNewActivity', array(&$activity))) {
if ($activity->verb != ActivityVerb::FOLLOW) { if ($activity->verb != ActivityVerb::FOLLOW) {
// TRANS: Client error displayed when not using the POST verb. // TRANS: Client error displayed when not using the follow verb.
// TRANS: Do not translate POST.
$this->clientError(_('Can only handle Follow activities.')); $this->clientError(_('Can only handle Follow activities.'));
return; return;
} }
...@@ -264,13 +263,16 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction ...@@ -264,13 +263,16 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
if (empty($profile)) { if (empty($profile)) {
// TRANS: Client exception thrown when subscribing to a non-existing profile. // TRANS: Client exception thrown when subscribing to a non-existing profile.
// TRANS: %s is the unknown profile ID.
$this->clientError(sprintf(_('Unknown profile %s.'), $person->id)); $this->clientError(sprintf(_('Unknown profile %s.'), $person->id));
return; return;
} }
if (Subscription::exists($this->_profile, $profile)) { if (Subscription::exists($this->_profile, $profile)) {
// 409 Conflict // 409 Conflict
$this->clientError(sprintf(_('Already subscribed to %s'), // TRANS: Client error displayed trying to subscribe to an already subscribed profile.
// TRANS: %s is the profile the user already has a subscription on.
$this->clientError(sprintf(_('Already subscribed to %s.'),
$person->id), $person->id),
409); 409);
return; return;
......
...@@ -183,11 +183,12 @@ class NewgroupAction extends Action ...@@ -183,11 +183,12 @@ class NewgroupAction extends Action
foreach ($aliases as $alias) { foreach ($aliases as $alias) {
if (!Nickname::isValid($alias)) { if (!Nickname::isValid($alias)) {
// TRANS: Group create form validation error. // TRANS: Group create form validation error.
// TRANS: %s is the invalid alias.
$this->showForm(sprintf(_('Invalid alias: "%s"'), $alias)); $this->showForm(sprintf(_('Invalid alias: "%s"'), $alias));
return; return;
} }
if ($this->nicknameExists($alias)) { if ($this->nicknameExists($alias)) {
// TRANS: Group create form validation error. // TRANS: Group create form validation error. %s is the already used alias.
$this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'), $this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'),
$alias)); $alias));
return; return;
...@@ -195,7 +196,7 @@ class NewgroupAction extends Action ...@@ -195,7 +196,7 @@ class NewgroupAction extends Action
// XXX assumes alphanum nicknames // XXX assumes alphanum nicknames
if (strcmp($alias, $nickname) == 0) { if (strcmp($alias, $nickname) == 0) {
// TRANS: Group create form validation error. // TRANS: Group create form validation error.
$this->showForm(_('Alias can\'t be the same as nickname.')); $this->showForm(_('Alias cannot be the same as nickname.'));
return; return;
} }
} }
......
...@@ -167,15 +167,14 @@ class SubscriptionsAction extends GalleryAction ...@@ -167,15 +167,14 @@ class SubscriptionsAction extends GalleryAction
* *
* @return array of Feed objects * @return array of Feed objects
*/ */
function getFeeds() function getFeeds()
{ {
return array(new Feed(Feed::ATOM, return array(new Feed(Feed::ATOM,
common_local_url('AtomPubSubscriptionFeed', common_local_url('AtomPubSubscriptionFeed',
array('subscriber' => $this->profile->id)), array('subscriber' => $this->profile->id)),
// TRANS: Atom feed title. %s is a profile nickname.
sprintf(_('Subscription feed for %s (Atom)'), sprintf(_('Subscription feed for %s (Atom)'),
$this->profile->nickname))); $this->profile->nickname)));
} }
} }
...@@ -261,5 +260,4 @@ class SubscriptionsListItem extends SubscriptionListItem ...@@ -261,5 +260,4 @@ class SubscriptionsListItem extends SubscriptionListItem
$this->out->elementEnd('form'); $this->out->elementEnd('form');
return; return;
} }
} }
...@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { ...@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class AccountMover extends QueueHandler class AccountMover extends QueueHandler
{ {
function transport() function transport()
...@@ -61,7 +60,9 @@ class AccountMover extends QueueHandler ...@@ -61,7 +60,9 @@ class AccountMover extends QueueHandler
$oprofile = Ostatus_profile::ensureProfileURI($remote); $oprofile = Ostatus_profile::ensureProfileURI($remote);
if (empty($oprofile)) { if (empty($oprofile)) {
throw new Exception("Can't locate account {$remote}"); // TRANS: Exception thrown when an account could not be located when it should be moved.
// TRANS: %s is the remote site.
throw new Exception(sprintf(_("Cannot locate account %s."),$remote));
} }
list($svcDocUrl, $username) = self::getServiceDocument($remote); list($svcDocUrl, $username) = self::getServiceDocument($remote);
...@@ -100,7 +101,9 @@ class AccountMover extends QueueHandler ...@@ -100,7 +101,9 @@ class AccountMover extends QueueHandler
$xrd = $discovery->lookup($remote); $xrd = $discovery->lookup($remote);
if (empty($xrd)) { if (empty($xrd)) {
throw new Exception("Can't find XRD for $remote"); // TRANS: Exception thrown when a service document could not be located account move.
// TRANS: %s is the remote site.
throw new Exception(sprintf(_("Cannot find XRD for %s."),$remote));
} }
$svcDocUrl = null; $svcDocUrl = null;
...@@ -123,7 +126,9 @@ class AccountMover extends QueueHandler ...@@ -123,7 +126,9 @@ class AccountMover extends QueueHandler
} }
if (empty($svcDocUrl)) { if (empty($svcDocUrl)) {
throw new Exception("No AtomPub API service for $remote."); // TRANS: Exception thrown when an account could not be located when it should be moved.
// TRANS: %s is the remote site.
throw new Exception(sprintf(_("No AtomPub API service for %s."),$remote));
} }
return array($svcDocUrl, $username); return array($svcDocUrl, $username);
...@@ -139,7 +144,6 @@ class AccountMover extends QueueHandler ...@@ -139,7 +144,6 @@ class AccountMover extends QueueHandler
* *
* @return void * @return void
*/ */
protected function log($level, $message) protected function log($level, $message)
{ {
common_log($level, "AccountMover: " . $message); common_log($level, "AccountMover: " . $message);
......
...@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { ...@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ActivityMover extends QueueHandler class ActivityMover extends QueueHandler
{ {
function transport() function transport()
...@@ -82,7 +81,7 @@ class ActivityMover extends QueueHandler ...@@ -82,7 +81,7 @@ class ActivityMover extends QueueHandler
function moveActivity($act, $sink, $user, $remote) function moveActivity($act, $sink, $user, $remote)
{ {
if (empty($user)) { if (empty($user)) {
throw new Exception("No such user {$act->actor->id}"); throw new Exception(sprintf(_("No such user %s."),$act->actor->id));
} }
switch ($act->verb) { switch ($act->verb) {
...@@ -160,7 +159,6 @@ class ActivityMover extends QueueHandler ...@@ -160,7 +159,6 @@ class ActivityMover extends QueueHandler
* *
* @return void * @return void
*/ */
protected function log($level, $message) protected function log($level, $message)
{ {
common_log($level, "ActivityMover: " . $message); common_log($level, "ActivityMover: " . $message);
......
...@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { ...@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ActivitySink class ActivitySink
{ {
protected $svcDocUrl = null; protected $svcDocUrl = null;
...@@ -104,6 +103,7 @@ class ActivitySink ...@@ -104,6 +103,7 @@ class ActivitySink
break; break;
} }
} }
if (!$takesEntries) { if (!$takesEntries) {
continue; continue;
} }
...@@ -158,12 +158,18 @@ class ActivitySink ...@@ -158,12 +158,18 @@ class ActivitySink
if ($status >= 200 && $status < 300) { if ($status >= 200 && $status < 300) {
return true; return true;
} else if ($status >= 400 && $status < 500) { } else if ($status >= 400 && $status < 500) {
throw new ClientException("{$url} {$status} {$reason}"); // TRANS: Client exception thrown when post to collection fails with a 400 status.
// TRANS: %1$s is a URL, %2$s is the status, %s$s is the fail reason.
throw new ClientException(sprintf(_m('URLSTATUSREASON','%1$s %2$s %3$s'), $url, $status, $reason));
} else if ($status >= 500 && $status < 600) { } else if ($status >= 500 && $status < 600) {
throw new ServerException("{$url} {$status} {$reason}"); // TRANS: Server exception thrown when post to collection fails with a 500 status.
// TRANS: %1$s is a URL, %2$s is the status, %s$s is the fail reason.
throw new ServerException(sprintf(_m('URLSTATUSREASON','%1$s %2$s %3$s'), $url, $status, $reason));
} else { } else {
// That's unexpected. // That's unexpected.
throw new Exception("{$url} {$status} {$reason}"); // TRANS: Exception thrown when post to collection fails with a status that is not handled.
// TRANS: %1$s is a URL, %2$s is the status, %s$s is the fail reason.
throw new Exception(sprintf(_m('URLSTATUSREASON','%1$s %2$s %3$s'), $url, $status, $reason));
} }
} }
} }
...@@ -45,7 +45,6 @@ if (!defined('STATUSNET')) { ...@@ -45,7 +45,6 @@ if (!defined('STATUSNET')) {
* *
* @see http://groups.google.com/group/webfinger/browse_thread/thread/9f3d93a479e91bbf * @see http://groups.google.com/group/webfinger/browse_thread/thread/9f3d93a479e91bbf
*/ */
class Discovery class Discovery
{ {
const LRDD_REL = 'lrdd'; const LRDD_REL = 'lrdd';
...@@ -77,7 +76,6 @@ class Discovery ...@@ -77,7 +76,6 @@ class Discovery
* *
* @return void * @return void
*/ */
public function registerMethod($class) public function registerMethod($class)
{ {
$this->methods[] = $class; $this->methods[] = $class;
...@@ -91,7 +89,6 @@ class Discovery ...@@ -91,7 +89,6 @@ class Discovery
* *
* @return string normalized acct: or http(s)?: URI * @return string normalized acct: or http(s)?: URI
*/ */
public static function normalize($user_id) public static function normalize($user_id)
{ {
if (substr($user_id, 0, 5) == 'http:' || if (substr($user_id, 0, 5) == 'http:' ||
...@@ -116,7 +113,6 @@ class Discovery ...@@ -116,7 +113,6 @@ class Discovery
* *
* @return boolean true if $user_id is a Webfinger, else false * @return boolean true if $user_id is a Webfinger, else false
*/ */
public static function isWebfinger($user_id) public static function isWebfinger($user_id)
{ {
$uri = Discovery::normalize($user_id); $uri = Discovery::normalize($user_id);
...@@ -131,7 +127,6 @@ class Discovery ...@@ -131,7 +127,6 @@ class Discovery
* *
* @return XRD XRD object for the user * @return XRD XRD object for the user
*/ */
public function lookup($id) public function lookup($id)
{ {
// Normalize the incoming $id to make sure we have a uri // Normalize the incoming $id to make sure we have a uri
...@@ -154,7 +149,7 @@ class Discovery ...@@ -154,7 +149,7 @@ class Discovery
} }
} }
// TRANS: Exception. // TRANS: Exception. %s is an ID.
throw new Exception(sprintf(_('Unable to find services for %s.'), $id)); throw new Exception(sprintf(_('Unable to find services for %s.'), $id));
} }
...@@ -166,7 +161,6 @@ class Discovery ...@@ -166,7 +161,6 @@ class Discovery
* *
* @return array $link assoc array representing the link * @return array $link assoc array representing the link
*/ */
public static function getService($links, $service) public static function getService($links, $service)
{ {
if (!is_array($links)) { if (!is_array($links)) {
...@@ -190,7 +184,6 @@ class Discovery ...@@ -190,7 +184,6 @@ class Discovery
* *
* @return string replaced values * @return string replaced values
*/ */
public static function applyTemplate($template, $id) public static function applyTemplate($template, $id)
{ {
$template = str_replace('{uri}', urlencode($id), $template); $template = str_replace('{uri}', urlencode($id), $template);
...@@ -205,7 +198,6 @@ class Discovery ...@@ -205,7 +198,6 @@ class Discovery
* *
* @return XRD object representing the XRD file * @return XRD object representing the XRD file
*/ */
public static function fetchXrd($url) public static function fetchXrd($url)
{ {
try { try {
...@@ -236,7 +228,6 @@ class Discovery ...@@ -236,7 +228,6 @@ class Discovery
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
interface Discovery_LRDD interface Discovery_LRDD
{ {
/** /**
...@@ -246,7 +237,6 @@ interface Discovery_LRDD ...@@ -246,7 +237,6 @@ interface Discovery_LRDD
* *
* @return array Links in the XRD file * @return array Links in the XRD file
*/ */
public function discover($uri); public function discover($uri);
} }
...@@ -263,7 +253,6 @@ interface Discovery_LRDD ...@@ -263,7 +253,6 @@ interface Discovery_LRDD
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class Discovery_LRDD_Host_Meta implements Discovery_LRDD class Discovery_LRDD_Host_Meta implements Discovery_LRDD
{ {
/** /**
...@@ -276,7 +265,6 @@ class Discovery_LRDD_Host_Meta implements Discovery_LRDD ...@@ -276,7 +265,6 @@ class Discovery_LRDD_Host_Meta implements Discovery_LRDD
* *
* @return array Links in the XRD file * @return array Links in the XRD file
*/ */
public function discover($uri) public function discover($uri)
{ {
if (Discovery::isWebfinger($uri)) { if (Discovery::isWebfinger($uri)) {
...@@ -313,7 +301,6 @@ class Discovery_LRDD_Host_Meta implements Discovery_LRDD ...@@ -313,7 +301,6 @@ class Discovery_LRDD_Host_Meta implements Discovery_LRDD
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class Discovery_LRDD_Link_Header implements Discovery_LRDD class Discovery_LRDD_Link_Header implements Discovery_LRDD
{ {
/** /**
...@@ -327,7 +314,6 @@ class Discovery_LRDD_Link_Header implements Discovery_LRDD ...@@ -327,7 +314,6 @@ class Discovery_LRDD_Link_Header implements Discovery_LRDD
* *
* @todo fail out of Webfinger URIs faster * @todo fail out of Webfinger URIs faster
*/ */
public function discover($uri) public function discover($uri)
{ {
try { try {
...@@ -356,7 +342,6 @@ class Discovery_LRDD_Link_Header implements Discovery_LRDD ...@@ -356,7 +342,6 @@ class Discovery_LRDD_Link_Header implements Discovery_LRDD
* *
* @return array Link header in XRD-like format * @return array Link header in XRD-like format
*/ */
protected static function parseHeader($header) protected static function parseHeader($header)
{ {
$lh = new LinkHeader($header); $lh = new LinkHeader($header);
...@@ -380,7 +365,6 @@ class Discovery_LRDD_Link_Header implements Discovery_LRDD ...@@ -380,7 +365,6 @@ class Discovery_LRDD_Link_Header implements Discovery_LRDD
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class Discovery_LRDD_Link_HTML implements Discovery_LRDD class Discovery_LRDD_Link_HTML implements Discovery_LRDD
{ {
/** /**
...@@ -395,7 +379,6 @@ class Discovery_LRDD_Link_HTML implements Discovery_LRDD ...@@ -395,7 +379,6 @@ class Discovery_LRDD_Link_HTML implements Discovery_LRDD
* *
* @todo fail out of Webfinger URIs faster * @todo fail out of Webfinger URIs faster
*/ */
public function discover($uri) public function discover($uri)
{ {
try { try {
...@@ -421,7 +404,6 @@ class Discovery_LRDD_Link_HTML implements Discovery_LRDD ...@@ -421,7 +404,6 @@ class Discovery_LRDD_Link_HTML implements Discovery_LRDD
* *
* @return array array of associative arrays in XRD-ish format * @return array array of associative arrays in XRD-ish format
*/ */
public function parse($html) public function parse($html)
{ {
$links = array(); $links = array();
......
...@@ -69,6 +69,7 @@ class ImageFile ...@@ -69,6 +69,7 @@ class ImageFile
($info[2] == IMAGETYPE_XBM && function_exists('imagecreatefromxbm')) || ($info[2] == IMAGETYPE_XBM && function_exists('imagecreatefromxbm')) ||
($info[2] == IMAGETYPE_PNG && function_exists('imagecreatefrompng')))) { ($info[2] == IMAGETYPE_PNG && function_exists('imagecreatefrompng')))) {
// TRANS: Exception thrown when trying to upload an unsupported image file format.
throw new Exception(_('Unsupported image file format.')); throw new Exception(_('Unsupported image file format.'));
return; return;
} }
...@@ -92,6 +93,7 @@ class ImageFile ...@@ -92,6 +93,7 @@ class ImageFile
return; return;
case UPLOAD_ERR_PARTIAL: case UPLOAD_ERR_PARTIAL:
@unlink($_FILES[$param]['tmp_name']); @unlink($_FILES[$param]['tmp_name']);
// TRANS: Exception thrown when uploading an image and that action could not be completed.
throw new Exception(_('Partial upload.')); throw new Exception(_('Partial upload.'));
return; return;
case UPLOAD_ERR_NO_FILE: case UPLOAD_ERR_NO_FILE:
...@@ -100,6 +102,7 @@ class ImageFile ...@@ -100,6 +102,7 @@ class ImageFile
default: default:
common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " . common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " .
$_FILES[$param]['error']); $_FILES[$param]['error']);
// TRANS: Exception thrown when uploading an image fails for an unknown reason.
throw new Exception(_('System error uploading file.')); throw new Exception(_('System error uploading file.'));
return; return;
} }
...@@ -108,6 +111,7 @@ class ImageFile ...@@ -108,6 +111,7 @@ class ImageFile
if (!$info) { if (!$info) {
@unlink($_FILES[$param]['tmp_name']); @unlink($_FILES[$param]['tmp_name']);
// TRANS: Exception thrown when uploading a file as image that is not an image or is a corrupt file.
throw new Exception(_('Not an image or corrupt file.')); throw new Exception(_('Not an image or corrupt file.'));
return; return;
} }
...@@ -170,6 +174,7 @@ class ImageFile ...@@ -170,6 +174,7 @@ class ImageFile
$targetType = $this->preferredType(); $targetType = $this->preferredType();
if (!file_exists($this->filepath)) { if (!file_exists($this->filepath)) {
// TRANS: Exception thrown during resize when image has been registered as present, but is no longer there.
throw new Exception(_('Lost our file.')); throw new Exception(_('Lost our file.'));
return; return;
} }
...@@ -207,6 +212,7 @@ class ImageFile ...@@ -207,6 +212,7 @@ class ImageFile
$image_src = imagecreatefromxbm($this->filepath); $image_src = imagecreatefromxbm($this->filepath);
break; break;
default: default:
// TRANS: Exception thrown when trying to resize an unknown file type.
throw new Exception(_('Unknown file type')); throw new Exception(_('Unknown file type'));
return; return;
} }
...@@ -247,6 +253,7 @@ class ImageFile ...@@ -247,6 +253,7 @@ class ImageFile
imagepng($image_dest, $outpath); imagepng($image_dest, $outpath);
break; break;
default: default:
// TRANS: Exception thrown when trying resize an unknown file type.
throw new Exception(_('Unknown file type')); throw new Exception(_('Unknown file type'));
return; return;
} }
......
...@@ -47,7 +47,6 @@ if (!defined('STATUSNET')) { ...@@ -47,7 +47,6 @@ if (!defined('STATUSNET')) {
* *
* @see Discovery * @see Discovery
*/ */
class LinkHeader class LinkHeader
{ {
var $href; var $href;
...@@ -61,7 +60,6 @@ class LinkHeader ...@@ -61,7 +60,6 @@ class LinkHeader
* *
* @return LinkHeader self * @return LinkHeader self
*/ */
function __construct($str) function __construct($str)
{ {
preg_match('/^<[^>]+>/', $str, $uri_reference); preg_match('/^<[^>]+>/', $str, $uri_reference);
...@@ -108,7 +106,6 @@ class LinkHeader ...@@ -108,7 +106,6 @@ class LinkHeader
* *
* @return LinkHeader discovered header, or null on failure * @return LinkHeader discovered header, or null on failure
*/ */
static function getLink($response, $rel=null, $type=null) static function getLink($response, $rel=null, $type=null)
{ {
$headers = $response->getHeader('Link'); $headers = $response->getHeader('Link');
......
...@@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/widget.php'; ...@@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/widget.php';
* *
* @see Widget * @see Widget
*/ */
class LoginGroupNav extends Widget class LoginGroupNav extends Widget
{ {
var $action = null; var $action = null;
...@@ -54,7 +53,6 @@ class LoginGroupNav extends Widget ...@@ -54,7 +53,6 @@ class LoginGroupNav extends Widget
* *
* @param Action $action current action, used for output * @param Action $action current action, used for output
*/ */
function __construct($action=null) function __construct($action=null)
{ {
parent::__construct($action); parent::__construct($action);
...@@ -66,7 +64,6 @@ class LoginGroupNav extends Widget ...@@ -66,7 +64,6 @@ class LoginGroupNav extends Widget
* *
* @return void * @return void
*/ */
function show() function show()
{ {
$action_name = $this->action->trimmed('action'); $action_name = $this->action->trimmed('action');
...@@ -76,13 +73,17 @@ class LoginGroupNav extends Widget ...@@ -76,13 +73,17 @@ class LoginGroupNav extends Widget
if (Event::handle('StartLoginGroupNav', array($this->action))) { if (Event::handle('StartLoginGroupNav', array($this->action))) {
$this->action->menuItem(common_local_url('login'), $this->action->menuItem(common_local_url('login'),
_('Login'), // TRANS: Menu item for logging in to the StatusNet site.
_m('MENU','Login'),
// TRANS: Title for menu item for logging in to the StatusNet site.
_('Login with a username and password'), _('Login with a username and password'),
$action_name === 'login'); $action_name === 'login');
if (!(common_config('site','closed') || common_config('site','inviteonly'))) { if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
$this->action->menuItem(common_local_url('register'), $this->action->menuItem(common_local_url('register'),
_('Register'), // TRANS: Menu item for registering with the StatusNet site.
_m('MENU','Register'),
// TRANS: Title for menu item for registering with the StatusNet site.
_('Sign up for a new account'), _('Sign up for a new account'),
$action_name === 'register'); $action_name === 'register');
} }
......
...@@ -44,7 +44,6 @@ require_once 'Mail.php'; ...@@ -44,7 +44,6 @@ require_once 'Mail.php';
* *
* @return Mail backend * @return Mail backend
*/ */
function mail_backend() function mail_backend()
{ {
static $backend = null; static $backend = null;
...@@ -70,7 +69,6 @@ function mail_backend() ...@@ -70,7 +69,6 @@ function mail_backend()
* *
* @return boolean success flag * @return boolean success flag
*/ */
function mail_send($recipients, $headers, $body) function mail_send($recipients, $headers, $body)
{ {
// XXX: use Mail_Queue... maybe // XXX: use Mail_Queue... maybe
...@@ -94,7 +92,6 @@ function mail_send($recipients, $headers, $body) ...@@ -94,7 +92,6 @@ function mail_send($recipients, $headers, $body)
* *
* @return string mail domain, suitable for making email addresses. * @return string mail domain, suitable for making email addresses.
*/ */
function mail_domain() function mail_domain()
{ {
$maildomain = common_config('mail', 'domain');