summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-10-20 17:28:28 -0700
committerZach Copley <zach@status.net>2010-10-20 17:28:28 -0700
commitbfdb8385ecc745002b8c45510caf2fdf7c2d2c9f (patch)
tree392196b097fafb10430bb7db763fd744a0639bf3 /lib
parente56385a7bb25336a72c1d37ad43d51ba8e238231 (diff)
parent31f52ec37c5a2be76c197a9c492d3a236af045cd (diff)
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts: actions/apioauthauthorize.php lib/apioauthstore.php
Diffstat (limited to 'lib')
-rw-r--r--lib/action.php9
-rw-r--r--lib/apiauth.php5
-rw-r--r--lib/apioauthstore.php7
-rw-r--r--lib/applicationlist.php11
-rw-r--r--lib/mail.php2
-rw-r--r--lib/router.php20
-rw-r--r--lib/util.php3
7 files changed, 22 insertions, 35 deletions
diff --git a/lib/action.php b/lib/action.php
index 55ee83bde..3d7d1d808 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -419,8 +419,9 @@ class Action extends HTMLOutputter // lawsuit
'class' => 'vcard'));
if (Event::handle('StartAddressData', array($this))) {
if (common_config('singleuser', 'enabled')) {
+ $user = User::singleUser();
$url = common_local_url('showstream',
- array('nickname' => common_config('singleuser', 'nickname')));
+ array('nickname' => $user->nickname));
} else {
$url = common_local_url('public');
}
@@ -526,20 +527,20 @@ class Action extends HTMLOutputter // lawsuit
}
// TRANS: Tooltip for main menu option "Login"
$tooltip = _m('TOOLTIP', 'Login to the site');
- // TRANS: Main menu option when not logged in to log in
$this->menuItem(common_local_url('login'),
+ // TRANS: Main menu option when not logged in to log in
_m('MENU', 'Login'), $tooltip, false, 'nav_login');
}
// TRANS: Tooltip for main menu option "Help"
$tooltip = _m('TOOLTIP', 'Help me!');
- // TRANS: Main menu option for help on the StatusNet site
$this->menuItem(common_local_url('doc', array('title' => 'help')),
+ // TRANS: Main menu option for help on the StatusNet site
_m('MENU', 'Help'), $tooltip, false, 'nav_help');
if ($user || !common_config('site', 'private')) {
// TRANS: Tooltip for main menu option "Search"
$tooltip = _m('TOOLTIP', 'Search for people or text');
- // TRANS: Main menu option when logged in or when the StatusNet instance is not private
$this->menuItem(common_local_url('peoplesearch'),
+ // TRANS: Main menu option when logged in or when the StatusNet instance is not private
_m('MENU', 'Search'), $tooltip, false, 'nav_search');
}
Event::handle('EndPrimaryNav', array($this));
diff --git a/lib/apiauth.php b/lib/apiauth.php
index 0ebd7aa10..1dacf1409 100644
--- a/lib/apiauth.php
+++ b/lib/apiauth.php
@@ -263,7 +263,7 @@ class ApiAuthAction extends ApiAction
// show error if the user clicks 'cancel'
// TRANS: Client error thrown when authentication fails becaus a user clicked "Cancel".
- $this->clientError(_("Could not authenticate you."), 401, $this->format);
+ $this->clientError(_('Could not authenticate you.'), 401, $this->format);
exit;
} else {
@@ -290,7 +290,7 @@ class ApiAuthAction extends ApiAction
);
$this->logAuthFailure($msg);
// TRANS: Client error thrown when authentication fails.
- $this->clientError(_("Could not authenticate you."), 401, $this->format);
+ $this->clientError(_('Could not authenticate you.'), 401, $this->format);
exit;
}
}
@@ -342,7 +342,6 @@ class ApiAuthAction extends ApiAction
*
* @param string $logMsg additional log message
*/
-
function logAuthFailure($logMsg)
{
list($proxy, $ip) = common_client_ip();
diff --git a/lib/apioauthstore.php b/lib/apioauthstore.php
index 9a2608263..6b9b97756 100644
--- a/lib/apioauthstore.php
+++ b/lib/apioauthstore.php
@@ -41,7 +41,8 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
$result = $con->insert();
if (!$result) {
- $this->serverError(_("Could not create anonymous consumer."));
+ // TRANS: Server error displayed when trying to create an anynymous OAuth consumer.
+ $this->serverError(_('Could not create anonymous consumer.'));
}
$app = Oauth_application::getByConsumerKey('anonymous');
@@ -65,6 +66,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
$id = $app->insert();
if (!$id) {
+ // TRANS: Server error displayed when trying to create an anynymous OAuth application.
$this->serverError(_("Could not create anonymous OAuth application."));
}
}
@@ -296,7 +298,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
*
* @return OAuthToken $token a new unauthorized OAuth request token
*/
-
function new_request_token($consumer, $callback)
{
$t = new Token();
@@ -321,6 +322,4 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
return new OAuthToken($t->tok, $t->secret);
}
}
-
-
}
diff --git a/lib/applicationlist.php b/lib/applicationlist.php
index 6801fb6cf..3f50f110b 100644
--- a/lib/applicationlist.php
+++ b/lib/applicationlist.php
@@ -142,10 +142,8 @@ class ApplicationList extends Widget
{
return;
}
-
}
-
/**
* Widget to show a list of connected OAuth clients
*
@@ -245,7 +243,7 @@ class ConnectedAppsList extends Widget
$this->out->elementEnd('span');
if ($app->name != 'anonymous') {
-
+ // @todo FIXME: i18n trouble.
$this->out->raw(_(' by '));
$this->out->element(
@@ -279,7 +277,9 @@ class ConnectedAppsList extends Widget
$this->out->element(
'p', array(
'class' => 'access_token'),
- _('Access token starting with: ') . substr($this->connection->token, 0, 7)
+ // TRANS: Access token in the application list.
+ // TRANS: %s are the first 7 characters of the access token.
+ sprintf(_('Access token starting with: %s'), substr($this->connection->token, 0, 7))
);
$this->out->elementStart(
@@ -295,11 +295,10 @@ class ConnectedAppsList extends Widget
$this->out->hidden('oauth_token', $this->connection->token);
$this->out->hidden('token', common_session_token());
// TRANS: Button label
- $this->out->submit('revoke', _('Revoke'));
+ $this->out->submit('revoke', _m('BUTTON','Revoke'));
$this->out->elementEnd('fieldset');
$this->out->elementEnd('form');
$this->out->elementEnd('li');
-
}
}
diff --git a/lib/mail.php b/lib/mail.php
index 3703e5c35..30d743848 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -600,7 +600,7 @@ function mail_notify_fave($other, $user, $notice)
// TRANS: Subject for favorite notification e-mail.
// TRANS: %1$s is the adding user's long name, %2$s is the adding user's nickname.
- $subject = sprintf(_('%1s$ (@%2$s) added your notice as a favorite'), $bestname, $user->nickname);
+ $subject = sprintf(_('%1$s (@%2$s) added your notice as a favorite'), $bestname, $user->nickname);
// TRANS: Body for favorite notification e-mail.
// TRANS: %1$s is the adding user's long name, $2$s is the date the notice was created,
diff --git a/lib/router.php b/lib/router.php
index b1cc8d529..417206e6b 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -34,7 +34,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
require_once 'Net/URL/Mapper.php';
class StatusNet_URL_Mapper extends Net_URL_Mapper {
-
private static $_singleton = null;
private function __construct()
@@ -71,7 +70,6 @@ class StatusNet_URL_Mapper extends Net_URL_Mapper {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class Router
{
var $m = null;
@@ -692,7 +690,6 @@ class Router
$m->connect('admin/snapshot', array('action' => 'snapshotadminpanel'));
$m->connect('admin/license', array('action' => 'licenseadminpanel'));
-
$m->connect('getfile/:filename',
array('action' => 'getfile'),
array('filename' => '[A-Za-z0-9._-]+'));
@@ -701,16 +698,8 @@ class Router
if (common_config('singleuser', 'enabled')) {
- $user = User::siteOwner();
-
- if (!empty($user)) {
- $nickname = $user->nickname;
- } else {
- $nickname = common_config('singleuser', 'nickname');
- if (empty($nickname)) {
- throw new ServerException(_("No single user defined for single-user mode."));
- }
- }
+ $user = User::singleUser();
+ $nickname = $user->nickname;
foreach (array('subscriptions', 'subscribers',
'all', 'foaf', 'xrds',
@@ -765,9 +754,7 @@ class Router
$m->connect('',
array('action' => 'showstream',
'nickname' => $nickname));
-
} else {
-
$m->connect('', array('action' => 'public'));
$m->connect('rss', array('action' => 'publicrss'));
$m->connect('featuredrss', array('action' => 'featuredrss'));
@@ -848,7 +835,8 @@ class Router
} catch (Net_URL_Mapper_InvalidException $e) {
common_log(LOG_ERR, "Problem getting route for $path - " .
$e->getMessage());
- $cac = new ClientErrorAction("Page not found.", 404);
+ // TRANS: Client error on action trying to visit a non-existing page.
+ $cac = new ClientErrorAction(_('Page not found.'), 404);
$cac->showPage();
}
diff --git a/lib/util.php b/lib/util.php
index 5a94182bd..86380af28 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -974,8 +974,9 @@ function common_tag_link($tag)
$canonical = common_canonical_tag($tag);
if (common_config('singleuser', 'enabled')) {
// regular TagAction isn't set up in 1user mode
+ $user = User::singleUser();
$url = common_local_url('showstream',
- array('nickname' => common_config('singleuser', 'nickname'),
+ array('nickname' => $user->nickname,
'tag' => $canonical));
} else {
$url = common_local_url('tag', array('tag' => $canonical));