Translator comments added

L10n updates
Remove superfluous whitespace
Number parameters in message when two or more are used
ClientException and ServerException should end with a period
This commit is contained in:
Siebrand Mazeland 2011-01-20 20:00:45 +01:00
parent 6658bd1893
commit 91ee2ea3b1
18 changed files with 142 additions and 184 deletions

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
* @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 AtompubfavoritefeedAction extends ApiAuthAction class AtompubfavoritefeedAction extends ApiAuthAction
{ {
private $_profile = null; private $_profile = null;
@ -59,7 +58,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction
* *
* @return boolean true * @return boolean true
*/ */
function prepare($argarray) function prepare($argarray)
{ {
parent::prepare($argarray); parent::prepare($argarray);
@ -67,7 +65,8 @@ class AtompubfavoritefeedAction extends ApiAuthAction
$this->_profile = Profile::staticGet('id', $this->trimmed('profile')); $this->_profile = Profile::staticGet('id', $this->trimmed('profile'));
if (empty($this->_profile)) { if (empty($this->_profile)) {
throw new ClientException(_('No such profile'), 404); // TRANS: Client exception thrown when requesting a favorite feed for a non-existing profile.
throw new ClientException(_('No such profile.'), 404);
} }
$offset = ($this->page-1) * $this->count; $offset = ($this->page-1) * $this->count;
@ -87,7 +86,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function handle($argarray=null) function handle($argarray=null)
{ {
parent::handle($argarray); parent::handle($argarray);
@ -101,6 +99,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
$this->addFavorite(); $this->addFavorite();
break; break;
default: default:
// TRANS: Client exception thrown when using an unsupported HTTP method.
throw new ClientException(_('HTTP method not supported.'), 405); throw new ClientException(_('HTTP method not supported.'), 405);
return; return;
} }
@ -113,7 +112,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function showFeed() function showFeed()
{ {
header('Content-Type: application/atom+xml; charset=utf-8'); header('Content-Type: application/atom+xml; charset=utf-8');
@ -139,10 +137,14 @@ class AtompubfavoritefeedAction extends ApiAuthAction
$feed->addAuthor($this->_profile->getBestName(), $feed->addAuthor($this->_profile->getBestName(),
$this->_profile->getURI()); $this->_profile->getURI());
// TRANS: Title for Atom favorites feed.
// TRANS: %s is a user nickname.
$feed->setTitle(sprintf(_("%s favorites"), $feed->setTitle(sprintf(_("%s favorites"),
$this->_profile->getBestName())); $this->_profile->getBestName()));
$feed->setSubtitle(sprintf(_("Notices %s has favorited to on %s"), // TRANS: Subtitle for Atom favorites feed.
// TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename.
$feed->setSubtitle(sprintf(_("Notices %1$s has favorited on %2$s"),
$this->_profile->getBestName(), $this->_profile->getBestName(),
common_config('site', 'name'))); common_config('site', 'name')));
@ -205,15 +207,15 @@ class AtompubfavoritefeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function addFavorite() function addFavorite()
{ {
// XXX: Refactor this; all the same for atompub // XXX: Refactor this; all the same for atompub
if (empty($this->auth_user) || if (empty($this->auth_user) ||
$this->auth_user->id != $this->_profile->id) { $this->auth_user->id != $this->_profile->id) {
throw new ClientException(_("Can't add someone else's". // TRANS: Client exception thrown when trying to set a favorite for another user.
" subscription"), 403); throw new ClientException(_("Cannot add someone else's".
" subscription."), 403);
} }
$xml = file_get_contents('php://input'); $xml = file_get_contents('php://input');
@ -234,9 +236,8 @@ class AtompubfavoritefeedAction extends ApiAuthAction
if (Event::handle('StartAtomPubNewActivity', array(&$activity))) { if (Event::handle('StartAtomPubNewActivity', array(&$activity))) {
if ($activity->verb != ActivityVerb::FAVORITE) { if ($activity->verb != ActivityVerb::FAVORITE) {
// TRANS: Client error displayed when not using the POST verb. // TRANS: Client exception thrown when trying use an incorrect activity verb for the Atom pub method.
// TRANS: Do not translate POST. throw new ClientException(_('Can only handle favorite activities.'));
throw new ClientException(_('Can only handle Favorite activities.'));
return; return;
} }
@ -245,6 +246,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
if (!in_array($note->type, array(ActivityObject::NOTE, if (!in_array($note->type, array(ActivityObject::NOTE,
ActivityObject::BLOGENTRY, ActivityObject::BLOGENTRY,
ActivityObject::STATUS))) { ActivityObject::STATUS))) {
// TRANS: Client exception thrown when trying favorite an object that is not a notice.
throw new ClientException(_('Can only fave notices.')); throw new ClientException(_('Can only fave notices.'));
return; return;
} }
@ -253,6 +255,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
if (empty($notice)) { if (empty($notice)) {
// XXX: import from listed URL or something // XXX: import from listed URL or something
// TRANS: Client exception thrown when trying favorite a notice without content.
throw new ClientException(_('Unknown note.')); throw new ClientException(_('Unknown note.'));
} }
@ -260,6 +263,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
'notice_id' => $notice->id)); 'notice_id' => $notice->id));
if (!empty($old)) { if (!empty($old)) {
// TRANS: Client exception thrown when trying favorite an already favorited notice.
throw new ClientException(_('Already a favorite.')); throw new ClientException(_('Already a favorite.'));
} }
@ -296,7 +300,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
@ -328,7 +331,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction
* *
* @return string etag http header * @return string etag http header
*/ */
function etag() function etag()
{ {
return null; return null;
@ -339,7 +341,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction
* *
* @return boolean true if delete, else false * @return boolean true if delete, else false
*/ */
function requiresAuth() function requiresAuth()
{ {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
@ -359,7 +360,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function notify($fave, $notice, $user) function notify($fave, $notice, $user)
{ {
$other = User::staticGet('id', $notice->profile_id); $other = User::staticGet('id', $notice->profile_id);

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
* @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 AtompubmembershipfeedAction extends ApiAuthAction class AtompubmembershipfeedAction extends ApiAuthAction
{ {
private $_profile = null; private $_profile = null;
@ -59,7 +58,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction
* *
* @return boolean true * @return boolean true
*/ */
function prepare($argarray) function prepare($argarray)
{ {
parent::prepare($argarray); parent::prepare($argarray);
@ -69,6 +67,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
$this->_profile = Profile::staticGet('id', $profileId); $this->_profile = Profile::staticGet('id', $profileId);
if (empty($this->_profile)) { if (empty($this->_profile)) {
// TRANS: Client exception.
throw new ClientException(_('No such profile.'), 404); throw new ClientException(_('No such profile.'), 404);
} }
@ -89,7 +88,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function handle($argarray=null) function handle($argarray=null)
{ {
parent::handle($argarray); parent::handle($argarray);
@ -103,6 +101,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
$this->addMembership(); $this->addMembership();
break; break;
default: default:
// TRANS: Client exception thrown when using an unsupported HTTP method.
throw new ClientException(_('HTTP method not supported.'), 405); throw new ClientException(_('HTTP method not supported.'), 405);
return; return;
} }
@ -115,7 +114,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function showFeed() function showFeed()
{ {
header('Content-Type: application/atom+xml; charset=utf-8'); header('Content-Type: application/atom+xml; charset=utf-8');
@ -141,10 +139,14 @@ class AtompubmembershipfeedAction extends ApiAuthAction
$feed->addAuthor($this->_profile->getBestName(), $feed->addAuthor($this->_profile->getBestName(),
$this->_profile->getURI()); $this->_profile->getURI());
// TRANS: Title for group membership feed.
// TRANS: %s is a username.
$feed->setTitle(sprintf(_("%s group memberships"), $feed->setTitle(sprintf(_("%s group memberships"),
$this->_profile->getBestName())); $this->_profile->getBestName()));
$feed->setSubtitle(sprintf(_("Groups %s is a member of on %s"), // TRANS: Subtitle for group membership feed.
// TRANS: %1$s is a username, %2$s is the StatusNet sitename.
$feed->setSubtitle(sprintf(_("Groups %1$s is a member of on %2$s"),
$this->_profile->getBestName(), $this->_profile->getBestName(),
common_config('site', 'name'))); common_config('site', 'name')));
@ -207,14 +209,14 @@ class AtompubmembershipfeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function addMembership() function addMembership()
{ {
// XXX: Refactor this; all the same for atompub // XXX: Refactor this; all the same for atompub
if (empty($this->auth_user) || if (empty($this->auth_user) ||
$this->auth_user->id != $this->_profile->id) { $this->auth_user->id != $this->_profile->id) {
throw new ClientException(_("Can't add someone else's". // TRANS: Client exception thrown when trying subscribe someone else to a group.
throw new ClientException(_("Cannot add someone else's".
" membership"), 403); " membership"), 403);
} }
@ -234,17 +236,17 @@ class AtompubmembershipfeedAction extends ApiAuthAction
$membership = null; $membership = null;
if (Event::handle('StartAtomPubNewActivity', array(&$activity))) { if (Event::handle('StartAtomPubNewActivity', array(&$activity))) {
if ($activity->verb != ActivityVerb::JOIN) { if ($activity->verb != ActivityVerb::JOIN) {
// TRANS: Client error displayed when not using the POST verb. // TRANS: Client error displayed when not using the POST verb.
// TRANS: Do not translate POST. // TRANS: Do not translate POST.
throw new ClientException(_('Can only handle Join activities.')); throw new ClientException(_('Can only handle join activities.'));
return; return;
} }
$groupObj = $activity->objects[0]; $groupObj = $activity->objects[0];
if ($groupObj->type != ActivityObject::GROUP) { if ($groupObj->type != ActivityObject::GROUP) {
// TRANS: Client exception thrown when trying favorite an object that is not a notice.
throw new ClientException(_('Can only fave notices.')); throw new ClientException(_('Can only fave notices.'));
return; return;
} }
@ -253,6 +255,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
if (empty($group)) { if (empty($group)) {
// XXX: import from listed URL or something // XXX: import from listed URL or something
// TRANS: Client exception thrown when trying to subscribe to a non-existing group.
throw new ClientException(_('Unknown group.')); throw new ClientException(_('Unknown group.'));
} }
@ -260,6 +263,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
'group_id' => $group->id)); 'group_id' => $group->id));
if (!empty($old)) { if (!empty($old)) {
// TRANS: Client exception thrown when trying to subscribe to an already subscribed group.
throw new ClientException(_('Already a member.')); throw new ClientException(_('Already a member.'));
} }
@ -267,6 +271,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
if (Group_block::isBlocked($group, $profile)) { if (Group_block::isBlocked($group, $profile)) {
// XXX: import from listed URL or something // XXX: import from listed URL or something
// TRANS: Client exception thrown when trying to subscribe to group while blocked from that group.
throw new ClientException(_('Blocked by admin.')); throw new ClientException(_('Blocked by admin.'));
} }
@ -299,7 +304,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
@ -331,7 +335,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction
* *
* @return string etag http header * @return string etag http header
*/ */
function etag() function etag()
{ {
return null; return null;
@ -342,7 +345,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction
* *
* @return boolean true if delete, else false * @return boolean true if delete, else false
*/ */
function requiresAuth() function requiresAuth()
{ {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || if ($_SERVER['REQUEST_METHOD'] == 'GET' ||

View File

@ -48,7 +48,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
* @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 AtompubshowfavoriteAction extends ApiAuthAction class AtompubshowfavoriteAction extends ApiAuthAction
{ {
private $_profile = null; private $_profile = null;
@ -62,7 +61,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction
* *
* @return boolean true * @return boolean true
*/ */
function prepare($argarray) function prepare($argarray)
{ {
parent::prepare($argarray); parent::prepare($argarray);
@ -73,12 +71,14 @@ class AtompubshowfavoriteAction extends ApiAuthAction
$this->_profile = Profile::staticGet('id', $profileId); $this->_profile = Profile::staticGet('id', $profileId);
if (empty($this->_profile)) { if (empty($this->_profile)) {
// TRANS: Client exception.
throw new ClientException(_('No such profile.'), 404); throw new ClientException(_('No such profile.'), 404);
} }
$this->_notice = Notice::staticGet('id', $noticeId); $this->_notice = Notice::staticGet('id', $noticeId);
if (empty($this->_notice)) { if (empty($this->_notice)) {
// TRANS: Client exception thrown when referencing a non-existing notice.
throw new ClientException(_('No such notice.'), 404); throw new ClientException(_('No such notice.'), 404);
} }
@ -86,6 +86,7 @@ class AtompubshowfavoriteAction extends ApiAuthAction
'notice_id' => $noticeId)); 'notice_id' => $noticeId));
if (empty($this->_fave)) { if (empty($this->_fave)) {
// TRANS: Client exception thrown when referencing a non-existing favorite.
throw new ClientException(_('No such favorite.'), 404); throw new ClientException(_('No such favorite.'), 404);
} }
@ -99,7 +100,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function handle($argarray=null) function handle($argarray=null)
{ {
parent::handle($argarray); parent::handle($argarray);
@ -113,6 +113,7 @@ class AtompubshowfavoriteAction extends ApiAuthAction
$this->deleteFave(); $this->deleteFave();
break; break;
default: default:
// TRANS: Client exception thrown using an unsupported HTTP method.
throw new ClientException(_('HTTP method not supported.'), throw new ClientException(_('HTTP method not supported.'),
405); 405);
} }
@ -124,7 +125,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function showFave() function showFave()
{ {
$activity = $this->_fave->asActivity(); $activity = $this->_fave->asActivity();
@ -143,12 +143,12 @@ class AtompubshowfavoriteAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function deleteFave() function deleteFave()
{ {
if (empty($this->auth_user) || if (empty($this->auth_user) ||
$this->auth_user->id != $this->_profile->id) { $this->auth_user->id != $this->_profile->id) {
throw new ClientException(_("Can't delete someone else's". // TRANS: Client exception thrown when trying to remove a favorite notice of another user.
throw new ClientException(_("Cannot delete someone else's".
" favorite"), 403); " favorite"), 403);
} }
@ -166,7 +166,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
@ -184,7 +183,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction
* *
* @return string last modified http header * @return string last modified http header
*/ */
function lastModified() function lastModified()
{ {
return max(strtotime($this->_profile->modified), return max(strtotime($this->_profile->modified),
@ -199,7 +197,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction
* *
* @return string etag http header * @return string etag http header
*/ */
function etag() function etag()
{ {
$mtime = strtotime($this->_fave->modified); $mtime = strtotime($this->_fave->modified);
@ -215,7 +212,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction
* *
* @return boolean true if delete, else false * @return boolean true if delete, else false
*/ */
function requiresAuth() function requiresAuth()
{ {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || if ($_SERVER['REQUEST_METHOD'] == 'GET' ||

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
* @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 AtompubshowmembershipAction extends ApiAuthAction class AtompubshowmembershipAction extends ApiAuthAction
{ {
private $_profile = null; private $_profile = null;
@ -60,7 +59,6 @@ class AtompubshowmembershipAction extends ApiAuthAction
* *
* @return boolean true * @return boolean true
*/ */
function prepare($argarray) function prepare($argarray)
{ {
parent::prepare($argarray); parent::prepare($argarray);
@ -70,6 +68,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
$this->_profile = Profile::staticGet('id', $profileId); $this->_profile = Profile::staticGet('id', $profileId);
if (empty($this->_profile)) { if (empty($this->_profile)) {
// TRANS: Client exception.
throw new ClientException(_('No such profile.'), 404); throw new ClientException(_('No such profile.'), 404);
} }
@ -78,6 +77,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
$this->_group = User_group::staticGet('id', $groupId); $this->_group = User_group::staticGet('id', $groupId);
if (empty($this->_group)) { if (empty($this->_group)) {
// TRANS: Client exception thrown when referencing a non-existing group.
throw new ClientException(_('No such group'), 404); throw new ClientException(_('No such group'), 404);
} }
@ -87,6 +87,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
$this->_membership = Group_member::pkeyGet($kv); $this->_membership = Group_member::pkeyGet($kv);
if (empty($this->_membership)) { if (empty($this->_membership)) {
// TRANS: Client exception thrown when trying to show membership of a non-subscribed group
throw new ClientException(_('Not a member'), 404); throw new ClientException(_('Not a member'), 404);
} }
@ -100,7 +101,6 @@ class AtompubshowmembershipAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function handle($argarray=null) function handle($argarray=null)
{ {
switch ($_SERVER['REQUEST_METHOD']) { switch ($_SERVER['REQUEST_METHOD']) {
@ -112,7 +112,8 @@ class AtompubshowmembershipAction extends ApiAuthAction
$this->deleteMembership(); $this->deleteMembership();
break; break;
default: default:
throw new ClientException(_('Method not supported'), 405); // TRANS: Client exception thrown when using an unsupported HTTP method.
throw new ClientException(_('HTTP method not supported'), 405);
break; break;
} }
return; return;
@ -123,7 +124,6 @@ class AtompubshowmembershipAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function showMembership() function showMembership()
{ {
$activity = $this->_membership->asActivity(); $activity = $this->_membership->asActivity();
@ -147,7 +147,8 @@ class AtompubshowmembershipAction extends ApiAuthAction
{ {
if (empty($this->auth_user) || if (empty($this->auth_user) ||
$this->auth_user->id != $this->_profile->id) { $this->auth_user->id != $this->_profile->id) {
throw new ClientException(_("Can't delete someone else's". // TRANS: Client exception thrown when deleting someone else's membership.
throw new ClientException(_("Cannot delete someone else's".
" membership"), 403); " membership"), 403);
} }
@ -168,7 +169,6 @@ class AtompubshowmembershipAction extends ApiAuthAction
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
@ -203,7 +203,6 @@ class AtompubshowmembershipAction extends ApiAuthAction
* *
* @return string etag http header * @return string etag http header
*/ */
function etag() function etag()
{ {
$ctime = strtotime($this->_membership->created); $ctime = strtotime($this->_membership->created);
@ -222,7 +221,6 @@ class AtompubshowmembershipAction extends ApiAuthAction
* *
* @return boolean true if delete, else false * @return boolean true if delete, else false
*/ */
function requiresAuth() function requiresAuth()
{ {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || if ($_SERVER['REQUEST_METHOD'] == 'GET' ||

View File

@ -69,7 +69,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
if (empty($this->_subscriber)) { if (empty($this->_subscriber)) {
// TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID. // TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID.
// TRANS: %d is the non-existing profile ID number. // TRANS: %d is the non-existing profile ID number.
throw new ClientException(sprintf(_('No such profile id: %d'), throw new ClientException(sprintf(_('No such profile id: %d.'),
$subscriberId), 404); $subscriberId), 404);
} }
@ -80,7 +80,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
if (empty($this->_subscribed)) { if (empty($this->_subscribed)) {
// TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID. // TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID.
// TRANS: %d is the non-existing profile ID number. // TRANS: %d is the non-existing profile ID number.
throw new ClientException(sprintf(_('No such profile id: %d'), throw new ClientException(sprintf(_('No such profile id: %d.'),
$subscribedId), 404); $subscribedId), 404);
} }
@ -91,7 +91,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
if (empty($this->_subscription)) { if (empty($this->_subscription)) {
// TRANS: Client exception thrown when trying to display a subscription for a non-subscribed profile ID. // TRANS: Client exception thrown when trying to display a subscription for a non-subscribed profile ID.
// TRANS: %1$d is the non-existing subscriber ID number, $2$d is the ID of the profile that was not subscribed to. // TRANS: %1$d is the non-existing subscriber ID number, $2$d is the ID of the profile that was not subscribed to.
$msg = sprintf(_('Profile %1$d not subscribed to profile %2$d'), $msg = sprintf(_('Profile %1$d not subscribed to profile %2$d.'),
$subscriberId, $subscribedId); $subscriberId, $subscribedId);
throw new ClientException($msg, 404); throw new ClientException($msg, 404);
} }
@ -155,7 +155,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
$this->auth_user->id != $this->_subscriber->id) { $this->auth_user->id != $this->_subscriber->id) {
// TRANS: Client exception thrown when trying to delete a subscription of another user. // TRANS: Client exception thrown when trying to delete a subscription of another user.
throw new ClientException(_("Cannot delete someone else's ". throw new ClientException(_("Cannot delete someone else's ".
"subscription"), 403); "subscription."), 403);
} }
Subscription::cancel($this->_subscriber, Subscription::cancel($this->_subscriber,

View File

@ -48,7 +48,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
* @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 AtompubsubscriptionfeedAction extends ApiAuthAction class AtompubsubscriptionfeedAction extends ApiAuthAction
{ {
private $_profile = null; private $_profile = null;
@ -61,7 +60,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
* *
* @return boolean true * @return boolean true
*/ */
function prepare($argarray) function prepare($argarray)
{ {
parent::prepare($argarray); parent::prepare($argarray);
@ -71,7 +69,9 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
$this->_profile = Profile::staticGet('id', $subscriber); $this->_profile = Profile::staticGet('id', $subscriber);
if (empty($this->_profile)) { if (empty($this->_profile)) {
throw new ClientException(sprintf(_('No such profile id: %d'), // TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID.
// TRANS: %d is the non-existing profile ID number.
throw new ClientException(sprintf(_('No such profile id: %d.'),
$subscriber), 404); $subscriber), 404);
} }
@ -93,7 +93,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function handle($argarray=null) function handle($argarray=null)
{ {
parent::handle($argarray); parent::handle($argarray);
@ -106,6 +105,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
$this->addSubscription(); $this->addSubscription();
break; break;
default: default:
// TRANS: Client exception thrown when using an unsupported HTTP method.
$this->clientError(_('HTTP method not supported.'), 405); $this->clientError(_('HTTP method not supported.'), 405);
return; return;
} }
@ -118,7 +118,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function showFeed() function showFeed()
{ {
header('Content-Type: application/atom+xml; charset=utf-8'); header('Content-Type: application/atom+xml; charset=utf-8');
@ -144,10 +143,14 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
$feed->addAuthor($this->_profile->getBestName(), $feed->addAuthor($this->_profile->getBestName(),
$this->_profile->getURI()); $this->_profile->getURI());
// TRANS: Title for Atom subscription feed.
// TRANS: %s is a user nickname.
$feed->setTitle(sprintf(_("%s subscriptions"), $feed->setTitle(sprintf(_("%s subscriptions"),
$this->_profile->getBestName())); $this->_profile->getBestName()));
$feed->setSubtitle(sprintf(_("People %s has subscribed to on %s"), // TRANS: Subtitle for Atom subscription feed.
// TRANS: %1$s is a user nickname, %s$s is the StatusNet sitename.
$feed->setSubtitle(sprintf(_("People %1$s has subscribed to on %2$s"),
$this->_profile->getBestName(), $this->_profile->getBestName(),
common_config('site', 'name'))); common_config('site', 'name')));
@ -214,13 +217,13 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
* *
* @return void * @return void
*/ */
function addSubscription() function addSubscription()
{ {
if (empty($this->auth_user) || if (empty($this->auth_user) ||
$this->auth_user->id != $this->_profile->id) { $this->auth_user->id != $this->_profile->id) {
throw new ClientException(_("Can't add someone else's". // TRANS: Client exception thrown when trying to subscribe another user.
" subscription"), 403); throw new ClientException(_("Cannot add someone else's".
" subscription."), 403);
} }
$xml = file_get_contents('php://input'); $xml = file_get_contents('php://input');
@ -250,6 +253,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
$person = $activity->objects[0]; $person = $activity->objects[0];
if ($person->type != ActivityObject::PERSON) { if ($person->type != ActivityObject::PERSON) {
// TRANS: Client exception thrown when subscribing to an object that is not a person.
$this->clientError(_('Can only follow people.')); $this->clientError(_('Can only follow people.'));
return; return;
} }
@ -259,7 +263,8 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
$profile = Profile::fromURI($person->id); $profile = Profile::fromURI($person->id);
if (empty($profile)) { if (empty($profile)) {
$this->clientError(sprintf(_('Unknown profile %s'), $person->id)); // TRANS: Client exception thrown when subscribing to a non-existing profile.
$this->clientError(sprintf(_('Unknown profile %s.'), $person->id));
return; return;
} }
@ -290,7 +295,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return $_SERVER['REQUEST_METHOD'] != 'POST'; return $_SERVER['REQUEST_METHOD'] != 'POST';
@ -301,7 +305,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
* *
* @return string last modified http header * @return string last modified http header
*/ */
function lastModified() function lastModified()
{ {
return null; return null;
@ -312,7 +315,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
* *
* @return string etag http header * @return string etag http header
*/ */
function etag() function etag()
{ {
return null; return null;
@ -323,7 +325,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
* *
* @return boolean true if delete, else false * @return boolean true if delete, else false
*/ */
function requiresAuth() function requiresAuth()
{ {
if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_SERVER['REQUEST_METHOD'] == 'POST') {

View File

@ -115,7 +115,7 @@ class ConfirmaddressAction extends Action
if (!$result) { if (!$result) {
common_log_db_error($cur, 'UPDATE', __FILE__); common_log_db_error($cur, 'UPDATE', __FILE__);
// TRANS: Server error displayed when a user update to the database fails in the contact address confirmation action. // TRANS: Server error displayed when a user update to the database fails in the contact address confirmation action.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }

View File

@ -356,7 +356,7 @@ class EmailsettingsAction extends AccountSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error updating e-mail preferences. // TRANS: Server error thrown on database error updating e-mail preferences.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }
@ -423,7 +423,7 @@ class EmailsettingsAction extends AccountSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($confirm, 'INSERT', __FILE__); common_log_db_error($confirm, 'INSERT', __FILE__);
// TRANS: Server error thrown on database error adding e-mail confirmation code. // TRANS: Server error thrown on database error adding e-mail confirmation code.
$this->serverError(_('Couldn\'t insert confirmation code.')); $this->serverError(_('Could not insert confirmation code.'));
return; return;
} }
@ -465,7 +465,7 @@ class EmailsettingsAction extends AccountSettingsAction
if (!$result) { if (!$result) {
common_log_db_error($confirm, 'DELETE', __FILE__); common_log_db_error($confirm, 'DELETE', __FILE__);
// TRANS: Server error thrown on database error canceling e-mail address confirmation. // TRANS: Server error thrown on database error canceling e-mail address confirmation.
$this->serverError(_('Couldn\'t delete email confirmation.')); $this->serverError(_('Could not delete email confirmation.'));
return; return;
} }
@ -505,7 +505,7 @@ class EmailsettingsAction extends AccountSettingsAction
if (!$result) { if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error removing a registered e-mail address. // TRANS: Server error thrown on database error removing a registered e-mail address.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }
$user->query('COMMIT'); $user->query('COMMIT');
@ -537,7 +537,7 @@ class EmailsettingsAction extends AccountSettingsAction
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error removing incoming e-mail address. // TRANS: Server error thrown on database error removing incoming e-mail address.
$this->serverError(_("Couldn't update user record.")); $this->serverError(_("Could not update user record."));
} }
// TRANS: Message given after successfully removing an incoming e-mail address. // TRANS: Message given after successfully removing an incoming e-mail address.
@ -562,7 +562,7 @@ class EmailsettingsAction extends AccountSettingsAction
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error adding incoming e-mail address. // TRANS: Server error thrown on database error adding incoming e-mail address.
$this->serverError(_("Couldn't update user record.")); $this->serverError(_("Could not update user record."));
} }
// TRANS: Message given after successfully adding an incoming e-mail address. // TRANS: Message given after successfully adding an incoming e-mail address.

View File

@ -263,7 +263,7 @@ class GroupDesignSettingsAction extends DesignSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($design, 'UPDATE', __FILE__); common_log_db_error($design, 'UPDATE', __FILE__);
$this->showForm(_('Couldn\'t update your design.')); $this->showForm(_('Could not update your design.'));
return; return;
} }

View File

@ -49,7 +49,6 @@ define('MAX_ORIGINAL', 480);
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class GrouplogoAction extends GroupDesignAction class GrouplogoAction extends GroupDesignAction
{ {
var $mode = null; var $mode = null;
@ -67,6 +66,7 @@ class GrouplogoAction extends GroupDesignAction
parent::prepare($args); parent::prepare($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed when trying to create a group while not logged in.
$this->clientError(_('You must be logged in to create a group.')); $this->clientError(_('You must be logged in to create a group.'));
return false; return false;
} }
@ -83,6 +83,7 @@ class GrouplogoAction extends GroupDesignAction
} }
if (!$nickname) { if (!$nickname) {
// TRANS: Client error displayed when trying to change group logo settings without having a nickname.
$this->clientError(_('No nickname.'), 404); $this->clientError(_('No nickname.'), 404);
return false; return false;
} }
@ -99,6 +100,7 @@ class GrouplogoAction extends GroupDesignAction
} }
if (!$this->group) { if (!$this->group) {
// TRANS: Client error displayed when trying to update logo settings for a non-existing group.
$this->clientError(_('No such group.'), 404); $this->clientError(_('No such group.'), 404);
return false; return false;
} }
@ -106,6 +108,7 @@ class GrouplogoAction extends GroupDesignAction
$cur = common_current_user(); $cur = common_current_user();
if (!$cur->isAdmin($this->group)) { if (!$cur->isAdmin($this->group)) {
// TRANS: Client error displayed when trying to change group logo settings while not being a group admin.
$this->clientError(_('You must be an admin to edit the group.'), 403); $this->clientError(_('You must be an admin to edit the group.'), 403);
return false; return false;
} }
@ -136,9 +139,9 @@ class GrouplogoAction extends GroupDesignAction
* *
* @return string Title of the page * @return string Title of the page
*/ */
function title() function title()
{ {
// TRANS: Title for group logo settings page.
return _('Group logo'); return _('Group logo');
} }
@ -147,9 +150,10 @@ class GrouplogoAction extends GroupDesignAction
* *
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for group logo page.
// TRANS: %s is the maximum file size for that site.
return sprintf(_('You can upload a logo image for your group. The maximum file size is %s.'), ImageFile::maxFileSize()); return sprintf(_('You can upload a logo image for your group. The maximum file size is %s.'), ImageFile::maxFileSize());
} }
@ -160,7 +164,6 @@ class GrouplogoAction extends GroupDesignAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
if ($this->mode == 'crop') { if ($this->mode == 'crop') {
@ -178,6 +181,7 @@ class GrouplogoAction extends GroupDesignAction
if (!$profile) { if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__); common_log_db_error($user, 'SELECT', __FILE__);
// TRANS: Server error displayed coming across a request from a user without a profile.
$this->serverError(_('User without matching profile.')); $this->serverError(_('User without matching profile.'));
return; return;
} }
@ -192,6 +196,7 @@ class GrouplogoAction extends GroupDesignAction
common_local_url('grouplogo', common_local_url('grouplogo',
array('nickname' => $this->group->nickname)))); array('nickname' => $this->group->nickname))));
$this->elementStart('fieldset'); $this->elementStart('fieldset');
// TRANS: Group logo form legend.
$this->element('legend', null, _('Group logo')); $this->element('legend', null, _('Group logo'));
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
@ -199,6 +204,7 @@ class GrouplogoAction extends GroupDesignAction
if ($original) { if ($original) {
$this->elementStart('li', array('id' => 'avatar_original', $this->elementStart('li', array('id' => 'avatar_original',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Uploaded original file in group logo form.
$this->element('h2', null, _("Original")); $this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view')); $this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => $this->group->original_logo, $this->element('img', array('src' => $this->group->original_logo,
@ -210,6 +216,7 @@ class GrouplogoAction extends GroupDesignAction
if ($this->group->homepage_logo) { if ($this->group->homepage_logo) {
$this->elementStart('li', array('id' => 'avatar_preview', $this->elementStart('li', array('id' => 'avatar_preview',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Header for preview of to be displayed group logo.
$this->element('h2', null, _("Preview")); $this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view')); $this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => $this->group->homepage_logo, $this->element('img', array('src' => $this->group->homepage_logo,
@ -233,6 +240,7 @@ class GrouplogoAction extends GroupDesignAction
$this->elementStart('ul', 'form_actions'); $this->elementStart('ul', 'form_actions');
$this->elementStart('li'); $this->elementStart('li');
// TRANS: Submit button for uploading a group logo.
$this->submit('upload', _('Upload')); $this->submit('upload', _('Upload'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
@ -251,6 +259,7 @@ class GrouplogoAction extends GroupDesignAction
common_local_url('grouplogo', common_local_url('grouplogo',
array('nickname' => $this->group->nickname)))); array('nickname' => $this->group->nickname))));
$this->elementStart('fieldset'); $this->elementStart('fieldset');
// TRANS: Legend for group logo settings fieldset.
$this->element('legend', null, _('Avatar settings')); $this->element('legend', null, _('Avatar settings'));
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
@ -259,6 +268,7 @@ class GrouplogoAction extends GroupDesignAction
$this->elementStart('li', $this->elementStart('li',
array('id' => 'avatar_original', array('id' => 'avatar_original',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Header for originally uploaded file before a crop on the group logo page.
$this->element('h2', null, _("Original")); $this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view')); $this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']), $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
@ -271,6 +281,7 @@ class GrouplogoAction extends GroupDesignAction
$this->elementStart('li', $this->elementStart('li',
array('id' => 'avatar_preview', array('id' => 'avatar_preview',
'class' => 'avatar_view')); 'class' => 'avatar_view'));
// TRANS: Header for the cropped group logo on the group logo page.
$this->element('h2', null, _("Preview")); $this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view')); $this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']), $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
@ -286,6 +297,7 @@ class GrouplogoAction extends GroupDesignAction
'id' => $crop_info)); 'id' => $crop_info));
} }
// TRANS: Button text for cropping an uploaded group logo.
$this->submit('crop', _('Crop')); $this->submit('crop', _('Crop'));
$this->elementEnd('li'); $this->elementEnd('li');
@ -302,13 +314,13 @@ class GrouplogoAction extends GroupDesignAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
// CSRF protection // CSRF protection
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Form validation error message.
$this->show_form(_('There was a problem with your session token. '. $this->show_form(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;
@ -319,6 +331,7 @@ class GrouplogoAction extends GroupDesignAction
} else if ($this->arg('crop')) { } else if ($this->arg('crop')) {
$this->cropLogo(); $this->cropLogo();
} else { } else {
// TRANS: Form validation error message when an unsupported argument is used.
$this->showForm(_('Unexpected form submission.')); $this->showForm(_('Unexpected form submission.'));
} }
} }
@ -331,7 +344,6 @@ class GrouplogoAction extends GroupDesignAction
* *
* @return void * @return void
*/ */
function uploadLogo() function uploadLogo()
{ {
try { try {
@ -362,6 +374,7 @@ class GrouplogoAction extends GroupDesignAction
$this->mode = 'crop'; $this->mode = 'crop';
// TRANS: Form instructions on the group logo page.
$this->showForm(_('Pick a square area of the image to be the logo.'), $this->showForm(_('Pick a square area of the image to be the logo.'),
true); true);
} }
@ -371,12 +384,12 @@ class GrouplogoAction extends GroupDesignAction
* *
* @return void * @return void
*/ */
function cropLogo() function cropLogo()
{ {
$filedata = $_SESSION['FILEDATA']; $filedata = $_SESSION['FILEDATA'];
if (!$filedata) { if (!$filedata) {
// TRANS: Server error displayed trying to crop an uploaded group logo that is no longer present.
$this->serverError(_('Lost our file data.')); $this->serverError(_('Lost our file data.'));
return; return;
} }
@ -396,8 +409,10 @@ class GrouplogoAction extends GroupDesignAction
@unlink($filedata['filepath']); @unlink($filedata['filepath']);
unset($_SESSION['FILEDATA']); unset($_SESSION['FILEDATA']);
$this->mode = 'upload'; $this->mode = 'upload';
// TRANS: Form success message after updating a group logo.
$this->showForm(_('Logo updated.'), true); $this->showForm(_('Logo updated.'), true);
} else { } else {
// TRANS: Form failure message after failing to update a group logo.
$this->showForm(_('Failed updating logo.')); $this->showForm(_('Failed updating logo.'));
} }
} }

View File

@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/jabber.php';
* *
* @see SettingsAction * @see SettingsAction
*/ */
class ImsettingsAction extends ConnectSettingsAction class ImsettingsAction extends ConnectSettingsAction
{ {
/** /**
@ -53,7 +52,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return string Title of the page * @return string Title of the page
*/ */
function title() function title()
{ {
// TRANS: Title for instance messaging settings. // TRANS: Title for instance messaging settings.
@ -65,7 +63,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instant messaging settings page instructions. // TRANS: Instant messaging settings page instructions.
@ -85,7 +82,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
if (!common_config('xmpp', 'enabled')) { if (!common_config('xmpp', 'enabled')) {
@ -194,7 +190,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return Confirm_address address object for this user * @return Confirm_address address object for this user
*/ */
function getConfirmation() function getConfirmation()
{ {
$user = common_current_user(); $user = common_current_user();
@ -221,7 +216,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
// CSRF protection // CSRF protection
@ -254,7 +248,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function savePreferences() function savePreferences()
{ {
$jabbernotify = $this->boolean('jabbernotify'); $jabbernotify = $this->boolean('jabbernotify');
@ -280,7 +273,7 @@ class ImsettingsAction extends ConnectSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error updating IM preferences. // TRANS: Server error thrown on database error updating IM preferences.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }
@ -298,7 +291,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function addAddress() function addAddress()
{ {
$user = common_current_user(); $user = common_current_user();
@ -348,7 +340,7 @@ class ImsettingsAction extends ConnectSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($confirm, 'INSERT', __FILE__); common_log_db_error($confirm, 'INSERT', __FILE__);
// TRANS: Server error thrown on database error adding IM confirmation code. // TRANS: Server error thrown on database error adding IM confirmation code.
$this->serverError(_('Couldn\'t insert confirmation code.')); $this->serverError(_('Could not insert confirmation code.'));
return; return;
} }
@ -374,7 +366,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function cancelConfirmation() function cancelConfirmation()
{ {
$jabber = $this->arg('jabber'); $jabber = $this->arg('jabber');
@ -397,7 +388,7 @@ class ImsettingsAction extends ConnectSettingsAction
if (!$result) { if (!$result) {
common_log_db_error($confirm, 'DELETE', __FILE__); common_log_db_error($confirm, 'DELETE', __FILE__);
// TRANS: Server error thrown on database error canceling IM address confirmation. // TRANS: Server error thrown on database error canceling IM address confirmation.
$this->serverError(_('Couldn\'t delete IM confirmation.')); $this->serverError(_('Could not delete IM confirmation.'));
return; return;
} }
@ -412,7 +403,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function removeAddress() function removeAddress()
{ {
$user = common_current_user(); $user = common_current_user();
@ -439,7 +429,7 @@ class ImsettingsAction extends ConnectSettingsAction
if (!$result) { if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error removing a registered IM address. // TRANS: Server error thrown on database error removing a registered IM address.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }
$user->query('COMMIT'); $user->query('COMMIT');
@ -459,7 +449,6 @@ class ImsettingsAction extends ConnectSettingsAction
* *
* @return boolean whether the Jabber ID exists * @return boolean whether the Jabber ID exists
*/ */
function jabberExists($jabber) function jabberExists($jabber)
{ {
$user = common_current_user(); $user = common_current_user();

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class LicenseadminpanelAction extends AdminPanelAction class LicenseadminpanelAction extends AdminPanelAction
{ {
@ -61,7 +60,6 @@ class LicenseadminpanelAction extends AdminPanelAction
* *
* @return string instructions * @return string instructions
*/ */
function getInstructions() function getInstructions()
{ {
return _('License for this StatusNet site'); return _('License for this StatusNet site');
@ -72,7 +70,6 @@ class LicenseadminpanelAction extends AdminPanelAction
* *
* @return void * @return void
*/ */
function showForm() function showForm()
{ {
$form = new LicenseAdminPanelForm($this); $form = new LicenseAdminPanelForm($this);
@ -85,7 +82,6 @@ class LicenseadminpanelAction extends AdminPanelAction
* *
* @return void * @return void
*/ */
function saveSettings() function saveSettings()
{ {
static $settings = array( static $settings = array(
@ -128,7 +124,6 @@ class LicenseadminpanelAction extends AdminPanelAction
* *
* @return nothing * @return nothing
*/ */
function validate(&$values) function validate(&$values)
{ {
// Validate license type (shouldn't have to do it, but just in case) // Validate license type (shouldn't have to do it, but just in case)
@ -197,7 +192,6 @@ class LicenseAdminPanelForm extends AdminForm
* *
* @return int ID of the form * @return int ID of the form
*/ */
function id() function id()
{ {
return 'licenseadminpanel'; return 'licenseadminpanel';
@ -208,7 +202,6 @@ class LicenseAdminPanelForm extends AdminForm
* *
* @return string class of the form * @return string class of the form
*/ */
function formClass() function formClass()
{ {
return 'form_settings'; return 'form_settings';
@ -312,7 +305,6 @@ class LicenseAdminPanelForm extends AdminForm
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit( $this->out->submit(

View File

@ -181,7 +181,7 @@ class OthersettingsAction extends AccountSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error displayed when "Other" settings in user profile could not be updated on the server. // TRANS: Server error displayed when "Other" settings in user profile could not be updated on the server.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ProfilesettingsAction extends AccountSettingsAction class ProfilesettingsAction extends AccountSettingsAction
{ {
/** /**
@ -54,7 +53,6 @@ class ProfilesettingsAction extends AccountSettingsAction
* *
* @return string Title of the page * @return string Title of the page
*/ */
function title() function title()
{ {
// TRANS: Page title for profile settings. // TRANS: Page title for profile settings.
@ -66,7 +64,6 @@ class ProfilesettingsAction extends AccountSettingsAction
* *
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Usage instructions for profile settings. // TRANS: Usage instructions for profile settings.
@ -87,7 +84,6 @@ class ProfilesettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$user = common_current_user(); $user = common_current_user();
@ -212,7 +208,6 @@ class ProfilesettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
// CSRF protection // CSRF protection
@ -323,7 +318,7 @@ class ProfilesettingsAction extends AccountSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown when user profile settings could not be updated. // TRANS: Server error thrown when user profile settings could not be updated.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} else { } else {
// Re-initialize language environment if it changed // Re-initialize language environment if it changed
@ -348,7 +343,7 @@ class ProfilesettingsAction extends AccountSettingsAction
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown when user profile settings could not be updated to // TRANS: Server error thrown when user profile settings could not be updated to
// TRANS: automatically subscribe to any subscriber. // TRANS: automatically subscribe to any subscriber.
$this->serverError(_('Couldn\'t update user for autosubscribe.')); $this->serverError(_('Could not update user for autosubscribe.'));
return; return;
} }
} }
@ -406,7 +401,7 @@ class ProfilesettingsAction extends AccountSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($prefs, ($exists) ? 'UPDATE' : 'INSERT', __FILE__); common_log_db_error($prefs, ($exists) ? 'UPDATE' : 'INSERT', __FILE__);
// TRANS: Server error thrown when user profile location preference settings could not be updated. // TRANS: Server error thrown when user profile location preference settings could not be updated.
$this->serverError(_('Couldn\'t save location prefs.')); $this->serverError(_('Could not save location prefs.'));
return; return;
} }
} }
@ -419,7 +414,7 @@ class ProfilesettingsAction extends AccountSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($profile, 'UPDATE', __FILE__); common_log_db_error($profile, 'UPDATE', __FILE__);
// TRANS: Server error thrown when user profile settings could not be saved. // TRANS: Server error thrown when user profile settings could not be saved.
$this->serverError(_('Couldn\'t save profile.')); $this->serverError(_('Could not save profile.'));
return; return;
} }
@ -428,7 +423,7 @@ class ProfilesettingsAction extends AccountSettingsAction
if (!$result) { if (!$result) {
// TRANS: Server error thrown when user profile settings tags could not be saved. // TRANS: Server error thrown when user profile settings tags could not be saved.
$this->serverError(_('Couldn\'t save tags.')); $this->serverError(_('Could not save tags.'));
return; return;
} }

View File

@ -44,7 +44,6 @@ require_once INSTALLDIR.'/extlib/libomb/profile.php';
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class RemotesubscribeAction extends Action class RemotesubscribeAction extends Action
{ {
var $nickname; var $nickname;
@ -173,14 +172,14 @@ class RemotesubscribeAction extends Action
if ($service->getServiceURI(OAUTH_ENDPOINT_REQUEST) == if ($service->getServiceURI(OAUTH_ENDPOINT_REQUEST) ==
common_local_url('requesttoken') || common_local_url('requesttoken') ||
User::staticGet('uri', $service->getRemoteUserURI())) { User::staticGet('uri', $service->getRemoteUserURI())) {
$this->showForm(_('Thats a local profile! Login to subscribe.')); $this->showForm(_('That is a local profile! Login to subscribe.'));
return; return;
} }
try { try {
$service->requestToken(); $service->requestToken();
} catch (OMB_RemoteServiceException $e) { } catch (OMB_RemoteServiceException $e) {
$this->showForm(_('Couldnt get a request token.')); $this->showForm(_('Could not get a request token.'));
return; return;
} }
@ -204,4 +203,3 @@ class RemotesubscribeAction extends Action
common_redirect($target_url, 303); common_redirect($target_url, 303);
} }
} }
?>

View File

@ -41,7 +41,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class RepeatAction extends Action class RepeatAction extends Action
{ {
var $user = null; var $user = null;
@ -73,7 +72,7 @@ class RepeatAction extends Action
} }
if ($this->user->id == $this->notice->profile_id) { if ($this->user->id == $this->notice->profile_id) {
$this->clientError(_("You can't repeat your own notice.")); $this->clientError(_("You cannot repeat your own notice."));
return false; return false;
} }
@ -101,7 +100,6 @@ class RepeatAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
$repeat = $this->notice->repeat($this->user->id, 'web'); $repeat = $this->notice->repeat($this->user->id, 'web');

View File

@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/connectsettingsaction.php';
* *
* @see SettingsAction * @see SettingsAction
*/ */
class SmssettingsAction extends ConnectSettingsAction class SmssettingsAction extends ConnectSettingsAction
{ {
/** /**
@ -52,7 +51,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return string Title of the page * @return string Title of the page
*/ */
function title() function title()
{ {
// TRANS: Title for SMS settings. // TRANS: Title for SMS settings.
@ -64,7 +62,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() function getInstructions()
{ {
// XXX: For consistency of parameters in messages, this should be a // XXX: For consistency of parameters in messages, this should be a
@ -88,7 +85,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
if (!common_config('sms', 'enabled')) { if (!common_config('sms', 'enabled')) {
@ -219,7 +215,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @todo very similar to EmailsettingsAction::getConfirmation(); refactor? * @todo very similar to EmailsettingsAction::getConfirmation(); refactor?
*/ */
function getConfirmation() function getConfirmation()
{ {
$user = common_current_user(); $user = common_current_user();
@ -246,7 +241,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
// CSRF protection // CSRF protection
@ -285,7 +279,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function savePreferences() function savePreferences()
{ {
$smsnotify = $this->boolean('smsnotify'); $smsnotify = $this->boolean('smsnotify');
@ -305,7 +298,7 @@ class SmssettingsAction extends ConnectSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error updating SMS preferences. // TRANS: Server error thrown on database error updating SMS preferences.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }
@ -323,7 +316,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function addAddress() function addAddress()
{ {
$user = common_current_user(); $user = common_current_user();
@ -370,7 +362,7 @@ class SmssettingsAction extends ConnectSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($confirm, 'INSERT', __FILE__); common_log_db_error($confirm, 'INSERT', __FILE__);
// TRANS: Server error thrown on database error adding SMS confirmation code. // TRANS: Server error thrown on database error adding SMS confirmation code.
$this->serverError(_('Couldn\'t insert confirmation code.')); $this->serverError(_('Could not insert confirmation code.'));
return; return;
} }
@ -395,7 +387,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function cancelConfirmation() function cancelConfirmation()
{ {
$sms = $this->trimmed('sms'); $sms = $this->trimmed('sms');
@ -419,7 +410,7 @@ class SmssettingsAction extends ConnectSettingsAction
if (!$result) { if (!$result) {
common_log_db_error($confirm, 'DELETE', __FILE__); common_log_db_error($confirm, 'DELETE', __FILE__);
// TRANS: Server error thrown on database error canceling SMS phone number confirmation. // TRANS: Server error thrown on database error canceling SMS phone number confirmation.
$this->serverError(_('Couldn\'t delete email confirmation.')); $this->serverError(_('Could not delete email confirmation.'));
return; return;
} }
@ -432,7 +423,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function removeAddress() function removeAddress()
{ {
$user = common_current_user(); $user = common_current_user();
@ -461,7 +451,7 @@ class SmssettingsAction extends ConnectSettingsAction
if (!$result) { if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error removing a registered SMS phone number. // TRANS: Server error thrown on database error removing a registered SMS phone number.
$this->serverError(_('Couldn\'t update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }
$user->query('COMMIT'); $user->query('COMMIT');
@ -479,7 +469,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return boolean does the number exist * @return boolean does the number exist
*/ */
function smsExists($sms) function smsExists($sms)
{ {
$user = common_current_user(); $user = common_current_user();
@ -498,7 +487,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function carrierSelect() function carrierSelect()
{ {
$carrier = new Sms_carrier(); $carrier = new Sms_carrier();
@ -538,7 +526,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function confirmCode() function confirmCode()
{ {
$code = $this->trimmed('code'); $code = $this->trimmed('code');
@ -559,7 +546,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @return void * @return void
*/ */
function removeIncoming() function removeIncoming()
{ {
$user = common_current_user(); $user = common_current_user();
@ -575,7 +561,7 @@ class SmssettingsAction extends ConnectSettingsAction
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
$this->serverError(_("Couldn't update user record.")); $this->serverError(_("Could not update user record."));
} }
$this->showForm(_('Incoming email address removed.'), true); $this->showForm(_('Incoming email address removed.'), true);
@ -588,7 +574,6 @@ class SmssettingsAction extends ConnectSettingsAction
* *
* @see Emailsettings::newIncoming * @see Emailsettings::newIncoming
*/ */
function newIncoming() function newIncoming()
{ {
$user = common_current_user(); $user = common_current_user();
@ -599,7 +584,7 @@ class SmssettingsAction extends ConnectSettingsAction
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
$this->serverError(_("Couldn't update user record.")); $this->serverError(_("Could not update user record."));
} }
$this->showForm(_('New incoming email address added.'), true); $this->showForm(_('New incoming email address added.'), true);

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/designsettings.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class UserDesignSettingsAction extends DesignSettingsAction class UserDesignSettingsAction extends DesignSettingsAction
{ {
/** /**
@ -70,7 +69,6 @@ class UserDesignSettingsAction extends DesignSettingsAction
* *
* @return string Title of the page * @return string Title of the page
*/ */
function title() function title()
{ {
return _('Profile design'); return _('Profile design');
@ -81,7 +79,6 @@ class UserDesignSettingsAction extends DesignSettingsAction
* *
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() function getInstructions()
{ {
return _('Customize the way your profile looks ' . return _('Customize the way your profile looks ' .
@ -93,7 +90,6 @@ class UserDesignSettingsAction extends DesignSettingsAction
* *
* @return Design * @return Design
*/ */
function getWorkingDesign() function getWorkingDesign()
{ {
$user = common_current_user(); $user = common_current_user();
@ -108,7 +104,6 @@ class UserDesignSettingsAction extends DesignSettingsAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$design = $this->getWorkingDesign(); $design = $this->getWorkingDesign();
@ -125,7 +120,6 @@ class UserDesignSettingsAction extends DesignSettingsAction
* *
* @return void * @return void
*/ */
function saveDesign() function saveDesign()
{ {
foreach ($this->args as $key => $val) { foreach ($this->args as $key => $val) {
@ -168,7 +162,6 @@ class UserDesignSettingsAction extends DesignSettingsAction
$design = $user->getDesign(); $design = $user->getDesign();
if (!empty($design)) { if (!empty($design)) {
$original = clone($design); $original = clone($design);
$design->backgroundcolor = $bgcolor->intValue(); $design->backgroundcolor = $bgcolor->intValue();
@ -183,13 +176,11 @@ class UserDesignSettingsAction extends DesignSettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($design, 'UPDATE', __FILE__); common_log_db_error($design, 'UPDATE', __FILE__);
$this->showForm(_('Couldn\'t update your design.')); $this->showForm(_('Could not update your design.'));
return; return;
} }
// update design // update design
} else { } else {
$user->query('BEGIN'); $user->query('BEGIN');
// save new design // save new design
@ -236,7 +227,6 @@ class UserDesignSettingsAction extends DesignSettingsAction
* *
* @return nothing * @return nothing
*/ */
function sethd() function sethd()
{ {
@ -281,5 +271,4 @@ class UserDesignSettingsAction extends DesignSettingsAction
$this->showForm(_('Enjoy your hotdog!'), true); $this->showForm(_('Enjoy your hotdog!'), true);
} }
} }