Fix inconsistencies in clientError() messages

* use correct punctuation
* single quotes when replace was possible
* wording updated when needed
This commit is contained in:
Siebrand Mazeland 2010-04-10 00:58:57 +02:00 committed by Brion Vibber
parent 5c6c9b6f5f
commit 166c1edba9
35 changed files with 58 additions and 58 deletions

View File

@ -103,7 +103,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
$this->clientError( $this->clientError(
_( _(
'You must specify a parameter named ' . 'You must specify a parameter named ' .
'\'device\' with a value of one of: sms, im, none' '\'device\' with a value of one of: sms, im, none.'
) )
); );
return; return;

View File

@ -263,7 +263,7 @@ class ApiGroupCreateAction extends ApiAuthAction
if (!$valid) { if (!$valid) {
$this->clientError( $this->clientError(
sprintf(_('Invalid alias: "%s"'), $alias), sprintf(_('Invalid alias: "%s".'), $alias),
403, 403,
$this->format $this->format
); );

View File

@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }

View File

@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }

View File

@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }

View File

@ -88,7 +88,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
parent::handle($args); parent::handle($args);
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }

View File

@ -79,7 +79,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
common_redirect(common_local_url('ApiGroupShow', $args), 301); common_redirect(common_local_url('ApiGroupShow', $args), 301);
} else { } else {
$this->clientError( $this->clientError(
_('Group not found!'), _('Group not found.'),
404, 404,
$this->format $this->format
); );

View File

@ -199,7 +199,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$reply_to = $this->in_reply_to_status_id; $reply_to = $this->in_reply_to_status_id;
} else { } else {
$this->clientError( $this->clientError(
_('Not found'), _('Not found.'),
$code = 404, $code = 404,
$this->format $this->format
); );

View File

@ -88,7 +88,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
parent::handle($args); parent::handle($args);
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }

View File

@ -66,7 +66,7 @@ class BlockAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if ($cur->hasBlocked($this->profile)) { if ($cur->hasBlocked($this->profile)) {
$this->clientError(_("You already blocked that user.")); $this->clientError(_('You already blocked that user.'));
return false; return false;
} }

View File

@ -64,14 +64,14 @@ class DeleteuserAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::DELETEUSER)) { if (!$cur->hasRight(Right::DELETEUSER)) {
$this->clientError(_("You cannot delete users.")); $this->clientError(_('You cannot delete users.'));
return false; return false;
} }
$this->user = User::staticGet('id', $this->profile->id); $this->user = User::staticGet('id', $this->profile->id);
if (empty($this->user)) { if (empty($this->user)) {
$this->clientError(_("You can only delete local users.")); $this->clientError(_('You can only delete local users.'));
return false; return false;
} }

View File

@ -272,11 +272,11 @@ class DesignadminpanelAction extends AdminPanelAction
{ {
if (!empty($values['logo']) && if (!empty($values['logo']) &&
!Validate::uri($values['logo'], array('allowed_schemes' => array('http', 'https')))) { !Validate::uri($values['logo'], array('allowed_schemes' => array('http', 'https')))) {
$this->clientError(_("Invalid logo URL.")); $this->clientError(_('Invalid logo URL.'));
} }
if (!in_array($values['theme'], Theme::listAvailable())) { if (!in_array($values['theme'], Theme::listAvailable())) {
$this->clientError(sprintf(_("Theme not available: %s"), $values['theme'])); $this->clientError(sprintf(_("Theme not available: %s."), $values['theme']));
} }
} }

View File

@ -71,7 +71,7 @@ class DisfavorAction 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()) {
$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;
} }
$fave = new Fave(); $fave = new Fave();

View File

@ -72,7 +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()) {
$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;
} }
if ($user->hasFave($notice)) { if ($user->hasFave($notice)) {

View File

@ -59,11 +59,11 @@ class GrantRoleAction extends ProfileFormAction
$this->role = $this->arg('role'); $this->role = $this->arg('role');
if (!Profile_role::isValid($this->role)) { if (!Profile_role::isValid($this->role)) {
$this->clientError(_("Invalid role.")); $this->clientError(_('Invalid role.'));
return false; return false;
} }
if (!Profile_role::isSettable($this->role)) { if (!Profile_role::isSettable($this->role)) {
$this->clientError(_("This role is reserved and cannot be set.")); $this->clientError(_('This role is reserved and cannot be set.'));
return false; return false;
} }
@ -72,14 +72,14 @@ class GrantRoleAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::GRANTROLE)) { if (!$cur->hasRight(Right::GRANTROLE)) {
$this->clientError(_("You cannot grant user roles on this site.")); $this->clientError(_('You cannot grant user roles on this site.'));
return false; return false;
} }
assert(!empty($this->profile)); // checked by parent assert(!empty($this->profile)); // checked by parent
if ($this->profile->hasRole($this->role)) { if ($this->profile->hasRole($this->role)) {
$this->clientError(_("User already has this role.")); $this->clientError(_('User already has this role.'));
return false; return false;
} }

View File

@ -38,7 +38,7 @@ class InviteAction extends CurrentUserDesignAction
if (!common_config('invite', 'enabled')) { if (!common_config('invite', 'enabled')) {
$this->clientError(_('Invites have been disabled.')); $this->clientError(_('Invites have been disabled.'));
} else if (!common_logged_in()) { } else if (!common_logged_in()) {
$this->clientError(sprintf(_('You must be logged in to invite other users to use %s'), $this->clientError(sprintf(_('You must be logged in to invite other users to use %s.'),
common_config('site', 'name'))); common_config('site', 'name')));
return; return;
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') { } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {

View File

@ -66,7 +66,7 @@ class MicrosummaryAction extends Action
$notice = $user->getCurrentNotice(); $notice = $user->getCurrentNotice();
if (!$notice) { if (!$notice) {
$this->clientError(_('No current status'), 404); $this->clientError(_('No current status.'), 404);
} }
header('Content-Type: text/plain'); header('Content-Type: text/plain');

View File

@ -183,7 +183,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction
if (!$result) { if (!$result) {
common_log_db_error($orig, 'DELETE', __FILE__); common_log_db_error($orig, 'DELETE', __FILE__);
$this->clientError(_('Unable to revoke access for app: ' . $app->id)); $this->clientError(sprintf(_('Unable to revoke access for app: %s.'), $app->id));
return false; return false;
} }
@ -195,7 +195,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction
function showEmptyListMessage() function showEmptyListMessage()
{ {
$message = sprintf(_('You have not authorized any applications to use your account.')); $message = _('You have not authorized any applications to use your account.');
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message)); $this->raw(common_markup_to_html($message));

View File

@ -154,19 +154,19 @@ class PathsadminpanelAction extends AdminPanelAction
// Validate theme dir // Validate theme dir
if (!empty($values['theme']['dir']) && !is_readable($values['theme']['dir'])) { if (!empty($values['theme']['dir']) && !is_readable($values['theme']['dir'])) {
$this->clientError(sprintf(_("Theme directory not readable: %s"), $values['theme']['dir'])); $this->clientError(sprintf(_("Theme directory not readable: %s."), $values['theme']['dir']));
} }
// Validate avatar dir // Validate avatar dir
if (empty($values['avatar']['dir']) || !is_writable($values['avatar']['dir'])) { if (empty($values['avatar']['dir']) || !is_writable($values['avatar']['dir'])) {
$this->clientError(sprintf(_("Avatar directory not writable: %s"), $values['avatar']['dir'])); $this->clientError(sprintf(_("Avatar directory not writable: %s."), $values['avatar']['dir']));
} }
// Validate background dir // Validate background dir
if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) { if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) {
$this->clientError(sprintf(_("Background directory not writable: %s"), $values['background']['dir'])); $this->clientError(sprintf(_("Background directory not writable: %s."), $values['background']['dir']));
} }
// Validate locales dir // Validate locales dir
@ -174,13 +174,13 @@ class PathsadminpanelAction extends AdminPanelAction
// XXX: What else do we need to validate for lacales path here? --Z // XXX: What else do we need to validate for lacales path here? --Z
if (!empty($values['site']['locale_path']) && !is_readable($values['site']['locale_path'])) { if (!empty($values['site']['locale_path']) && !is_readable($values['site']['locale_path'])) {
$this->clientError(sprintf(_("Locales directory not readable: %s"), $values['site']['locale_path'])); $this->clientError(sprintf(_("Locales directory not readable: %s."), $values['site']['locale_path']));
} }
// Validate SSL setup // Validate SSL setup
if (mb_strlen($values['site']['sslserver']) > 255) { if (mb_strlen($values['site']['sslserver']) > 255) {
$this->clientError(_("Invalid SSL server. The maximum length is 255 characters.")); $this->clientError(_('Invalid SSL server. The maximum length is 255 characters.'));
} }
} }

View File

@ -65,7 +65,7 @@ class PeopletagAction extends Action
$this->tag = $this->trimmed('tag'); $this->tag = $this->trimmed('tag');
if (!common_valid_profile_tag($this->tag)) { if (!common_valid_profile_tag($this->tag)) {
$this->clientError(sprintf(_('Not a valid people tag: %s'), $this->clientError(sprintf(_('Not a valid people tag: %s.'),
$this->tag)); $this->tag));
return; return;
} }

View File

@ -92,7 +92,7 @@ class PostnoticeAction extends Action
{ {
$content = common_shorten_links($_POST['omb_notice_content']); $content = common_shorten_links($_POST['omb_notice_content']);
if (Notice::contentTooLong($content)) { if (Notice::contentTooLong($content)) {
$this->clientError(_('Invalid notice content'), 400); $this->clientError(_('Invalid notice content.'), 400);
return false; return false;
} }
$license = $_POST['omb_notice_license']; $license = $_POST['omb_notice_license'];

View File

@ -80,7 +80,7 @@ class PublicAction extends Action
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
if ($this->page > MAX_PUBLIC_PAGE) { if ($this->page > MAX_PUBLIC_PAGE) {
$this->clientError(sprintf(_("Beyond the page limit (%s)"), MAX_PUBLIC_PAGE)); $this->clientError(sprintf(_("Beyond the page limit (%s)."), MAX_PUBLIC_PAGE));
} }
common_set_returnto($this->selfUrl()); common_set_returnto($this->selfUrl());

View File

@ -54,21 +54,21 @@ class RepeatAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->user)) { if (empty($this->user)) {
$this->clientError(_("Only logged-in users can repeat notices.")); $this->clientError(_('Only logged-in users can repeat notices.'));
return false; return false;
} }
$id = $this->trimmed('notice'); $id = $this->trimmed('notice');
if (empty($id)) { if (empty($id)) {
$this->clientError(_("No notice specified.")); $this->clientError(_('No notice specified.'));
return false; return false;
} }
$this->notice = Notice::staticGet('id', $id); $this->notice = Notice::staticGet('id', $id);
if (empty($this->notice)) { if (empty($this->notice)) {
$this->clientError(_("No notice specified.")); $this->clientError(_('No notice specified.'));
return false; return false;
} }
@ -80,14 +80,14 @@ 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()) {
$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;
} }
$profile = $this->user->getProfile(); $profile = $this->user->getProfile();
if ($profile->hasRepeated($id)) { if ($profile->hasRepeated($id)) {
$this->clientError(_("You already repeated that notice.")); $this->clientError(_('You already repeated that notice.'));
return false; return false;
} }

View File

@ -59,11 +59,11 @@ class RevokeRoleAction extends ProfileFormAction
$this->role = $this->arg('role'); $this->role = $this->arg('role');
if (!Profile_role::isValid($this->role)) { if (!Profile_role::isValid($this->role)) {
$this->clientError(_("Invalid role.")); $this->clientError(_('Invalid role.'));
return false; return false;
} }
if (!Profile_role::isSettable($this->role)) { if (!Profile_role::isSettable($this->role)) {
$this->clientError(_("This role is reserved and cannot be set.")); $this->clientError(_('This role is reserved and cannot be set.'));
return false; return false;
} }
@ -72,7 +72,7 @@ class RevokeRoleAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::REVOKEROLE)) { if (!$cur->hasRight(Right::REVOKEROLE)) {
$this->clientError(_("You cannot revoke user roles on this site.")); $this->clientError(_('You cannot revoke user roles on this site.'));
return false; return false;
} }

View File

@ -62,14 +62,14 @@ class SandboxAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::SANDBOXUSER)) { if (!$cur->hasRight(Right::SANDBOXUSER)) {
$this->clientError(_("You cannot sandbox users on this site.")); $this->clientError(_('You cannot sandbox users on this site.'));
return false; return false;
} }
assert(!empty($this->profile)); // checked by parent assert(!empty($this->profile)); // checked by parent
if ($this->profile->isSandboxed()) { if ($this->profile->isSandboxed()) {
$this->clientError(_("User is already sandboxed.")); $this->clientError(_('User is already sandboxed.'));
return false; return false;
} }

View File

@ -97,7 +97,7 @@ class ShownoticeAction extends OwnerDesignAction
$this->profile = $this->notice->getProfile(); $this->profile = $this->notice->getProfile();
if (empty($this->profile)) { if (empty($this->profile)) {
$this->serverError(_('Notice has no profile'), 500); $this->serverError(_('Notice has no profile.'), 500);
return false; return false;
} }

View File

@ -62,14 +62,14 @@ class SilenceAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::SILENCEUSER)) { if (!$cur->hasRight(Right::SILENCEUSER)) {
$this->clientError(_("You cannot silence users on this site.")); $this->clientError(_('You cannot silence users on this site.'));
return false; return false;
} }
assert(!empty($this->profile)); // checked by parent assert(!empty($this->profile)); // checked by parent
if ($this->profile->isSilenced()) { if ($this->profile->isSilenced()) {
$this->clientError(_("User is already silenced.")); $this->clientError(_('User is already silenced.'));
return false; return false;
} }

View File

@ -130,7 +130,7 @@ class SiteadminpanelAction extends AdminPanelAction
// Validate site name // Validate site name
if (empty($values['site']['name'])) { if (empty($values['site']['name'])) {
$this->clientError(_("Site name must have non-zero length.")); $this->clientError(_('Site name must have non-zero length.'));
} }
// Validate email // Validate email
@ -168,7 +168,7 @@ class SiteadminpanelAction extends AdminPanelAction
// Validate dupe limit // Validate dupe limit
if (!Validate::number($values['site']['dupelimit'], array('min' => 1))) { if (!Validate::number($values['site']['dupelimit'], array('min' => 1))) {
$this->clientError(_("Dupe limit must 1 or more seconds.")); $this->clientError(_("Dupe limit must be one or more seconds."));
} }
} }

View File

@ -110,7 +110,7 @@ class SitenoticeadminpanelAction extends AdminPanelAction
if (mb_strlen($siteNotice) > 255) { if (mb_strlen($siteNotice) > 255) {
$this->clientError( $this->clientError(
_('Max length for the site-wide notice is 255 chars') _('Max length for the site-wide notice is 255 chars.')
); );
} }

View File

@ -124,13 +124,13 @@ class SnapshotadminpanelAction extends AdminPanelAction
// Validate snapshot run value // Validate snapshot run value
if (!in_array($values['snapshot']['run'], array('web', 'cron', 'never'))) { if (!in_array($values['snapshot']['run'], array('web', 'cron', 'never'))) {
$this->clientError(_("Invalid snapshot run value.")); $this->clientError(_('Invalid snapshot run value.'));
} }
// Validate snapshot frequency value // Validate snapshot frequency value
if (!Validate::number($values['snapshot']['frequency'])) { if (!Validate::number($values['snapshot']['frequency'])) {
$this->clientError(_("Snapshot frequency must be a number.")); $this->clientError(_('Snapshot frequency must be a number.'));
} }
// Validate report URL // Validate report URL
@ -141,7 +141,7 @@ class SnapshotadminpanelAction extends AdminPanelAction
array('allowed_schemes' => array('http', 'https') array('allowed_schemes' => array('http', 'https')
) )
)) { )) {
$this->clientError(_("Invalid snapshot report URL.")); $this->clientError(_('Invalid snapshot report URL.'));
} }
} }
} }

View File

@ -62,14 +62,14 @@ class UnsandboxAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::SANDBOXUSER)) { if (!$cur->hasRight(Right::SANDBOXUSER)) {
$this->clientError(_("You cannot sandbox users on this site.")); $this->clientError(_('You cannot sandbox users on this site.'));
return false; return false;
} }
assert(!empty($this->profile)); // checked by parent assert(!empty($this->profile)); // checked by parent
if (!$this->profile->isSandboxed()) { if (!$this->profile->isSandboxed()) {
$this->clientError(_("User is not sandboxed.")); $this->clientError(_('User is not sandboxed.'));
return false; return false;
} }

View File

@ -62,14 +62,14 @@ class UnsilenceAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::SILENCEUSER)) { if (!$cur->hasRight(Right::SILENCEUSER)) {
$this->clientError(_("You cannot silence users on this site.")); $this->clientError(_('You cannot silence users on this site.'));
return false; return false;
} }
assert(!empty($this->profile)); // checked by parent assert(!empty($this->profile)); // checked by parent
if (!$this->profile->isSilenced()) { if (!$this->profile->isSilenced()) {
$this->clientError(_("User is not silenced.")); $this->clientError(_('User is not silenced.'));
return false; return false;
} }

View File

@ -74,7 +74,7 @@ class UnsubscribeAction extends Action
$other_id = $this->arg('unsubscribeto'); $other_id = $this->arg('unsubscribeto');
if (!$other_id) { if (!$other_id) {
$this->clientError(_('No profile id in request.')); $this->clientError(_('No profile ID in request.'));
return; return;
} }

View File

@ -69,7 +69,7 @@ class UserauthorizationAction extends Action
$profile = $user->getProfile(); $profile = $user->getProfile();
if (!$profile) { if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__); common_log_db_error($user, 'SELECT', __FILE__);
$this->serverError(_('User without matching profile')); $this->serverError(_('User without matching profile.'));
return; return;
} }

View File

@ -103,7 +103,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__);
$this->serverError(_('User without matching profile')); $this->serverError(_('User without matching profile.'));
return null; return null;
} }
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);