Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x

This commit is contained in:
Brion Vibber 2011-04-03 15:23:27 -07:00
commit 894ef35259
1461 changed files with 49622 additions and 15412 deletions

View File

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

View File

@ -88,7 +88,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format

View File

@ -90,7 +90,7 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format

View File

@ -88,7 +88,7 @@ class ApiAccountUpdateProfileBackgroundImageAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format

View File

@ -111,7 +111,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format

View File

@ -64,7 +64,7 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
parent::handle($args);
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);
return;
}

View File

@ -92,7 +92,7 @@ class ApiBlockCreateAction extends ApiAuthAction
}
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);
return;
}

View File

@ -153,7 +153,7 @@ class ApiDirectMessageAction extends ApiAuthAction
$this->showJsonDirectMessages();
break;
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);
break;
}

View File

@ -94,7 +94,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format

View File

@ -94,7 +94,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format

View File

@ -95,7 +95,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format

View File

@ -95,7 +95,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format

View File

@ -120,7 +120,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
parent::handle($args);
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);
return;
}

View File

@ -134,7 +134,7 @@ class ApiGroupCreateAction extends ApiAuthAction
break;
default:
$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.'),
404,
$this->format

View File

@ -111,7 +111,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
break;
default:
$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.'),
400,
$this->format

View File

@ -144,7 +144,7 @@ class ApiGroupJoinAction extends ApiAuthAction
break;
default:
$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.'),
404,
$this->format

View File

@ -134,7 +134,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
break;
default:
$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.'),
404,
$this->format

View File

@ -67,6 +67,7 @@ class ApiGroupListAction extends ApiBareAuthAction
$this->user = $this->getTargetUser(null);
if (empty($this->user)) {
// TRANS: Client error displayed when user not found for an action.
$this->clientError(_('No such user.'), 404, $this->format);
return false;
}
@ -130,7 +131,7 @@ class ApiGroupListAction extends ApiBareAuthAction
break;
default:
$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.'),
404,
$this->format

View File

@ -116,7 +116,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
break;
default:
$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.'),
404,
$this->format

View File

@ -101,7 +101,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
break;
default:
$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.'),
404,
$this->format

View File

@ -85,6 +85,7 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error message. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400, $this->format
);
@ -93,7 +94,7 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404,
$this->format
@ -211,7 +212,7 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction
$this->showSingleJsonGroup($this->group);
break;
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);
break;
}

View File

@ -110,7 +110,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
$this->showSingleJsonGroup($this->group);
break;
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);
break;
}

View File

@ -80,7 +80,7 @@ class ApiHelpTestAction extends ApiPrivateAuthAction
$this->endDocument('json');
} else {
$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.'),
404,
$this->format

View File

@ -97,7 +97,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$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.'),
404
);

View File

@ -106,7 +106,7 @@ class ApiStatusesRetweetsAction extends ApiAuthAction
$this->showJsonTimeline($strm);
break;
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);
break;
}

View File

@ -101,7 +101,7 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
parent::handle($args);
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);
return;
}

View File

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

View File

@ -135,7 +135,7 @@ class ApiStatusnetConfigAction extends ApiAction
break;
default:
$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.'),
404,
$this->format

View File

@ -87,7 +87,7 @@ class ApiStatusnetVersionAction extends ApiPrivateAuthAction
break;
default:
$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.'),
404,
$this->format

View File

@ -105,7 +105,7 @@ class ApiSubscriptionsAction extends ApiBareAuthAction
parent::handle($args);
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);
return;
}

View File

@ -178,7 +178,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -204,6 +204,8 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$profile = $this->user->getProfile();
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$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);
$taguribase = TagURI::base();
$id = "tag:$taguribase:FriendsTimeline:" . $this->user->id;
@ -272,7 +274,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -177,7 +177,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -178,7 +178,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -243,7 +243,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -146,7 +146,7 @@ class ApiTimelineRetweetedToMeAction extends ApiAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -101,6 +101,8 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
$profile = $this->auth_user->getProfile();
$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.'),
$sitename, $this->auth_user->nickname, $profile->getBestName()
);
@ -143,7 +145,7 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -161,7 +161,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -213,7 +213,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
$this->raw($doc->asString());
break;
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);
break;
}

View File

@ -96,7 +96,7 @@ class ApiUserShowAction extends ApiPrivateAuthAction
}
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);
return;
}

View File

@ -277,6 +277,7 @@ class AvatarsettingsAction extends SettingsAction
$token = $this->trimmed('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.'));
return;

View File

@ -71,6 +71,7 @@ class CancelsubscriptionAction extends Action
$token = $this->trimmed('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.'));
return;

View File

@ -99,6 +99,7 @@ class DeleteapplicationAction extends Action
// CSRF protection
$token = $this->trimmed('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.'));
return;
}

View File

@ -174,6 +174,7 @@ class DeletenoticeAction extends Action
$token = $this->trimmed('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.'));
return;

View File

@ -128,6 +128,7 @@ class EditApplicationAction extends OwnerDesignAction
// CSRF protection
$token = $this->trimmed('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.'));
return;
}

View File

@ -207,45 +207,45 @@ class EmailsettingsAction extends SettingsAction
$this->elementStart('ul', 'form_data');
if (Event::handle('StartEmailFormData', array($this))) {
$this->elementStart('li');
$this->checkbox('emailnotifysub',
// TRANS: Checkbox label in e-mail preferences form.
_('Send me notices of new subscriptions through email.'),
$user->emailnotifysub);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailnotifyfav',
// TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone '.
'adds my notice as a favorite.'),
$user->emailnotifyfav);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailnotifymsg',
// TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone sends me a private message.'),
$user->emailnotifymsg);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailnotifyattn',
// TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone sends me an "@-reply".'),
$user->emailnotifyattn);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailnotifynudge',
// TRANS: Checkbox label in e-mail preferences form.
_('Allow friends to nudge me and send me an email.'),
$user->emailnotifynudge);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailmicroid',
// TRANS: Checkbox label in e-mail preferences form.
_('Publish a MicroID for my email address.'),
$user->emailmicroid);
$this->elementEnd('li');
Event::handle('EndEmailFormData', array($this));
}
$this->elementStart('li');
$this->checkbox('emailnotifysub',
// TRANS: Checkbox label in e-mail preferences form.
_('Send me notices of new subscriptions through email.'),
$user->emailnotifysub);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailnotifyfav',
// TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone '.
'adds my notice as a favorite.'),
$user->emailnotifyfav);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailnotifymsg',
// TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone sends me a private message.'),
$user->emailnotifymsg);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailnotifyattn',
// TRANS: Checkbox label in e-mail preferences form.
_('Send me email when someone sends me an "@-reply".'),
$user->emailnotifyattn);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailnotifynudge',
// TRANS: Checkbox label in e-mail preferences form.
_('Allow friends to nudge me and send me an email.'),
$user->emailnotifynudge);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('emailmicroid',
// TRANS: Checkbox label in e-mail preferences form.
_('Publish a MicroID for my email address.'),
$user->emailmicroid);
$this->elementEnd('li');
Event::handle('EndEmailFormData', array($this));
}
$this->elementEnd('ul');
// TRANS: Button label to save e-mail preferences.
$this->submit('save', _m('BUTTON','Save'));
@ -289,6 +289,7 @@ class EmailsettingsAction extends SettingsAction
// CSRF protection
$token = $this->trimmed('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. '.
'Try again, please.'));
return;
@ -319,48 +320,47 @@ class EmailsettingsAction extends SettingsAction
*/
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');
$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
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;
$user->emailnotifyfav = $emailnotifyfav;
$user->emailnotifymsg = $emailnotifymsg;
$user->emailnotifynudge = $emailnotifynudge;
$user->emailnotifyattn = $emailnotifyattn;
$user->emailmicroid = $emailmicroid;
$user->emailpost = $emailpost;
$result = $user->update($original);
$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) {
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');
$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

@ -72,6 +72,7 @@ class FavorAction extends Action
$notice = Notice::staticGet($id);
$token = $this->trimmed('token-'.$notice->id);
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.'));
return;
}

View File

@ -52,6 +52,7 @@ class GeocodeAction extends Action
parent::prepare($args);
$token = $this->trimmed('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.'));
}

View File

@ -62,6 +62,7 @@ class GroupblockAction extends RedirectingAction
}
$token = $this->trimmed('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.'));
return;
}

View File

@ -62,6 +62,7 @@ class GroupunblockAction extends Action
}
$token = $this->trimmed('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.'));
return;
}

View File

@ -240,6 +240,7 @@ class ImsettingsAction extends SettingsAction
// CSRF protection
$token = $this->trimmed('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.'));
return;

View File

@ -57,6 +57,7 @@ class InviteAction extends CurrentUserDesignAction
// CSRF protection
$token = $this->trimmed('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.'));
return;
}

View File

@ -64,6 +64,7 @@ class MakeadminAction extends RedirectingAction
}
$token = $this->trimmed('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.'));
return;
}

View File

@ -109,6 +109,7 @@ class NewApplicationAction extends OwnerDesignAction
// CSRF protection
$token = $this->trimmed('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.'));
return;
}

View File

@ -137,6 +137,7 @@ class NewmessageAction extends Action
$token = $this->trimmed('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.'));
return;

View File

@ -101,6 +101,7 @@ class NewnoticeAction extends Action
// CSRF protection
$token = $this->trimmed('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.'));
}
@ -180,6 +181,8 @@ class NewnoticeAction extends Action
if (Notice::contentTooLong($content_shortened)) {
$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.',
'Maximum notice size is %d characters, including attachment URL.',
Notice::maxContent()),

View File

@ -78,6 +78,7 @@ class NudgeAction extends Action
$token = $this->trimmed('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.'));
return;
}

View File

@ -132,6 +132,7 @@ class OauthconnectionssettingsAction extends SettingsAction
$token = $this->trimmed('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.'));
return;

View File

@ -143,6 +143,7 @@ class PasswordsettingsAction extends SettingsAction
$token = $this->trimmed('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.'));
return;

View File

@ -84,6 +84,7 @@ class PluginEnableAction extends Action
$token = $this->trimmed('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.'));
return false;

View File

@ -205,7 +205,7 @@ class ProfilesettingsAction extends SettingsAction
}
$this->elementStart('li');
$this->checkbox('private_stream',
// TRANS:
// TRANS: Checkbox label in profile settings.
_('Make updates visible only to my followers'),
($this->arg('private_stream')) ?
$this->boolean('private_stream') : $user->private_stream);

View File

@ -160,6 +160,7 @@ class RegisterAction extends Action
if (Event::handle('StartRegistrationTry', array($this))) {
$token = $this->trimmed('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.'));
return;
@ -211,6 +212,7 @@ class RegisterAction extends Action
// TRANS: Form validation error displayed when trying to register with an invalid nickname.
$this->showForm(_('Not a valid nickname.'));
} 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.'));
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
!Validate::uri($homepage,

View File

@ -74,6 +74,7 @@ class RemotesubscribeAction extends Action
/* Use a session token for CSRF protection. */
$token = $this->trimmed('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.'));
return;

View File

@ -76,6 +76,7 @@ class RepeatAction extends Action
$token = $this->trimmed('token-'.$id);
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.'));
return false;
}

View File

@ -113,6 +113,7 @@ class ShowApplicationAction extends OwnerDesignAction
// CSRF protection
$token = $this->trimmed('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.'));
return;
}

View File

@ -67,11 +67,11 @@ class ShowstreamAction extends ProfileAction
if ($this->page == 1) {
// TRANS: Page title showing tagged notices in one user's stream.
// 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 {
// 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.
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 {
if ($this->page == 1) {
@ -79,7 +79,7 @@ class ShowstreamAction extends ProfileAction
} else {
// TRANS: Extended page title showing tagged notices in one user's stream.
// 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,
$this->page);
}

View File

@ -246,6 +246,7 @@ class SmssettingsAction extends SettingsAction
$token = $this->trimmed('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.'));
return;

View File

@ -37,6 +37,7 @@ class SubeditAction extends Action
$token = $this->trimmed('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.'));
return false;

View File

@ -153,6 +153,7 @@ class TagotherAction extends Action
$token = $this->trimmed('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.'));
return;

View File

@ -66,6 +66,7 @@ class UnsubscribeAction extends Action
$token = $this->trimmed('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.'));
return;

View File

@ -167,6 +167,7 @@ class UrlsettingsAction extends SettingsAction
// CSRF protection
$token = $this->trimmed('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.'));
return;

View File

@ -54,7 +54,7 @@ class UseradminpanelAction extends AdminPanelAction
*/
function title()
{
// TRANS: User admin panel title
// TRANS: User admin panel title.
return _m('TITLE', 'User');
}
@ -172,6 +172,7 @@ class UseradminpanelAction extends AdminPanelAction
}
}
// @todo FIXME: Class documentation missing.
class UserAdminPanelForm extends AdminForm
{
/**
@ -212,7 +213,8 @@ class UserAdminPanelForm extends AdminForm
function formData()
{
$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->li();

View File

@ -50,6 +50,7 @@ class UserauthorizationAction extends Action
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
$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 ' .
'with your session token. Try again, ' .
'please.'));

View File

@ -37,6 +37,7 @@ class UserrssAction extends Rss10Action
$this->tag = $this->trimmed('tag');
if (!$this->user) {
// TRANS: Client error displayed when user not found for an action.
$this->clientError(_('No such user.'));
return false;
} else {
@ -105,6 +106,7 @@ class UserrssAction extends Rss10Action
$profile = $user->getProfile();
if (!$profile) {
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.'));
return null;
}

View File

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

View File

@ -351,6 +351,7 @@ class Notice extends Memcached_DataObject
$repeat = Notice::staticGet('id', $repeat_of);
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.'));
}

View File

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

View File

@ -81,7 +81,8 @@ class ActivityMover extends QueueHandler
function moveActivity($act, $sink, $user, $remote)
{
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) {

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc.
*
* Menu for admin panels
*
*
* PHP version 5
*
* 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
* @link http://status.net/
*/
class AdminPanelNav extends Menu
{
/**
@ -62,11 +61,15 @@ class AdminPanelNav extends Menu
// Stub section w/ home link
$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->out->menuItem(common_local_url('all', array('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),
$this->action == 'all', 'nav_timeline_personal');
@ -74,88 +77,89 @@ class AdminPanelNav extends Menu
$this->action->elementEnd('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'));
if (Event::handle('StartAdminPanelNav', array($this))) {
if (AdminPanelAction::canAdmin('site')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$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'),
$menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel');
}
if (AdminPanelAction::canAdmin('design')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$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'),
$menu_title, $action_name == 'designadminpanel', 'nav_design_admin_panel');
}
if (AdminPanelAction::canAdmin('user')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('User configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('useradminpanel'), _('User'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('useradminpanel'), _m('MENU','User'),
$menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel');
}
if (AdminPanelAction::canAdmin('access')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Access configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('accessadminpanel'), _('Access'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('accessadminpanel'), _m('MENU','Access'),
$menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel');
}
if (AdminPanelAction::canAdmin('paths')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Paths configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('pathsadminpanel'), _('Paths'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('pathsadminpanel'), _m('MENU','Paths'),
$menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel');
}
if (AdminPanelAction::canAdmin('sessions')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Sessions configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('sessionsadminpanel'), _('Sessions'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('sessionsadminpanel'), _m('MENU','Sessions'),
$menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel');
}
if (AdminPanelAction::canAdmin('sitenotice')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Edit site notice');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('sitenoticeadminpanel'), _('Site notice'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('sitenoticeadminpanel'), _m('MENU','Site notice'),
$menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel');
}
if (AdminPanelAction::canAdmin('snapshot')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Snapshots configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('snapshotadminpanel'), _('Snapshots'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('snapshotadminpanel'), _m('MENU','Snapshots'),
$menu_title, $action_name == 'snapshotadminpanel', 'nav_snapshot_admin_panel');
}
if (AdminPanelAction::canAdmin('license')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Set site license');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('licenseadminpanel'), _('License'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('licenseadminpanel'), _m('MENU','License'),
$menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel');
}
if (AdminPanelAction::canAdmin('plugins')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Plugins configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('pluginsadminpanel'), _('Plugins'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('pluginsadminpanel'), _m('MENU','Plugins'),
$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);
if (!empty($user)) {
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.'));
}
}
@ -225,7 +226,7 @@ class ApiAuthAction extends ApiAction
throw new OAuthException(_('Bad access token.'));
}
} 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).
throw new OAuthException(_('No user for that token.'));
}
@ -281,6 +282,7 @@ class ApiAuthAction extends ApiAction
if (!empty($user)) {
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.'));
}
$this->auth_user = $user;

View File

@ -21,6 +21,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once INSTALLDIR . '/lib/oauthstore.php';
// @todo FIXME: Class documentation missing.
class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
{
function lookup_consumer($consumerKey)
@ -65,7 +66,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
$id = $app->insert();
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."));
}
}
@ -90,7 +91,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
);
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;
}
@ -312,8 +313,8 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
if (!$result) {
common_log_db_error($appUser, 'INSERT', __FILE__);
// TRANS: Server error displayed when a database error occurs.
throw new Exception(
// TRANS: Exception thrown when a database error occurs.
_('Database error inserting OAuth application user.')
);
}
@ -340,8 +341,8 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
if (!$result) {
common_log_db_error($appUser, 'UPDATE', __FILE__);
// TRANS: Server error displayed when a database error occurs.
throw new Exception(
// TRANS: Exception thrown when a database error occurs.
_('Database error updating OAuth application user.')
);
}

View File

@ -198,7 +198,7 @@ class ApplicationEditForm extends Form
if ($maxDesc > 0) {
// TRANS: Form input field instructions.
// 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);
} else {
// TRANS: Form input field instructions.

View File

@ -237,13 +237,16 @@ class ConnectedAppsList extends Widget
$this->out->elementEnd('a');
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');
if ($app->name != 'anonymous') {
// @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->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")
$txt = sprintf(_('Approved %1$s - "%2$s" access.'), $modifiedDate, $access);
// @todo FIXME: i18n trouble.
$this->out->raw(" - $txt");
if (!empty($app->description)) {
$this->out->element(
@ -294,7 +298,7 @@ class ConnectedAppsList extends Widget
$this->out->elementStart('fieldset');
$this->out->hidden('oauth_token', $this->connection->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->elementEnd('fieldset');
$this->out->elementEnd('form');

View File

@ -108,8 +108,8 @@ class Atom10Feed extends XMLStringer
if (!empty($name)) {
$xs->element('name', null, $name);
} else {
// TRANS: Atom feed exception thrown when an author element does not contain a name element.
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.')
);
}

View File

@ -824,7 +824,7 @@ class SubscriptionsCommand extends Command
// 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: 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:',
count($nicknames));
$out .= ' ';
@ -851,7 +851,7 @@ class SubscribersCommand extends Command
// 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: 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:',
count($nicknames));
$out .= ' ';
@ -878,7 +878,7 @@ class GroupsCommand extends Command
// TRANS: Text shown after requesting groups a user is subscribed to.
// TRANS: This message supports plural forms. This message is followed by a
// 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:',
count($nicknames));
$out.=implode(', ',$groups);

View File

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

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc.
*
* Default local nav
*
*
* PHP version 5
*
* 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
* @link http://status.net/
*/
class DefaultLocalNav extends Menu
{
function show()
@ -55,11 +54,13 @@ class DefaultLocalNav extends Menu
if (!empty($user)) {
$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);
$this->submenu(_('Public'), $bn);
// TRANS: Menu item in default local navigation panel.
$this->submenu(_m('MENU','Public'), $bn);
$this->action->elementEnd('ul');
}

View File

@ -45,7 +45,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @link http://status.net/
*
*/
class DesignForm extends Form
{
/**
@ -62,7 +61,6 @@ class DesignForm extends Form
* @param Design $design initial design
* @param Design $actionurl url of action (for form posting)
*/
function __construct($out, $design, $actionurl)
{
parent::__construct($out);
@ -76,7 +74,6 @@ class DesignForm extends Form
*
* @return int ID of the form
*/
function id()
{
return 'design';
@ -87,7 +84,6 @@ class DesignForm extends Form
*
* @return string class of the form
*/
function formClass()
{
return 'form_design';
@ -98,7 +94,6 @@ class DesignForm extends Form
*
* @return string URL of the action
*/
function action()
{
return $this->actionurl;
@ -111,6 +106,7 @@ class DesignForm extends Form
*/
function formLegend()
{
// TRANS: Form legend of form for changing the page design.
$this->out->element('legend', null, _('Change design'));
}
@ -119,7 +115,6 @@ class DesignForm extends Form
*
* @return void
*/
function formData()
{
$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.
$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.
'defaults', _('Restore default designs'));
'defaults', _('Restore default designs.'));
$this->out->element('input', array('id' => 'settings_design_reset',
'type' => 'reset',
@ -145,7 +140,7 @@ class DesignForm extends Form
'value' => _m('BUTTON', 'Reset'),
'class' => 'submit form_action-primary',
// 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()
@ -161,7 +156,7 @@ class DesignForm extends Form
'id' => 'design_background-image_file'));
// TRANS: Instructions for form on profile design page.
$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',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
@ -319,6 +314,6 @@ class DesignForm extends Form
// TRANS: Button text on profile design page to save settings.
$this->out->submit('save', _m('BUTTON','Save'), 'submit form_action-secondary',
// 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
$token = $this->trimmed('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.'));
return;

View File

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

View File

@ -4,7 +4,7 @@
* Copyright (C) 2010, StatusNet, Inc.
*
* Importer for feeds of activities
*
*
* PHP version 5
*
* 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
* @link http://status.net/
*/
class FeedImporter extends QueueHandler
{
/**
@ -55,7 +54,6 @@ class FeedImporter extends QueueHandler
*
* @return string identifier for this queue handler
*/
public function transport()
{
return 'feedimp';
@ -72,13 +70,15 @@ class FeedImporter extends QueueHandler
if ($feed->namespaceURI != Activity::ATOM ||
$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);
if (empty($author)) {
// TRANS: Client exception thrown when an imported feed does not have an author.
throw new ClientException(_("No author in the feed."));
}
@ -86,7 +86,9 @@ class FeedImporter extends QueueHandler
if ($trusted) {
$user = $this->userFromAuthor($author);
} 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
*/
static function activitySort($a, $b)
{
if ($a->time == $b->time) {
@ -154,7 +155,7 @@ class FeedImporter extends QueueHandler
$profile = $user->getProfile();
Ostatus_profile::updateProfile($profile, $author);
// FIXME: Update avatar
// @todo FIXME: Update avatar
return $user;
}
}

View File

@ -27,6 +27,7 @@ require_once INSTALLDIR.'/lib/profilelist.php';
define('AVATARS_PER_PAGE', 80);
// @todo FIXME: Class documentation missing.
class GalleryAction extends OwnerDesignAction
{
var $profile = null;
@ -56,6 +57,7 @@ class GalleryAction extends OwnerDesignAction
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed when trying to perform a gallery action with an unknown user.
$this->clientError(_('No such user.'), 404);
return false;
}
@ -63,6 +65,7 @@ class GalleryAction extends OwnerDesignAction
$this->profile = $this->user->getProfile();
if (!$this->profile) {
// TRANS: Server error displayed when trying to perform a gallery action with a user without a profile.
$this->serverError(_('User has no profile.'));
return false;
}
@ -125,7 +128,8 @@ class GalleryAction extends OwnerDesignAction
common_local_url($this->trimmed('action'),
array('nickname' =>
$this->user->nickname))),
_('All'));
// TRANS: List element on gallery action page to show all tags.
_m('TAGS','All'));
$this->elementEnd('li');
$this->elementStart('li', array('id'=>'filter_tags_item'));
$this->elementStart('form', array('name' => 'bytag',
@ -133,11 +137,15 @@ class GalleryAction extends OwnerDesignAction
'action' => common_path('?action=' . $this->trimmed('action')),
'method' => 'post'));
$this->elementStart('fieldset');
// TRANS: Fieldset legend on gallery action page.
$this->element('legend', null, _('Select tag to filter'));
// TRANS: Dropdown field label on gallery action page for a list containing tags.
$this->dropdown('tag', _('Tag'), $content,
_('Choose a tag to narrow list'), false, $tag);
// TRANS: Dropdown field title on gallery action page for a list containing tags.
_('Choose a tag to narrow list.'), false, $tag);
$this->hidden('nickname', $this->user->nickname);
$this->submit('submit', _('Go'));
// TRANS: Submit button text on gallery action page.
$this->submit('submit', _m('BUTTON','Go'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
$this->elementEnd('li');
@ -146,7 +154,6 @@ class GalleryAction extends OwnerDesignAction
}
// Get list of tags we tagged other users with
function getTags($lst, $usr)
{
$profile_tag = new Notice_tag();

View File

@ -42,7 +42,6 @@ if (!defined('STATUSNET')) {
*
* @see UnSandboxForm
*/
class GrantRoleForm extends ProfileActionForm
{
function __construct($role, $label, $writer, $profile, $r2args)
@ -57,7 +56,6 @@ class GrantRoleForm extends ProfileActionForm
*
* @return string Name of the action, lowercased.
*/
function target()
{
return 'grantrole';
@ -68,7 +66,6 @@ class GrantRoleForm extends ProfileActionForm
*
* @return string Title of the form, internationalized
*/
function title()
{
return $this->label;
@ -85,9 +82,9 @@ class GrantRoleForm extends ProfileActionForm
*
* @return string description of the form, internationalized
*/
function description()
{
// TRANS: Description on form for granting a role.
return sprintf(_('Grant this user the "%s" role'), $this->label);
}
}

View File

@ -205,7 +205,9 @@ class GroupEditForm extends Form
$this->out->dropdown('join_policy',
// TRANS: Dropdown fieldd label on group edit form.
_('Membership policy'),
// TRANS: Group membership policy option.
array(User_group::JOIN_POLICY_OPEN => _('Open to all'),
// TRANS: Group membership policy option.
User_group::JOIN_POLICY_MODERATE => _('Admin must approve all members')),
// TRANS: Dropdown field title on group edit form.
_('Whether admin approval is required to join this group.'),

View File

@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
abstract class ImPlugin extends Plugin
{
//name of this IM transport
@ -249,7 +248,7 @@ abstract class ImPlugin extends Plugin
}
/**
* send a confirmation code to a user
* Send a confirmation code to a user
*
* @param string $screenname screenname sending to
* @param string $code the confirmation code
@ -259,12 +258,16 @@ abstract class ImPlugin extends Plugin
*/
function sendConfirmationCode($screenname, $code, $user)
{
$body = sprintf(_('User "%s" on %s has said that your %s screenname belongs to them. ' .
'If that\'s true, you can confirm by clicking on this URL: ' .
'%s' .
// @todo FIXME: parameter 4 is not being used. Should para3 and para4 be a markdown link?
// TRANS: Body text for confirmation code e-mail.
// TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
// TRANS: %3$s is the display name of an IM plugin.
$body = sprintf(_('User "%1$s" on %2$s has said that your %3$s screenname belongs to them. ' .
'If that is true, you can confirm by clicking on this URL: ' .
'%4$s' .
' . (If you cannot click it, copy-and-paste it into the ' .
'address bar of your browser). If that user isn\'t you, ' .
'or if you didn\'t request this confirmation, just ignore this message.'),
'address bar of your browser). If that user is not you, ' .
'or if you did not request this confirmation, just ignore this message.'),
$user->nickname, common_config('site', 'name'), $this->getDisplayName(), common_local_url('confirmaddress', array('code' => $code)));
return $this->sendMessage($screenname, $body);
@ -316,7 +319,6 @@ abstract class ImPlugin extends Plugin
function broadcastNotice($notice)
{
$ni = $notice->whoGets();
foreach ($ni as $user_id => $reason) {
@ -346,7 +348,9 @@ abstract class ImPlugin extends Plugin
case NOTICE_INBOX_SOURCE_GROUP:
break;
default:
throw new Exception(sprintf(_("Unknown inbox source %d."), $reason));
// TRANS: Exception thrown when trying to deliver a notice to an unknown inbox.
// TRANS: %d is the unknown inbox ID (number).
throw new Exception(sprintf(_('Unknown inbox source %d.'), $reason));
}
common_log(LOG_INFO,
@ -483,6 +487,8 @@ abstract class ImPlugin extends Plugin
$content_shortened = common_shorten_links($body);
if (Notice::contentTooLong($content_shortened)) {
$this->sendFromSite($screenname,
// TRANS: Message given when a status is too long. %1$s is the maximum number of characters,
// TRANS: %2$s is the number of characters sent (used for plural).
sprintf(_m('Message too long - maximum is %1$d character, you sent %2$d.',
'Message too long - maximum is %1$d characters, you sent %2$d.',
Notice::maxContent()),
@ -619,11 +625,13 @@ abstract class ImPlugin extends Plugin
{
if( ! common_config('queue', 'enabled'))
{
throw new ServerException("Queueing must be enabled to use IM plugins");
// TRANS: Server exception thrown trying to initialise an IM plugin without meeting all prerequisites.
throw new ServerException(_('Queueing must be enabled to use IM plugins.'));
}
if(is_null($this->transport)){
throw new ServerException('transport cannot be null');
// TRANS: Server exception thrown trying to initialise an IM plugin without a transport method.
throw new ServerException(_('Transport cannot be null.'));
}
}
}

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/form.php';
*
* @see UnsubscribeForm
*/
class LeaveForm extends Form
{
/**
@ -61,7 +60,6 @@ class LeaveForm extends Form
* @param HTMLOutputter $out output channel
* @param group $group group to leave
*/
function __construct($out=null, $group=null)
{
parent::__construct($out);
@ -74,7 +72,6 @@ class LeaveForm extends Form
*
* @return string ID of the form
*/
function id()
{
return 'group-leave-' . $this->group->id;
@ -85,7 +82,6 @@ class LeaveForm extends Form
*
* @return string of the form class
*/
function formClass()
{
return 'form_group_leave ajax';
@ -96,7 +92,6 @@ class LeaveForm extends Form
*
* @return string URL of the action
*/
function action()
{
return common_local_url('leavegroup',
@ -108,9 +103,9 @@ class LeaveForm extends Form
*
* @return void
*/
function formActions()
{
$this->out->submit('submit', _('Leave'));
// TRANS: Button text on form to leave a group.
$this->out->submit('submit', _m('BUTTON','Leave'));
}
}

View File

@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @see InboxAction
* @see OutboxAction
*/
class MailboxAction extends CurrentUserDesignAction
{
var $page = null;
@ -71,12 +70,12 @@ class MailboxAction extends CurrentUserDesignAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
if (!$this->user) {
// TRANS: Client error displayed when trying to access a mailbox without providing a user.
$this->clientError(_('No such user.'), 404);
return;
}
@ -84,6 +83,7 @@ class MailboxAction extends CurrentUserDesignAction
$cur = common_current_user();
if (!$cur || $cur->id != $this->user->id) {
// TRANS: Client error displayed when trying to access a mailbox that is not of the logged in user.
$this->clientError(_('Only the user can read their own mailboxes.'),
403);
return;
@ -114,8 +114,9 @@ class MailboxAction extends CurrentUserDesignAction
$this->trimmed('action'),
array('nickname' => $this->user->nickname));
} else {
$this->element('p',
'guide',
$this->element('p',
'guide',
// TRANS: Message displayed when there are no private messages in the inbox of a user.
_('You have no private messages. '.
'You can send private message to engage other users in conversation. '.
'People can send you messages for your eyes only.'));
@ -139,7 +140,6 @@ class MailboxAction extends CurrentUserDesignAction
*
* @return void
*/
function showPageNotice()
{
$instr = $this->getInstructions();
@ -157,7 +157,6 @@ class MailboxAction extends CurrentUserDesignAction
*
* @return boolean
*/
function isReadOnly($args)
{
return true;

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc.
*
* Private mailboxes menu
*
*
* PHP version 5
*
* 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
* @link http://status.net/
*/
class MailboxMenu extends Menu
{
function show()
@ -56,15 +55,18 @@ class MailboxMenu extends Menu
$this->item('inbox',
array('nickname' => $nickname),
_('Inbox'),
_('Your incoming messages'));
// TRANS: Menu item in mailbox menu. Leads to incoming private messages.
_m('MENU','Inbox'),
// TRANS: Menu item title in mailbox menu. Leads to incoming private messages.
_('Your incoming messages.'));
$this->item('outbox',
array('nickname' => $nickname),
_('Outbox'),
_('Your sent messages'));
// TRANS: Menu item in mailbox menu. Leads to outgoing private messages.
_m('MENU','Outbox'),
// TRANS: Menu item title in mailbox menu. Leads to outgoing private messages.
_('Your sent messages.'));
$this->out->elementEnd('ul');
}
}

View File

@ -21,7 +21,7 @@ require_once(INSTALLDIR . '/lib/mail.php');
require_once(INSTALLDIR . '/lib/mediafile.php');
require_once('Mail/mimeDecode.php');
// FIXME: we use both Mail_mimeDecode and mailparse
// @todo FIXME: we use both Mail_mimeDecode and mailparse
// Need to move everything to mailparse
class MailHandler
@ -34,19 +34,23 @@ class MailHandler
{
list($from, $to, $msg, $attachments) = $this->parse_message($rawmessage);
if (!$from || !$to || !$msg) {
// TRANS: Error message in incoming mail handler used when an incoming e-mail cannot be processed.
$this->error(null, _('Could not parse message.'));
}
common_log(LOG_INFO, "Mail from $from to $to with ".count($attachments) .' attachment(s): ' .substr($msg, 0, 20));
$user = $this->user_from_header($from);
if (!$user) {
// TRANS: Error message in incoming mail handler used when an incoming e-mail is not from a registered user.
$this->error($from, _('Not a registered user.'));
return false;
}
if (!$this->user_match_to($user, $to)) {
// TRANS: Error message in incoming mail handler used when an incoming e-mail is not from a user's incoming e-mail address.
$this->error($from, _('Sorry, that is not your incoming email address.'));
return false;
}
if (!$user->emailpost) {
// TRANS: Error message in incoming mail handler used when no incoming e-mail is allowed.
$this->error($from, _('Sorry, no incoming email allowed.'));
return false;
}
@ -57,7 +61,8 @@ class MailHandler
$msg = $this->cleanup_msg($msg);
$msg = $user->shortenLinks($msg);
if (Notice::contentTooLong($msg)) {
$this->error($from, sprintf(_('That\'s too long. Maximum notice size is %d character.',
// TRANS: Error message in incoming mail handler used when an incoming e-mail contains too many characters.
$this->error($from, sprintf(_m('That\'s too long. Maximum notice size is %d character.',
'That\'s too long. Maximum notice size is %d characters.',
Notice::maxContent()),
Notice::maxContent()));
@ -66,7 +71,6 @@ class MailHandler
$mediafiles = array();
foreach($attachments as $attachment){
$mf = null;
try {
@ -137,9 +141,9 @@ class MailHandler
function respond($from, $to, $response)
{
$headers['From'] = $to;
$headers['To'] = $from;
// TRANS: E-mail subject for reply to an e-mail command.
$headers['Subject'] = _('Command complete');
return mail_send(array($from), $headers, $response);
@ -226,7 +230,9 @@ class MailHandler
function unsupported_type($type)
{
$this->error(null, sprintf(_('Unsupported message type: %s'), $type));
// TRANS: Error message in incoming mail handler used when an incoming e-mail is of an unsupported type.
// TRANS: %s is the unsupported type.
$this->error(null, sprintf(_('Unsupported message type: %s.'), $type));
}
function cleanup_msg($msg)

View File

@ -46,19 +46,16 @@ require_once INSTALLDIR.'/lib/form.php';
*
* @see HTMLOutputter
*/
class MessageForm extends Form
{
/**
* User to send a direct message to
*/
var $to = null;
/**
* Pre-filled content of the form
*/
var $content = null;
/**
@ -68,7 +65,6 @@ class MessageForm extends Form
* @param User $to user to send a message to
* @param string $content content to pre-fill
*/
function __construct($out=null, $to=null, $content=null)
{
parent::__construct($out);
@ -82,7 +78,6 @@ class MessageForm extends Form
*
* @return string ID of the form
*/
function id()
{
return 'form_notice-direct';
@ -93,7 +88,6 @@ class MessageForm extends Form
*
* @return string class of the form
*/
function formClass()
{
return 'form_notice ajax-notice';
@ -104,7 +98,6 @@ class MessageForm extends Form
*
* @return string URL of the action
*/
function action()
{
return common_local_url('newmessage');
@ -117,6 +110,7 @@ class MessageForm extends Form
*/
function formLegend()
{
// TRANS: Form legend for direct notice.
$this->out->element('legend', null, _('Send a direct notice'));
}
@ -125,7 +119,6 @@ class MessageForm extends Form
*
* @return void
*/
function formData()
{
$user = common_current_user();
@ -133,7 +126,9 @@ class MessageForm extends Form
$mutual_users = $user->mutuallySubscribedUsers();
$mutual = array();
// TRANS Label entry in drop-down selection box in direct-message inbox/outbox. This is the default entry in the drop-down box, doubling as instructions and a brake against accidental submissions with the first user in the list.
// TRANS: Label entry in drop-down selection box in direct-message inbox/outbox.
// TRANS: This is the default entry in the drop-down box, doubling as instructions
// TRANS: and a brake against accidental submissions with the first user in the list.
$mutual[0] = _('Select recipient:');
while ($mutual_users->fetch()) {
@ -150,6 +145,7 @@ class MessageForm extends Form
$mutual[0] = _('No mutual subscribers.');
}
// TRANS: Dropdown label in direct notice form.
$this->out->dropdown('to', _('To'), $mutual, null, false,
($this->to) ? $this->to->id : null);
@ -173,13 +169,13 @@ class MessageForm extends Form
*
* @return void
*/
function formActions()
{
$this->out->element('input', array('id' => 'notice_action-submit',
'class' => 'submit',
'name' => 'message_send',
'type' => 'submit',
// TRANS: Button text for sending a direct notice.
'value' => _m('Send button for sending notice', 'Send')));
}
}

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