Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase

Conflicts:
	actions/tagother.php
	lib/subscriberspeopleselftagcloudsection.php
	lib/subscriptionspeopleselftagcloudsection.php
This commit is contained in:
Shashi Gowda 2011-04-04 13:26:27 +05:30
commit 57198a7464
1544 changed files with 53904 additions and 17301 deletions

View File

@ -66,6 +66,7 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -88,7 +88,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed handling a non-existing API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -90,7 +90,7 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -88,7 +88,7 @@ class ApiAccountUpdateProfileBackgroundImageAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -111,7 +111,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method updating profile colours. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -64,7 +64,7 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
parent::handle($args); parent::handle($args);
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
// TRANS: Client error displayed trying to execute an unknown API method verifying user credentials. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
return; return;
} }

View File

@ -92,7 +92,7 @@ class ApiBlockCreateAction extends ApiAuthAction
} }
if (empty($this->user) || empty($this->other)) { if (empty($this->user) || empty($this->other)) {
// TRANS: Client error displayed when trying to block a non-existing user or a user from another site. // TRANS: Client error displayed when trying to block a non-existing user or a user from another site.
$this->clientError(_('No such user.'), 404, $this->format); $this->clientError(_('No such user.'), 404, $this->format);
return; return;
} }

View File

@ -153,7 +153,7 @@ class ApiDirectMessageAction extends ApiAuthAction
$this->showJsonDirectMessages(); $this->showJsonDirectMessages();
break; break;
default: default:
// TRANS: Client error given when an API method was not found (404). // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -94,7 +94,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -94,7 +94,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -95,7 +95,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -95,7 +95,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -120,7 +120,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
parent::handle($args); parent::handle($args);
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
// TRANS: Client error displayed trying to execute an unknown API method showing friendship. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), 404); $this->clientError(_('API method not found.'), 404);
return; return;
} }

View File

@ -134,7 +134,7 @@ class ApiGroupCreateAction extends ApiAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error given when an API method was not found (404). // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -111,7 +111,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method showing group membership. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
400, 400,
$this->format $this->format

View File

@ -144,7 +144,7 @@ class ApiGroupJoinAction extends ApiAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method joining a group. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -134,7 +134,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method leaving a group. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -67,6 +67,7 @@ class ApiGroupListAction extends ApiBareAuthAction
$this->user = $this->getTargetUser(null); $this->user = $this->getTargetUser(null);
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error displayed when user not found for an action.
$this->clientError(_('No such user.'), 404, $this->format); $this->clientError(_('No such user.'), 404, $this->format);
return false; return false;
} }
@ -130,7 +131,7 @@ class ApiGroupListAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method checking group membership. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -116,7 +116,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method listing the latest 20 groups. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -101,7 +101,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method showing group membership. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -85,6 +85,7 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') { if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError( $this->clientError(
// TRANS: Client error message. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'), _('This method requires a POST.'),
400, $this->format 400, $this->format
); );
@ -93,7 +94,7 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when using an unsupported API format. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -211,7 +212,7 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction
$this->showSingleJsonGroup($this->group); $this->showSingleJsonGroup($this->group);
break; break;
default: default:
// TRANS: Client error displayed when using an unsupported API format. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), 404, $this->format); $this->clientError(_('API method not found.'), 404, $this->format);
break; break;
} }

View File

@ -110,7 +110,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
$this->showSingleJsonGroup($this->group); $this->showSingleJsonGroup($this->group);
break; break;
default: default:
// TRANS: Client error displayed trying to execute an unknown API method showing a group. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), 404, $this->format); $this->clientError(_('API method not found.'), 404, $this->format);
break; break;
} }

View File

@ -80,7 +80,7 @@ class ApiHelpTestAction extends ApiPrivateAuthAction
$this->endDocument('json'); $this->endDocument('json');
} else { } else {
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method testing API connectivity. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -97,7 +97,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method deleting a status. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404 404
); );

View File

@ -106,7 +106,7 @@ class ApiStatusesRetweetsAction extends ApiAuthAction
$this->showJsonTimeline($strm); $this->showJsonTimeline($strm);
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -101,7 +101,7 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
parent::handle($args); parent::handle($args);
if (!in_array($this->format, array('xml', 'json', 'atom'))) { if (!in_array($this->format, array('xml', 'json', 'atom'))) {
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), 404); $this->clientError(_('API method not found.'), 404);
return; return;
} }

View File

@ -239,8 +239,8 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$this->clientError( $this->clientError(
sprintf( sprintf(
// TRANS: Client error displayed when the parameter "status" is missing. // TRANS: Client error displayed exceeding the maximum notice length.
// TRANS: %d is the maximum number of character for a notice. // TRANS: %d is the maximum length for a notice.
_m('That\'s too long. Maximum notice size is %d character.', _m('That\'s too long. Maximum notice size is %d character.',
'That\'s too long. Maximum notice size is %d characters.', 'That\'s too long. Maximum notice size is %d characters.',
Notice::maxContent()), Notice::maxContent()),

View File

@ -135,7 +135,7 @@ class ApiStatusnetConfigAction extends ApiAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -87,7 +87,7 @@ class ApiStatusnetVersionAction extends ApiPrivateAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -105,7 +105,7 @@ class ApiSubscriptionsAction extends ApiBareAuthAction
parent::handle($args); parent::handle($args);
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
return; return;
} }

View File

@ -178,7 +178,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -204,6 +204,8 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$profile = $this->user->getProfile(); $profile = $this->user->getProfile();
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$sitename = common_config('site', 'name'); $sitename = common_config('site', 'name');
// TRANS: Title of API timeline for a user and friends.
// TRANS: %s is a username.
$title = sprintf(_("%s and friends"), $this->user->nickname); $title = sprintf(_("%s and friends"), $this->user->nickname);
$taguribase = TagURI::base(); $taguribase = TagURI::base();
$id = "tag:$taguribase:FriendsTimeline:" . $this->user->id; $id = "tag:$taguribase:FriendsTimeline:" . $this->user->id;
@ -272,7 +274,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -177,7 +177,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -178,7 +178,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -243,7 +243,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -146,7 +146,7 @@ class ApiTimelineRetweetedToMeAction extends ApiAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -101,6 +101,8 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
$profile = $this->auth_user->getProfile(); $profile = $this->auth_user->getProfile();
$subtitle = sprintf( $subtitle = sprintf(
// TRANS: Subtitle of API time with retweets of me.
// TRANS: %1$s is the StatusNet sitename, %2$s is the user nickname, %3$s is the user profile name.
_('%1$s notices that %2$s / %3$s has repeated.'), _('%1$s notices that %2$s / %3$s has repeated.'),
$sitename, $this->auth_user->nickname, $profile->getBestName() $sitename, $this->auth_user->nickname, $profile->getBestName()
); );
@ -143,7 +145,7 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), 404); $this->clientError(_('API method not found.'), 404);
break; break;
} }

View File

@ -161,7 +161,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -213,7 +213,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
$this->raw($doc->asString()); $this->raw($doc->asString());
break; break;
default: default:
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
break; break;
} }

View File

@ -96,7 +96,7 @@ class ApiUserShowAction extends ApiPrivateAuthAction
} }
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
// TRANS: Client error displayed when trying to handle an unknown API method. // TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(_('API method not found.'), $code = 404);
return; return;
} }

View File

@ -277,6 +277,7 @@ class AvatarsettingsAction extends SettingsAction
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -53,7 +53,7 @@ class CancelsubscriptionAction extends Action
StatusNet::setApi(true); StatusNet::setApi(true);
} }
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed when trying to leave a group while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return; return;
} }
@ -71,6 +71,7 @@ class CancelsubscriptionAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. ' . $this->clientError(_('There was a problem with your session token. ' .
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -99,6 +99,7 @@ class DeleteapplicationAction extends Action
// 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: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token.')); $this->clientError(_('There was a problem with your session token.'));
return; return;
} }

View File

@ -48,7 +48,7 @@ class DeletenoticeAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (!$this->user) { if (!$this->user) {
// TRANS: Error message displayed trying to delete a notice while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
common_user_error(_('Not logged in.')); common_user_error(_('Not logged in.'));
exit; exit;
} }
@ -174,6 +174,7 @@ class DeletenoticeAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. ' . $this->showForm(_('There was a problem with your session token. ' .
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -57,7 +57,7 @@ class DisfavorAction extends Action
{ {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed when trying to remove a favorite while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return; return;
} }

View File

@ -128,6 +128,7 @@ class EditApplicationAction extends OwnerDesignAction
// 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: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token.')); $this->clientError(_('There was a problem with your session token.'));
return; return;
} }

View File

@ -207,45 +207,45 @@ class EmailsettingsAction extends SettingsAction
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
if (Event::handle('StartEmailFormData', array($this))) { if (Event::handle('StartEmailFormData', array($this))) {
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailnotifysub', $this->checkbox('emailnotifysub',
// TRANS: Checkbox label in e-mail preferences form. // TRANS: Checkbox label in e-mail preferences form.
_('Send me notices of new subscriptions through email.'), _('Send me notices of new subscriptions through email.'),
$user->emailnotifysub); $user->emailnotifysub);
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailnotifyfav', $this->checkbox('emailnotifyfav',
// TRANS: Checkbox label in e-mail preferences form. // TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone '. _('Send me email when someone '.
'adds my notice as a favorite.'), 'adds my notice as a favorite.'),
$user->emailnotifyfav); $user->emailnotifyfav);
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailnotifymsg', $this->checkbox('emailnotifymsg',
// TRANS: Checkbox label in e-mail preferences form. // TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone sends me a private message.'), _('Send me email when someone sends me a private message.'),
$user->emailnotifymsg); $user->emailnotifymsg);
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailnotifyattn', $this->checkbox('emailnotifyattn',
// TRANS: Checkbox label in e-mail preferences form. // TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone sends me an "@-reply".'), _('Send me email when someone sends me an "@-reply".'),
$user->emailnotifyattn); $user->emailnotifyattn);
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailnotifynudge', $this->checkbox('emailnotifynudge',
// TRANS: Checkbox label in e-mail preferences form. // TRANS: Checkbox label in e-mail preferences form.
_('Allow friends to nudge me and send me an email.'), _('Allow friends to nudge me and send me an email.'),
$user->emailnotifynudge); $user->emailnotifynudge);
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailmicroid', $this->checkbox('emailmicroid',
// TRANS: Checkbox label in e-mail preferences form. // TRANS: Checkbox label in e-mail preferences form.
_('Publish a MicroID for my email address.'), _('Publish a MicroID for my email address.'),
$user->emailmicroid); $user->emailmicroid);
$this->elementEnd('li'); $this->elementEnd('li');
Event::handle('EndEmailFormData', array($this)); Event::handle('EndEmailFormData', array($this));
} }
$this->elementEnd('ul'); $this->elementEnd('ul');
// TRANS: Button label to save e-mail preferences. // TRANS: Button label to save e-mail preferences.
$this->submit('save', _m('BUTTON','Save')); $this->submit('save', _m('BUTTON','Save'));
@ -289,6 +289,7 @@ class EmailsettingsAction extends SettingsAction
// 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: Client error displayed when the session token does not match or is not given.
$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,48 +320,47 @@ class EmailsettingsAction extends SettingsAction
*/ */
function savePreferences() function savePreferences()
{ {
$user = common_current_user(); $user = common_current_user();
if (Event::handle('StartEmailSaveForm', array($this, &$user))) { if (Event::handle('StartEmailSaveForm', array($this, &$user))) {
$emailnotifysub = $this->boolean('emailnotifysub');
$emailnotifyfav = $this->boolean('emailnotifyfav');
$emailnotifymsg = $this->boolean('emailnotifymsg');
$emailnotifynudge = $this->boolean('emailnotifynudge');
$emailnotifyattn = $this->boolean('emailnotifyattn');
$emailmicroid = $this->boolean('emailmicroid');
$emailpost = $this->boolean('emailpost');
$emailnotifysub = $this->boolean('emailnotifysub'); assert(!is_null($user)); // should already be checked
$emailnotifyfav = $this->boolean('emailnotifyfav');
$emailnotifymsg = $this->boolean('emailnotifymsg');
$emailnotifynudge = $this->boolean('emailnotifynudge');
$emailnotifyattn = $this->boolean('emailnotifyattn');
$emailmicroid = $this->boolean('emailmicroid');
$emailpost = $this->boolean('emailpost');
assert(!is_null($user)); // should already be checked $user->query('BEGIN');
$user->query('BEGIN'); $original = clone($user);
$original = clone($user); $user->emailnotifysub = $emailnotifysub;
$user->emailnotifyfav = $emailnotifyfav;
$user->emailnotifymsg = $emailnotifymsg;
$user->emailnotifynudge = $emailnotifynudge;
$user->emailnotifyattn = $emailnotifyattn;
$user->emailmicroid = $emailmicroid;
$user->emailpost = $emailpost;
$user->emailnotifysub = $emailnotifysub; $result = $user->update($original);
$user->emailnotifyfav = $emailnotifyfav;
$user->emailnotifymsg = $emailnotifymsg;
$user->emailnotifynudge = $emailnotifynudge;
$user->emailnotifyattn = $emailnotifyattn;
$user->emailmicroid = $emailmicroid;
$user->emailpost = $emailpost;
$result = $user->update($original); if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error updating e-mail preferences.
$this->serverError(_('Could not update user.'));
return;
}
if ($result === false) { $user->query('COMMIT');
common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error updating e-mail preferences.
$this->serverError(_('Could not update user.'));
return;
}
$user->query('COMMIT'); Event::handle('EndEmailSaveForm', array($this));
Event::handle('EndEmailSaveForm', array($this)); // TRANS: Confirmation message for successful e-mail preferences save.
$this->showForm(_('Email preferences saved.'), true);
// TRANS: Confirmation message for successful e-mail preferences save. }
$this->showForm(_('Email preferences saved.'), true);
}
} }
/** /**

View File

@ -58,7 +58,7 @@ class FavorAction extends Action
{ {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed when trying to mark a notice as favorite without being logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return; return;
} }
@ -72,6 +72,7 @@ class FavorAction extends Action
$notice = Notice::staticGet($id); $notice = Notice::staticGet($id);
$token = $this->trimmed('token-'.$notice->id); $token = $this->trimmed('token-'.$notice->id);
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. Try again, please.')); $this->clientError(_('There was a problem with your session token. Try again, please.'));
return; return;
} }

View File

@ -52,6 +52,7 @@ class GeocodeAction extends Action
parent::prepare($args); parent::prepare($args);
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. '. $this->clientError(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
} }

View File

@ -56,12 +56,13 @@ class GroupblockAction extends RedirectingAction
{ {
parent::prepare($args); parent::prepare($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying to block a user from a group while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (empty($token) || $token != common_session_token()) { if (empty($token) || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. Try again, please.')); $this->clientError(_('There was a problem with your session token. Try again, please.'));
return; return;
} }

View File

@ -56,12 +56,13 @@ class GroupunblockAction extends Action
{ {
parent::prepare($args); parent::prepare($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed when trying to unblock a user from a group while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (empty($token) || $token != common_session_token()) { if (empty($token) || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. Try again, please.')); $this->clientError(_('There was a problem with your session token. Try again, please.'));
return; return;
} }

View File

@ -240,6 +240,7 @@ class ImsettingsAction extends SettingsAction
// 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: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -57,6 +57,7 @@ class InviteAction extends CurrentUserDesignAction
// 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: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. Try again, please.')); $this->showForm(_('There was a problem with your session token. Try again, please.'));
return; return;
} }

View File

@ -65,7 +65,7 @@ class LogoutAction extends Action
{ {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying to log out when not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
} else { } else {
if (Event::handle('StartLogout', array($this))) { if (Event::handle('StartLogout', array($this))) {

View File

@ -58,12 +58,13 @@ class MakeadminAction extends RedirectingAction
{ {
parent::prepare($args); parent::prepare($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed when trying to access the "make admin" page while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (empty($token) || $token != common_session_token()) { if (empty($token) || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. Try again, please.')); $this->clientError(_('There was a problem with your session token. Try again, please.'));
return; return;
} }

View File

@ -109,6 +109,7 @@ class NewApplicationAction extends OwnerDesignAction
// 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: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token.')); $this->clientError(_('There was a problem with your session token.'));
return; return;
} }

View File

@ -85,7 +85,7 @@ class NewmessageAction extends Action
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying to create a new direct message while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.'), 403); $this->clientError(_('Not logged in.'), 403);
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') { } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->saveNewMessage(); $this->saveNewMessage();
@ -137,6 +137,7 @@ class NewmessageAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. ' . $this->showForm(_('There was a problem with your session token. ' .
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -64,7 +64,7 @@ class NewnoticeAction extends Action
function title() function title()
{ {
// TRANS: Page title for sending a new notice. // TRANS: Page title for sending a new notice.
return _('New notice'); return _m('TITLE','New notice');
} }
/** /**
@ -83,7 +83,7 @@ class NewnoticeAction extends Action
function handle($args) function handle($args)
{ {
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying to send a notice while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') { } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// check for this before token since all POST and FILES data // check for this before token since all POST and FILES data
@ -101,6 +101,7 @@ class NewnoticeAction extends Action
// 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: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. '. $this->clientError(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
} }
@ -180,6 +181,8 @@ class NewnoticeAction extends Action
if (Notice::contentTooLong($content_shortened)) { if (Notice::contentTooLong($content_shortened)) {
$upload->delete(); $upload->delete();
// TRANS: Client error displayed exceeding the maximum notice length.
// TRANS: %d is the maximum length for a notice.
$this->clientError(sprintf(_m('Maximum notice size is %d character, including attachment URL.', $this->clientError(sprintf(_m('Maximum notice size is %d character, including attachment URL.',
'Maximum notice size is %d characters, including attachment URL.', 'Maximum notice size is %d characters, including attachment URL.',
Notice::maxContent()), Notice::maxContent()),
@ -286,7 +289,8 @@ class NewnoticeAction extends Action
{ {
$this->startHTML('text/xml;charset=utf-8', true); $this->startHTML('text/xml;charset=utf-8', true);
$this->elementStart('head'); $this->elementStart('head');
$this->element('title', null, _('New notice')); // TRANS: Title for form to send a new notice.
$this->element('title', null, _m('TITLE','New notice'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');

View File

@ -60,7 +60,7 @@ class NudgeAction extends Action
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying to nudge a user without being logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return; return;
} }
@ -78,6 +78,7 @@ class NudgeAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. Try again, please.')); $this->clientError(_('There was a problem with your session token. Try again, please.'));
return; return;
} }

View File

@ -132,6 +132,7 @@ class OauthconnectionssettingsAction extends SettingsAction
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -143,6 +143,7 @@ class PasswordsettingsAction extends SettingsAction
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -84,6 +84,7 @@ class PluginEnableAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token.'. $this->clientError(_('There was a problem with your session token.'.
' Try again, please.')); ' Try again, please.'));
return false; return false;
@ -94,7 +95,7 @@ class PluginEnableAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error displayed when trying to enable or disable a plugin while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }

View File

@ -203,6 +203,13 @@ class ProfilesettingsAction extends SettingsAction
(empty($user->subscribe_policy)) ? User::SUBSCRIBE_POLICY_OPEN : $user->subscribe_policy); (empty($user->subscribe_policy)) ? User::SUBSCRIBE_POLICY_OPEN : $user->subscribe_policy);
$this->elementEnd('li'); $this->elementEnd('li');
} }
$this->elementStart('li');
$this->checkbox('private_stream',
// TRANS: Checkbox label in profile settings.
_('Make updates visible only to my followers'),
($this->arg('private_stream')) ?
$this->boolean('private_stream') : $user->private_stream);
$this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
// TRANS: Button to save input in profile settings. // TRANS: Button to save input in profile settings.
$this->submit('save', _m('BUTTON','Save')); $this->submit('save', _m('BUTTON','Save'));
@ -245,6 +252,7 @@ class ProfilesettingsAction extends SettingsAction
$location = $this->trimmed('location'); $location = $this->trimmed('location');
$autosubscribe = $this->boolean('autosubscribe'); $autosubscribe = $this->boolean('autosubscribe');
$subscribe_policy = $this->trimmed('subscribe_policy'); $subscribe_policy = $this->trimmed('subscribe_policy');
$private_stream = $this->boolean('private_stream');
$language = $this->trimmed('language'); $language = $this->trimmed('language');
$timezone = $this->trimmed('timezone'); $timezone = $this->trimmed('timezone');
$tagstring = $this->trimmed('tags'); $tagstring = $this->trimmed('tags');
@ -350,11 +358,14 @@ class ProfilesettingsAction extends SettingsAction
} }
// XXX: XOR // XXX: XOR
if (($user->autosubscribe ^ $autosubscribe) || $user->subscribe_policy != $subscribe_policy) { if (($user->autosubscribe ^ $autosubscribe) ||
($user->private_stream ^ $private_stream) ||
($user->subscribe_policy != $subscribe_policy)) {
$original = clone($user); $original = clone($user);
$user->autosubscribe = $autosubscribe; $user->autosubscribe = $autosubscribe;
$user->private_stream = $private_stream;
$user->subscribe_policy = $subscribe_policy; $user->subscribe_policy = $subscribe_policy;
$result = $user->update($original); $result = $user->update($original);

View File

@ -160,6 +160,7 @@ class RegisterAction extends Action
if (Event::handle('StartRegistrationTry', array($this))) { if (Event::handle('StartRegistrationTry', array($this))) {
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;
@ -211,6 +212,7 @@ class RegisterAction extends Action
// TRANS: Form validation error displayed when trying to register with an invalid nickname. // TRANS: Form validation error displayed when trying to register with an invalid nickname.
$this->showForm(_('Not a valid nickname.')); $this->showForm(_('Not a valid nickname.'));
} else if ($this->emailExists($email)) { } else if ($this->emailExists($email)) {
// TRANS: Form validation error displayed when trying to register with an already registered e-mail address.
$this->showForm(_('Email address already exists.')); $this->showForm(_('Email address already exists.'));
} else if (!is_null($homepage) && (strlen($homepage) > 0) && } else if (!is_null($homepage) && (strlen($homepage) > 0) &&
!Validate::uri($homepage, !Validate::uri($homepage,

View File

@ -74,6 +74,7 @@ class RemotesubscribeAction extends Action
/* Use a session token for CSRF protection. */ /* Use a session token for CSRF protection. */
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -76,6 +76,7 @@ class RepeatAction extends Action
$token = $this->trimmed('token-'.$id); $token = $this->trimmed('token-'.$id);
if (empty($token) || $token != common_session_token()) { if (empty($token) || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. Try again, please.')); $this->clientError(_('There was a problem with your session token. Try again, please.'));
return false; return false;
} }

View File

@ -113,6 +113,7 @@ class ShowApplicationAction extends OwnerDesignAction
// 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: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token.')); $this->clientError(_('There was a problem with your session token.'));
return; return;
} }

View File

@ -67,11 +67,11 @@ class ShowstreamAction extends ProfileAction
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Page title showing tagged notices in one user's stream. // TRANS: Page title showing tagged notices in one user's stream.
// TRANS: %1$s is the username, %2$s is the hash tag. // TRANS: %1$s is the username, %2$s is the hash tag.
return sprintf(_('%1$s tagged %2$s'), $base, $this->tag); return sprintf(_('Notices by %1$s tagged %2$s'), $base, $this->tag);
} else { } else {
// TRANS: Page title showing tagged notices in one user's stream. // TRANS: Page title showing tagged notices in one user's stream.
// TRANS: %1$s is the username, %2$s is the hash tag, %3$d is the page number. // TRANS: %1$s is the username, %2$s is the hash tag, %3$d is the page number.
return sprintf(_('%1$s tagged %2$s, page %3$d'), $base, $this->tag, $this->page); return sprintf(_('Notices by %1$s tagged %2$s, page %3$d'), $base, $this->tag, $this->page);
} }
} else { } else {
if ($this->page == 1) { if ($this->page == 1) {
@ -79,7 +79,7 @@ class ShowstreamAction extends ProfileAction
} else { } else {
// TRANS: Extended page title showing tagged notices in one user's stream. // TRANS: Extended page title showing tagged notices in one user's stream.
// TRANS: %1$s is the username, %2$d is the page number. // TRANS: %1$s is the username, %2$d is the page number.
return sprintf(_('%1$s, page %2$d'), return sprintf(_('Notices by %1$s, page %2$d'),
$base, $base,
$this->page); $this->page);
} }

View File

@ -246,6 +246,7 @@ class SmssettingsAction extends SettingsAction
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -29,7 +29,7 @@ class SubeditAction extends Action
parent::prepare($args); parent::prepare($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying a change a subscription while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
@ -37,6 +37,7 @@ class SubeditAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. '. $this->clientError(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return false; return false;

View File

@ -94,7 +94,7 @@ class SubscribeAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error displayed trying to subscribe when not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }

View File

@ -48,7 +48,7 @@ class UnsubscribeAction extends Action
{ {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed when trying to unsubscribe while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return; return;
} }
@ -66,6 +66,7 @@ class UnsubscribeAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. ' . $this->clientError(_('There was a problem with your session token. ' .
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -167,6 +167,7 @@ class UrlsettingsAction extends SettingsAction
// 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: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;

View File

@ -54,7 +54,7 @@ class UseradminpanelAction extends AdminPanelAction
*/ */
function title() function title()
{ {
// TRANS: User admin panel title // TRANS: User admin panel title.
return _m('TITLE', 'User'); return _m('TITLE', 'User');
} }
@ -172,6 +172,7 @@ class UseradminpanelAction extends AdminPanelAction
} }
} }
// @todo FIXME: Class documentation missing.
class UserAdminPanelForm extends AdminForm class UserAdminPanelForm extends AdminForm
{ {
/** /**
@ -212,7 +213,8 @@ class UserAdminPanelForm extends AdminForm
function formData() function formData()
{ {
$this->out->elementStart('fieldset', array('id' => 'settings_user-profile')); $this->out->elementStart('fieldset', array('id' => 'settings_user-profile'));
$this->out->element('legend', null, _('Profile')); // TRANS: Fieldset legend in user administration panel.
$this->out->element('legend', null, _m('LEGEND','Profile'));
$this->out->elementStart('ul', 'form_data'); $this->out->elementStart('ul', 'form_data');
$this->li(); $this->li();

View File

@ -50,6 +50,7 @@ class UserauthorizationAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
$srv = $this->getStoredParams(); $srv = $this->getStoredParams();
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm($srv->getRemoteUser(), _('There was a problem ' . $this->showForm($srv->getRemoteUser(), _('There was a problem ' .
'with your session token. Try again, ' . 'with your session token. Try again, ' .
'please.')); 'please.'));

View File

@ -37,6 +37,7 @@ class UserrssAction extends Rss10Action
$this->tag = $this->trimmed('tag'); $this->tag = $this->trimmed('tag');
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed when user not found for an action.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return false; return false;
} else { } else {
@ -105,6 +106,7 @@ class UserrssAction extends Rss10Action
$profile = $user->getProfile(); $profile = $user->getProfile();
if (!$profile) { if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__); common_log_db_error($user, 'SELECT', __FILE__);
// TRANS: Server error displayed in user RSS when user does not have a matching profile.
$this->serverError(_('User without matching profile.')); $this->serverError(_('User without matching profile.'));
return null; return null;
} }

View File

@ -56,6 +56,7 @@ class UserxrdAction extends XrdAction
} }
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed when user not found for an action.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }

View File

@ -351,6 +351,7 @@ class Notice extends Memcached_DataObject
$repeat = Notice::staticGet('id', $repeat_of); $repeat = Notice::staticGet('id', $repeat_of);
if (empty($repeat)) { if (empty($repeat)) {
// TRANS: Client exception thrown in notice when trying to repeat a missing or deleted notice.
throw new ClientException(_('Cannot repeat; original notice is missing or deleted.')); throw new ClientException(_('Cannot repeat; original notice is missing or deleted.'));
} }
@ -420,6 +421,18 @@ class Notice extends Memcached_DataObject
$notice->scope = $scope; $notice->scope = $scope;
} }
// For private streams
$user = $profile->getUser();
if (!empty($user)) {
if ($user->private_stream &&
($notice->scope == Notice::PUBLIC_SCOPE ||
$notice->scope == Notice::SITE_SCOPE)) {
$notice->scope |= Notice::FOLLOWER_SCOPE;
}
}
if (Event::handle('StartNoticeSave', array(&$notice))) { if (Event::handle('StartNoticeSave', array(&$notice))) {
// XXX: some of these functions write to the DB // XXX: some of these functions write to the DB

View File

@ -63,6 +63,7 @@ class User extends Memcached_DataObject
public $inboxed; // tinyint(1) public $inboxed; // tinyint(1)
public $design_id; // int(4) public $design_id; // int(4)
public $viewdesigns; // tinyint(1) default_1 public $viewdesigns; // tinyint(1) default_1
public $private_stream; // tinyint(1) default_0
public $created; // datetime() not_null public $created; // datetime() not_null
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP

View File

@ -633,6 +633,7 @@ urlshorteningservice = 2
inboxed = 17 inboxed = 17
design_id = 1 design_id = 1
viewdesigns = 17 viewdesigns = 17
private_stream = 17
created = 142 created = 142
modified = 384 modified = 384

View File

@ -123,6 +123,7 @@ $schema['user'] = array(
'inboxed' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'has an inbox been created for this user?'), 'inboxed' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'has an inbox been created for this user?'),
'design_id' => array('type' => 'int', 'description' => 'id of a design'), 'design_id' => array('type' => 'int', 'description' => 'id of a design'),
'viewdesigns' => array('type' => 'int', 'size' => 'tiny', 'default' => 1, 'description' => 'whether to view user-provided designs'), 'viewdesigns' => array('type' => 'int', 'size' => 'tiny', 'default' => 1, 'description' => 'whether to view user-provided designs'),
'private_stream' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'whether to limit all notices to followers only'),
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'), 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'), 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
@ -724,7 +725,8 @@ $schema['user_group'] = array(
'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universal identifier'), 'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universal identifier'),
'mainpage' => array('type' => 'varchar', 'length' => 255, 'description' => 'page for group info to link to'), 'mainpage' => array('type' => 'varchar', 'length' => 255, 'description' => 'page for group info to link to'),
'join_policy' => array('type' => 'int', 'size' => 'tiny', 'description' => '0=open; 1=requires admin approval'), 'join_policy' => array('type' => 'int', 'size' => 'tiny', 'description' => '0=open; 1=requires admin approval'),
'force_scope' => array('type' => 'int', 'size' => 'tiny', 'description' => '0=never,1=sometimes,-1=always'),
), ),
'primary key' => array('id'), 'primary key' => array('id'),
'unique keys' => array( 'unique keys' => array(

View File

@ -106,20 +106,20 @@ function handleError($error)
$_cur = null; $_cur = null;
$msg = sprintf( $msg = sprintf(
_( // TRANS: Database error message.
'The database for %s isn\'t responding correctly, '. _('The database for %1$s is not responding correctly, '.
'so the site won\'t work properly. '. 'so the site will not work properly. '.
'The site admins probably know about the problem, '. 'The site admins probably know about the problem, '.
'but you can contact them at %s to make sure. '. 'but you can contact them at %2$s to make sure. '.
'Otherwise, wait a few minutes and try again.' 'Otherwise, wait a few minutes and try again.'
), ),
common_config('site', 'name'), common_config('site', 'name'),
common_config('site', 'email') common_config('site', 'email')
); );
} else { } else {
$msg = _( // TRANS: Error message.
'An important error occured, probably related to email setup. '. $msg = _('An important error occured, probably related to email setup. '.
'Check logfiles for more info..' 'Check logfiles for more info.'
); );
} }
@ -127,6 +127,7 @@ function handleError($error)
$dac->showPage(); $dac->showPage();
} catch (Exception $e) { } catch (Exception $e) {
// TRANS: Error message.
echo _('An error occurred.'); echo _('An error occurred.');
} }
exit(-1); exit(-1);
@ -250,9 +251,9 @@ function main()
if (!_have_config()) { if (!_have_config()) {
$msg = sprintf( $msg = sprintf(
_( // TRANS: Error message displayed when there is no StatusNet configuration file.
"No configuration file found. Try running ". _("No configuration file found. Try running ".
"the installation program first." "the installation program first."
) )
); );
$sac = new ServerErrorAction($msg); $sac = new ServerErrorAction($msg);
@ -281,6 +282,7 @@ function main()
$args = $r->map($path); $args = $r->map($path);
if (!$args) { if (!$args) {
// TRANS: Error message displayed when trying to access a non-existing page.
$cac = new ClientErrorAction(_('Unknown page'), 404); $cac = new ClientErrorAction(_('Unknown page'), 404);
$cac->showPage(); $cac->showPage();
return; return;
@ -335,6 +337,7 @@ function main()
$action_class = ucfirst($action).'Action'; $action_class = ucfirst($action).'Action';
if (!class_exists($action_class)) { if (!class_exists($action_class)) {
// TRANS: Error message displayed when trying to perform an undefined action.
$cac = new ClientErrorAction(_('Unknown action'), 404); $cac = new ClientErrorAction(_('Unknown action'), 404);
$cac->showPage(); $cac->showPage();
} else { } else {

View File

@ -165,7 +165,7 @@ class Action extends HTMLOutputter // lawsuit
{ {
$this->element('title', null, $this->element('title', null,
// TRANS: Page title. %1$s is the title, %2$s is the site name. // TRANS: Page title. %1$s is the title, %2$s is the site name.
sprintf(_("%1\$s - %2\$s"), sprintf(_('%1$s - %2$s'),
$this->title(), $this->title(),
common_config('site', 'name'))); common_config('site', 'name')));
} }
@ -181,7 +181,7 @@ class Action extends HTMLOutputter // lawsuit
function title() function title()
{ {
// TRANS: Page title for a page without a title set. // TRANS: Page title for a page without a title set.
return _("Untitled page"); return _('Untitled page');
} }
/** /**
@ -615,17 +615,16 @@ class Action extends HTMLOutputter // lawsuit
*/ */
function showNoticeForm() function showNoticeForm()
{ {
$tabs = array('status' => _('Status')); // TRANS: Tab on the notice form.
$tabs = array('status' => _m('TAB','Status'));
$this->elementStart('div', 'input_forms'); $this->elementStart('div', 'input_forms');
if (Event::handle('StartShowEntryForms', array(&$tabs))) { if (Event::handle('StartShowEntryForms', array(&$tabs))) {
$this->elementStart('ul', array('class' => 'nav', $this->elementStart('ul', array('class' => 'nav',
'id' => 'input_form_nav')); 'id' => 'input_form_nav'));
foreach ($tabs as $tag => $title) { foreach ($tabs as $tag => $title) {
$attrs = array('id' => 'input_form_nav_'.$tag, $attrs = array('id' => 'input_form_nav_'.$tag,
'class' => 'input_form_nav_tab'); 'class' => 'input_form_nav_tab');
@ -653,7 +652,6 @@ class Action extends HTMLOutputter // lawsuit
$this->elementEnd('div'); $this->elementEnd('div');
foreach ($tabs as $tag => $title) { foreach ($tabs as $tag => $title) {
$attrs = array('class' => 'input_form', $attrs = array('class' => 'input_form',
'id' => 'input_form_'.$tag); 'id' => 'input_form_'.$tag);

View File

@ -704,11 +704,18 @@ class Activity
return ActivityUtils::child($element, $tag, $namespace); return ActivityUtils::child($element, $tag, $namespace);
} }
/**
* For consistency, we'll always output UTC rather than local time.
* Note that clients *should* accept any timezone we give them as long
* as it's properly formatted.
*
* @param int $tm Unix timestamp
* @return string
*/
static function iso8601Date($tm) static function iso8601Date($tm)
{ {
$dateStr = date('d F Y H:i:s', $tm); $dateStr = date('d F Y H:i:s', $tm);
$d = new DateTime($dateStr, new DateTimeZone('UTC')); $d = new DateTime($dateStr, new DateTimeZone('UTC'));
$d->setTimezone(new DateTimeZone(common_timezone()));
return $d->format('c'); return $d->format('c');
} }
} }

View File

@ -81,7 +81,8 @@ 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(sprintf(_("No such user %s."),$act->actor->id)); // TRANS: Exception thrown if no user is provided. %s is a user ID.
throw new Exception(sprintf(_('No such user "%s".'),$act->actor->id));
} }
switch ($act->verb) { switch ($act->verb) {

View File

@ -67,7 +67,7 @@ class AdminPanelAction extends Action
// User must be logged in. // User must be logged in.
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error message thrown when trying to access the admin panel while not logged in. // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc. * Copyright (C) 2011, StatusNet, Inc.
* *
* Menu for admin panels * Menu for admin panels
* *
* PHP version 5 * PHP version 5
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -45,7 +45,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 AdminPanelNav extends Menu class AdminPanelNav extends Menu
{ {
/** /**
@ -62,11 +61,15 @@ class AdminPanelNav extends Menu
// Stub section w/ home link // Stub section w/ home link
$this->action->elementStart('ul'); $this->action->elementStart('ul');
$this->action->element('h3', null, _('Home')); // TRANS: Header in administrator navigation panel.
$this->action->element('h3', null, _m('HEADER','Home'));
$this->action->elementStart('ul', 'nav'); $this->action->elementStart('ul', 'nav');
$this->out->menuItem(common_local_url('all', array('nickname' => $this->out->menuItem(common_local_url('all', array('nickname' =>
$nickname)), $nickname)),
_('Home'), // TRANS: Menu item in administrator navigation panel.
_m('MENU','Home'),
// TRANS: Menu item title in administrator navigation panel.
// TRANS: %s is a username.
sprintf(_('%s and friends'), $name), sprintf(_('%s and friends'), $name),
$this->action == 'all', 'nav_timeline_personal'); $this->action == 'all', 'nav_timeline_personal');
@ -74,88 +77,89 @@ class AdminPanelNav extends Menu
$this->action->elementEnd('ul'); $this->action->elementEnd('ul');
$this->action->elementStart('ul'); $this->action->elementStart('ul');
$this->action->element('h3', null, _('Admin')); // TRANS: Header in administrator navigation panel.
$this->action->element('h3', null, _m('HEADER','Admin'));
$this->action->elementStart('ul', array('class' => 'nav')); $this->action->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartAdminPanelNav', array($this))) { if (Event::handle('StartAdminPanelNav', array($this))) {
if (AdminPanelAction::canAdmin('site')) { if (AdminPanelAction::canAdmin('site')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Basic site configuration'); $menu_title = _('Basic site configuration');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('siteadminpanel'), _m('MENU', 'Site'), $this->out->menuItem(common_local_url('siteadminpanel'), _m('MENU', 'Site'),
$menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel'); $menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel');
} }
if (AdminPanelAction::canAdmin('design')) { if (AdminPanelAction::canAdmin('design')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Design configuration'); $menu_title = _('Design configuration');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('designadminpanel'), _m('MENU', 'Design'), $this->out->menuItem(common_local_url('designadminpanel'), _m('MENU', 'Design'),
$menu_title, $action_name == 'designadminpanel', 'nav_design_admin_panel'); $menu_title, $action_name == 'designadminpanel', 'nav_design_admin_panel');
} }
if (AdminPanelAction::canAdmin('user')) { if (AdminPanelAction::canAdmin('user')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('User configuration'); $menu_title = _('User configuration');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('useradminpanel'), _('User'), $this->out->menuItem(common_local_url('useradminpanel'), _m('MENU','User'),
$menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel'); $menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel');
} }
if (AdminPanelAction::canAdmin('access')) { if (AdminPanelAction::canAdmin('access')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Access configuration'); $menu_title = _('Access configuration');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('accessadminpanel'), _('Access'), $this->out->menuItem(common_local_url('accessadminpanel'), _m('MENU','Access'),
$menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel'); $menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel');
} }
if (AdminPanelAction::canAdmin('paths')) { if (AdminPanelAction::canAdmin('paths')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Paths configuration'); $menu_title = _('Paths configuration');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('pathsadminpanel'), _('Paths'), $this->out->menuItem(common_local_url('pathsadminpanel'), _m('MENU','Paths'),
$menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel'); $menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel');
} }
if (AdminPanelAction::canAdmin('sessions')) { if (AdminPanelAction::canAdmin('sessions')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Sessions configuration'); $menu_title = _('Sessions configuration');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('sessionsadminpanel'), _('Sessions'), $this->out->menuItem(common_local_url('sessionsadminpanel'), _m('MENU','Sessions'),
$menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel'); $menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel');
} }
if (AdminPanelAction::canAdmin('sitenotice')) { if (AdminPanelAction::canAdmin('sitenotice')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Edit site notice'); $menu_title = _('Edit site notice');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('sitenoticeadminpanel'), _('Site notice'), $this->out->menuItem(common_local_url('sitenoticeadminpanel'), _m('MENU','Site notice'),
$menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel'); $menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel');
} }
if (AdminPanelAction::canAdmin('snapshot')) { if (AdminPanelAction::canAdmin('snapshot')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Snapshots configuration'); $menu_title = _('Snapshots configuration');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('snapshotadminpanel'), _('Snapshots'), $this->out->menuItem(common_local_url('snapshotadminpanel'), _m('MENU','Snapshots'),
$menu_title, $action_name == 'snapshotadminpanel', 'nav_snapshot_admin_panel'); $menu_title, $action_name == 'snapshotadminpanel', 'nav_snapshot_admin_panel');
} }
if (AdminPanelAction::canAdmin('license')) { if (AdminPanelAction::canAdmin('license')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Set site license'); $menu_title = _('Set site license');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('licenseadminpanel'), _('License'), $this->out->menuItem(common_local_url('licenseadminpanel'), _m('MENU','License'),
$menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel'); $menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel');
} }
if (AdminPanelAction::canAdmin('plugins')) { if (AdminPanelAction::canAdmin('plugins')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Plugins configuration'); $menu_title = _('Plugins configuration');
// TRANS: Menu item for site administration // TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('pluginsadminpanel'), _('Plugins'), $this->out->menuItem(common_local_url('pluginsadminpanel'), _m('MENU','Plugins'),
$menu_title, $action_name == 'pluginsadminpanel', 'nav_design_admin_panel'); $menu_title, $action_name == 'pluginsadminpanel', 'nav_design_admin_panel');
} }

View File

@ -199,6 +199,7 @@ class ApiAuthAction extends ApiAction
$user = User::staticGet('id', $appUser->profile_id); $user = User::staticGet('id', $appUser->profile_id);
if (!empty($user)) { if (!empty($user)) {
if (!$user->hasRight(Right::API)) { if (!$user->hasRight(Right::API)) {
// TRANS: Authorization exception thrown when a user without API access tries to access the API.
throw new AuthorizationException(_('Not allowed to use API.')); throw new AuthorizationException(_('Not allowed to use API.'));
} }
} }
@ -225,7 +226,7 @@ class ApiAuthAction extends ApiAction
throw new OAuthException(_('Bad access token.')); throw new OAuthException(_('Bad access token.'));
} }
} else { } else {
// Also should not happen // Also should not happen.
// TRANS: OAuth exception given when no user was found for a given token (no token was found). // TRANS: OAuth exception given when no user was found for a given token (no token was found).
throw new OAuthException(_('No user for that token.')); throw new OAuthException(_('No user for that token.'));
} }
@ -281,6 +282,7 @@ class ApiAuthAction extends ApiAction
if (!empty($user)) { if (!empty($user)) {
if (!$user->hasRight(Right::API)) { if (!$user->hasRight(Right::API)) {
// TRANS: Authorization exception thrown when a user without API access tries to access the API.
throw new AuthorizationException(_('Not allowed to use API.')); throw new AuthorizationException(_('Not allowed to use API.'));
} }
$this->auth_user = $user; $this->auth_user = $user;

View File

@ -21,6 +21,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once INSTALLDIR . '/lib/oauthstore.php'; require_once INSTALLDIR . '/lib/oauthstore.php';
// @todo FIXME: Class documentation missing.
class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
{ {
function lookup_consumer($consumerKey) function lookup_consumer($consumerKey)
@ -65,7 +66,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
$id = $app->insert(); $id = $app->insert();
if (!$id) { if (!$id) {
// TRANS: Server error displayed when trying to create an anynymous OAuth application. // TRANS: Server error displayed when trying to create an anynymous OAuth application.
$this->serverError(_("Could not create anonymous OAuth application.")); $this->serverError(_("Could not create anonymous OAuth application."));
} }
} }
@ -90,7 +91,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
); );
if (empty($req_token)) { if (empty($req_token)) {
common_debug("couldn't get request token from oauth datastore"); common_debug("Couldn't get request token from oauth datastore");
return null; return null;
} }
@ -312,8 +313,8 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
if (!$result) { if (!$result) {
common_log_db_error($appUser, 'INSERT', __FILE__); common_log_db_error($appUser, 'INSERT', __FILE__);
// TRANS: Server error displayed when a database error occurs.
throw new Exception( throw new Exception(
// TRANS: Exception thrown when a database error occurs.
_('Database error inserting OAuth application user.') _('Database error inserting OAuth application user.')
); );
} }
@ -340,8 +341,8 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
if (!$result) { if (!$result) {
common_log_db_error($appUser, 'UPDATE', __FILE__); common_log_db_error($appUser, 'UPDATE', __FILE__);
// TRANS: Server error displayed when a database error occurs.
throw new Exception( throw new Exception(
// TRANS: Exception thrown when a database error occurs.
_('Database error updating OAuth application user.') _('Database error updating OAuth application user.')
); );
} }

View File

@ -198,7 +198,7 @@ class ApplicationEditForm extends Form
if ($maxDesc > 0) { if ($maxDesc > 0) {
// TRANS: Form input field instructions. // TRANS: Form input field instructions.
// TRANS: %d is the number of available characters for the description. // TRANS: %d is the number of available characters for the description.
$descInstr = sprintf(ngettext('Describe your application in %d character','Describe your application in %d characters',$maxDesc), $descInstr = sprintf(_m('Describe your application in %d character','Describe your application in %d characters',$maxDesc),
$maxDesc); $maxDesc);
} else { } else {
// TRANS: Form input field instructions. // TRANS: Form input field instructions.

View File

@ -237,13 +237,16 @@ class ConnectedAppsList extends Widget
$this->out->elementEnd('a'); $this->out->elementEnd('a');
if ($app->name == 'anonymous') { if ($app->name == 'anonymous') {
$this->out->element('span', 'fn', "Unknown application"); // TRANS: Name for an anonymous application in application list.
$this->out->element('span', 'fn', _('Unknown application'));
} }
$this->out->elementEnd('span'); $this->out->elementEnd('span');
if ($app->name != 'anonymous') { if ($app->name != 'anonymous') {
// @todo FIXME: i18n trouble. // @todo FIXME: i18n trouble.
// TRANS: Message has a leading space and a trailing space. Used in application list.
// TRANS: Before this message the application name is put, behind it the organisation that manages it.
$this->out->raw(_(' by ')); $this->out->raw(_(' by '));
$this->out->element( $this->out->element(
@ -267,6 +270,7 @@ class ConnectedAppsList extends Widget
// TRANS: Used in application list. %1$s is a modified date, %2$s is access type ("read-write" or "read-only") // TRANS: Used in application list. %1$s is a modified date, %2$s is access type ("read-write" or "read-only")
$txt = sprintf(_('Approved %1$s - "%2$s" access.'), $modifiedDate, $access); $txt = sprintf(_('Approved %1$s - "%2$s" access.'), $modifiedDate, $access);
// @todo FIXME: i18n trouble.
$this->out->raw(" - $txt"); $this->out->raw(" - $txt");
if (!empty($app->description)) { if (!empty($app->description)) {
$this->out->element( $this->out->element(
@ -294,7 +298,7 @@ class ConnectedAppsList extends Widget
$this->out->elementStart('fieldset'); $this->out->elementStart('fieldset');
$this->out->hidden('oauth_token', $this->connection->token); $this->out->hidden('oauth_token', $this->connection->token);
$this->out->hidden('token', common_session_token()); $this->out->hidden('token', common_session_token());
// TRANS: Button label // TRANS: Button label in application list to revoke access to user data.
$this->out->submit('revoke', _m('BUTTON','Revoke')); $this->out->submit('revoke', _m('BUTTON','Revoke'));
$this->out->elementEnd('fieldset'); $this->out->elementEnd('fieldset');
$this->out->elementEnd('form'); $this->out->elementEnd('form');

View File

@ -108,8 +108,8 @@ class Atom10Feed extends XMLStringer
if (!empty($name)) { if (!empty($name)) {
$xs->element('name', null, $name); $xs->element('name', null, $name);
} else { } else {
// TRANS: Atom feed exception thrown when an author element does not contain a name element.
throw new Atom10FeedException( throw new Atom10FeedException(
// TRANS: Atom feed exception thrown when an author element does not contain a name element.
_('Author element must contain a name element.') _('Author element must contain a name element.')
); );
} }

View File

@ -922,7 +922,7 @@ class SubscriptionsCommand extends Command
// TRANS: Text shown after requesting other users a user is subscribed to. // TRANS: Text shown after requesting other users a user is subscribed to.
// TRANS: This message supports plural forms. This message is followed by a // TRANS: This message supports plural forms. This message is followed by a
// TRANS: hard coded space and a comma separated list of subscribed users. // TRANS: hard coded space and a comma separated list of subscribed users.
$out = ngettext('You are subscribed to this person:', $out = _m('You are subscribed to this person:',
'You are subscribed to these people:', 'You are subscribed to these people:',
count($nicknames)); count($nicknames));
$out .= ' '; $out .= ' ';
@ -949,7 +949,7 @@ class SubscribersCommand extends Command
// TRANS: Text shown after requesting other users that are subscribed to a user (followers). // TRANS: Text shown after requesting other users that are subscribed to a user (followers).
// TRANS: This message supports plural forms. This message is followed by a // TRANS: This message supports plural forms. This message is followed by a
// TRANS: hard coded space and a comma separated list of subscribing users. // TRANS: hard coded space and a comma separated list of subscribing users.
$out = ngettext('This person is subscribed to you:', $out = _m('This person is subscribed to you:',
'These people are subscribed to you:', 'These people are subscribed to you:',
count($nicknames)); count($nicknames));
$out .= ' '; $out .= ' ';
@ -976,7 +976,7 @@ class GroupsCommand extends Command
// TRANS: Text shown after requesting groups a user is subscribed to. // TRANS: Text shown after requesting groups a user is subscribed to.
// TRANS: This message supports plural forms. This message is followed by a // TRANS: This message supports plural forms. This message is followed by a
// TRANS: hard coded space and a comma separated list of subscribed groups. // TRANS: hard coded space and a comma separated list of subscribed groups.
$out = ngettext('You are a member of this group:', $out = _m('You are a member of this group:',
'You are a member of these groups:', 'You are a member of these groups:',
count($nicknames)); count($nicknames));
$out.=implode(', ',$groups); $out.=implode(', ',$groups);

View File

@ -56,6 +56,7 @@ class DBErrorAction extends ServerErrorAction
function title() function title()
{ {
// TRANS: Page title for when a database error occurs.
return _('Database error'); return _('Database error');
} }

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc. * Copyright (C) 2011, StatusNet, Inc.
* *
* Default local nav * Default local nav
* *
* PHP version 5 * PHP version 5
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -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 DefaultLocalNav extends Menu class DefaultLocalNav extends Menu
{ {
function show() function show()
@ -55,11 +54,13 @@ class DefaultLocalNav extends Menu
if (!empty($user)) { if (!empty($user)) {
$pn = new PersonalGroupNav($this->action); $pn = new PersonalGroupNav($this->action);
$this->submenu(_m('Home'), $pn); // TRANS: Menu item in default local navigation panel.
$this->submenu(_m('MENU','Home'), $pn);
} }
$bn = new PublicGroupNav($this->action); $bn = new PublicGroupNav($this->action);
$this->submenu(_('Public'), $bn); // TRANS: Menu item in default local navigation panel.
$this->submenu(_m('MENU','Public'), $bn);
$this->action->elementEnd('ul'); $this->action->elementEnd('ul');
} }

View File

@ -47,13 +47,11 @@ if (!defined('STATUSNET')) {
* @see UnsubscribeForm * @see UnsubscribeForm
* @fixme merge a bunch of this stuff with similar form types to reduce boilerplate * @fixme merge a bunch of this stuff with similar form types to reduce boilerplate
*/ */
class DeleteGroupForm extends Form class DeleteGroupForm extends Form
{ {
/** /**
* group for user to delete * group for user to delete
*/ */
var $group = null; var $group = null;
/** /**
@ -62,7 +60,6 @@ class DeleteGroupForm extends Form
* @param HTMLOutputter $out output channel * @param HTMLOutputter $out output channel
* @param group $group group to join * @param group $group group to join
*/ */
function __construct($out=null, $group=null) function __construct($out=null, $group=null)
{ {
parent::__construct($out); parent::__construct($out);
@ -75,7 +72,6 @@ class DeleteGroupForm extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'group-delete-' . $this->group->id; return 'group-delete-' . $this->group->id;
@ -86,7 +82,6 @@ class DeleteGroupForm extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_group_delete'; return 'form_group_delete';
@ -97,7 +92,6 @@ class DeleteGroupForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return common_local_url('deletegroup', return common_local_url('deletegroup',
@ -115,9 +109,9 @@ class DeleteGroupForm extends Form
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', _('Delete')); // TRANS: Button text for deleting a group.
$this->out->submit('submit', _m('BUTTON','Delete'));
} }
} }

View File

@ -45,7 +45,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @link http://status.net/ * @link http://status.net/
* *
*/ */
class DesignForm extends Form class DesignForm extends Form
{ {
/** /**
@ -62,7 +61,6 @@ class DesignForm extends Form
* @param Design $design initial design * @param Design $design initial design
* @param Design $actionurl url of action (for form posting) * @param Design $actionurl url of action (for form posting)
*/ */
function __construct($out, $design, $actionurl) function __construct($out, $design, $actionurl)
{ {
parent::__construct($out); parent::__construct($out);
@ -76,7 +74,6 @@ class DesignForm extends Form
* *
* @return int ID of the form * @return int ID of the form
*/ */
function id() function id()
{ {
return 'design'; return 'design';
@ -87,7 +84,6 @@ class DesignForm extends Form
* *
* @return string class of the form * @return string class of the form
*/ */
function formClass() function formClass()
{ {
return 'form_design'; return 'form_design';
@ -98,7 +94,6 @@ class DesignForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return $this->actionurl; return $this->actionurl;
@ -111,6 +106,7 @@ class DesignForm extends Form
*/ */
function formLegend() function formLegend()
{ {
// TRANS: Form legend of form for changing the page design.
$this->out->element('legend', null, _('Change design')); $this->out->element('legend', null, _('Change design'));
} }
@ -119,7 +115,6 @@ class DesignForm extends Form
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
$this->backgroundData(); $this->backgroundData();
@ -137,7 +132,7 @@ class DesignForm extends Form
// TRANS: Button text on profile design page to immediately reset all colour settings to default. // TRANS: Button text on profile design page to immediately reset all colour settings to default.
$this->out->submit('defaults', _('Use defaults'), 'submit form_action-default', $this->out->submit('defaults', _('Use defaults'), 'submit form_action-default',
// TRANS: Title for button on profile design page to reset all colour settings to default. // TRANS: Title for button on profile design page to reset all colour settings to default.
'defaults', _('Restore default designs')); 'defaults', _('Restore default designs.'));
$this->out->element('input', array('id' => 'settings_design_reset', $this->out->element('input', array('id' => 'settings_design_reset',
'type' => 'reset', 'type' => 'reset',
@ -145,7 +140,7 @@ class DesignForm extends Form
'value' => _m('BUTTON', 'Reset'), 'value' => _m('BUTTON', 'Reset'),
'class' => 'submit form_action-primary', 'class' => 'submit form_action-primary',
// TRANS: Title for button on profile design page to reset all colour settings to default without saving. // TRANS: Title for button on profile design page to reset all colour settings to default without saving.
'title' => _('Reset back to default'))); 'title' => _('Reset back to default.')));
} }
function backgroundData() function backgroundData()
@ -161,7 +156,7 @@ class DesignForm extends Form
'id' => 'design_background-image_file')); 'id' => 'design_background-image_file'));
// TRANS: Instructions for form on profile design page. // TRANS: Instructions for form on profile design page.
$this->out->element('p', 'form_guide', _('You can upload your personal ' . $this->out->element('p', 'form_guide', _('You can upload your personal ' .
'background image. The maximum file size is 2Mb.')); 'background image. The maximum file size is 2MB.'));
$this->out->element('input', array('name' => 'MAX_FILE_SIZE', $this->out->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden', 'type' => 'hidden',
'id' => 'MAX_FILE_SIZE', 'id' => 'MAX_FILE_SIZE',
@ -319,6 +314,6 @@ class DesignForm extends Form
// TRANS: Button text on profile design page to save settings. // TRANS: Button text on profile design page to save settings.
$this->out->submit('save', _m('BUTTON','Save'), 'submit form_action-secondary', $this->out->submit('save', _m('BUTTON','Save'), 'submit form_action-secondary',
// TRANS: Title for button on profile design page to save settings. // TRANS: Title for button on profile design page to save settings.
'save', _('Save design')); 'save', _('Save design.'));
} }
} }

View File

@ -119,6 +119,7 @@ class DesignSettingsAction extends SettingsAction
// 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: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;
@ -213,7 +214,7 @@ class DesignSettingsAction extends SettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($design, 'UPDATE', __FILE__); common_log_db_error($design, 'UPDATE', __FILE__);
// TRANS: Error message displayed if design settings could not be saved. // TRANS: Error message displayed if design settings could not be saved.
$this->showForm(_('Couldn\'t update your design.')); $this->showForm(_('Could not update your design.'));
return; return;
} }
} }
@ -235,7 +236,7 @@ class DesignSettingsAction extends SettingsAction
if ($result === false) { if ($result === false) {
common_log_db_error($design, 'DELETE', __FILE__); common_log_db_error($design, 'DELETE', __FILE__);
// TRANS: Error message displayed if design settings could not be saved after clicking "Use defaults". // TRANS: Error message displayed if design settings could not be saved after clicking "Use defaults".
$this->showForm(_('Couldn\'t update your design.')); $this->showForm(_('Could not update your design.'));
return; return;
} }
} }

View File

@ -81,12 +81,16 @@ class Feed
{ {
switch ($this->type) { switch ($this->type) {
case Feed::RSS1: case Feed::RSS1:
// TRANS: Feed type name.
return _('RSS 1.0'); return _('RSS 1.0');
case Feed::RSS2: case Feed::RSS2:
// TRANS: Feed type name.
return _('RSS 2.0'); return _('RSS 2.0');
case Feed::ATOM: case Feed::ATOM:
// TRANS: Feed type name.
return _('Atom'); return _('Atom');
case Feed::FOAF: case Feed::FOAF:
// TRANS: Feed type name. FOAF stands for Friend of a Friend.
return _('FOAF'); return _('FOAF');
default: default:
return null; return null;

View File

@ -4,7 +4,7 @@
* Copyright (C) 2010, StatusNet, Inc. * Copyright (C) 2010, StatusNet, Inc.
* *
* Importer for feeds of activities * Importer for feeds of activities
* *
* PHP version 5 * PHP version 5
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -47,7 +47,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 FeedImporter extends QueueHandler class FeedImporter extends QueueHandler
{ {
/** /**
@ -55,7 +54,6 @@ class FeedImporter extends QueueHandler
* *
* @return string identifier for this queue handler * @return string identifier for this queue handler
*/ */
public function transport() public function transport()
{ {
return 'feedimp'; return 'feedimp';
@ -72,13 +70,15 @@ class FeedImporter extends QueueHandler
if ($feed->namespaceURI != Activity::ATOM || if ($feed->namespaceURI != Activity::ATOM ||
$feed->localName != 'feed') { $feed->localName != 'feed') {
throw new ClientException(_("Not an atom feed.")); // TRANS: Client exception thrown when an imported feed is not an Atom feed.
throw new ClientException(_("Not an Atom feed."));
} }
$author = ActivityUtils::getFeedAuthor($feed); $author = ActivityUtils::getFeedAuthor($feed);
if (empty($author)) { if (empty($author)) {
// TRANS: Client exception thrown when an imported feed does not have an author.
throw new ClientException(_("No author in the feed.")); throw new ClientException(_("No author in the feed."));
} }
@ -86,7 +86,9 @@ class FeedImporter extends QueueHandler
if ($trusted) { if ($trusted) {
$user = $this->userFromAuthor($author); $user = $this->userFromAuthor($author);
} else { } else {
throw new ClientException(_("Can't import without a user.")); // TRANS: Client exception thrown when an imported feed does not have an author that
// TRANS: can be associated with a user.
throw new ClientException(_("Cannot import without a user."));
} }
} }
@ -127,7 +129,6 @@ class FeedImporter extends QueueHandler
/** /**
* Sort activities oldest-first * Sort activities oldest-first
*/ */
static function activitySort($a, $b) static function activitySort($a, $b)
{ {
if ($a->time == $b->time) { if ($a->time == $b->time) {
@ -154,7 +155,7 @@ class FeedImporter extends QueueHandler
$profile = $user->getProfile(); $profile = $user->getProfile();
Ostatus_profile::updateProfile($profile, $author); Ostatus_profile::updateProfile($profile, $author);
// FIXME: Update avatar // @todo FIXME: Update avatar
return $user; return $user;
} }
} }

Some files were not shown because too many files have changed in this diff Show More