diff --git a/classes/Message.php b/classes/Message.php index 16d0c60b30..fa0c5b3181 100644 --- a/classes/Message.php +++ b/classes/Message.php @@ -42,6 +42,7 @@ class Message extends Memcached_DataObject $sender = Profile::staticGet('id', $from); if (!$sender->hasRight(Right::NEWMESSAGE)) { + // TRANS: Client exception thrown when a user tries to send a direct message while being banned from sending them. throw new ClientException(_('You are banned from sending direct messages.')); } @@ -58,6 +59,7 @@ class Message extends Memcached_DataObject if (!$result) { common_log_db_error($msg, 'INSERT', __FILE__); + // TRANS: Message given when a message could not be stored on the server. return _('Could not insert message.'); } @@ -68,6 +70,7 @@ class Message extends Memcached_DataObject if (!$result) { common_log_db_error($msg, 'UPDATE', __FILE__); + // TRANS: Message given when a message could not be updated on the server. return _('Could not update message with new URI.'); } diff --git a/classes/Profile.php b/classes/Profile.php index a303469e96..ae6a376021 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -735,14 +735,18 @@ class Profile extends Memcached_DataObject 'role' => $name)); if (empty($role)) { - throw new Exception('Cannot revoke role "'.$name.'" for user #'.$this->id.'; does not exist.'); + // TRANS: Exception thrown when trying to revoke an existing role for a user that does not exist. + // TRANS: %1$s is the role name, %2$s is the user ID. + throw new Exception(sprintf(_('Cannot revoke role "%s" for user #%2$s; does not exist.'),$name, $this->id)); } $result = $role->delete(); if (!$result) { common_log_db_error($role, 'DELETE', __FILE__); - throw new Exception('Cannot revoke role "'.$name.'" for user #'.$this->id.'; database error.'); + // TRANS: Exception thrown when trying to revoke a role for a user with a failing database query. + // TRANS: %1$s is the role name, %2$s is the user ID. + throw new Exception(sprintf(_('Cannot revoke role "%1$s" for user #%2$s; database error.'),$name, $this->id)); } return true; diff --git a/classes/Remote_profile.php b/classes/Remote_profile.php index 0a1676a6a9..77bfbcd99c 100644 --- a/classes/Remote_profile.php +++ b/classes/Remote_profile.php @@ -50,7 +50,8 @@ class Remote_profile extends Memcached_DataObject if ($profile) { return $profile->hasright($right); } else { - throw new Exception("Missing profile"); + // TRANS: Exception thrown when a right for a non-existing user profile is checked. + throw new Exception(_("Missing profile.")); } } } diff --git a/classes/Status_network.php b/classes/Status_network.php index a0f3ba5f78..5680c14584 100644 --- a/classes/Status_network.php +++ b/classes/Status_network.php @@ -342,6 +342,7 @@ class Status_network extends Safe_DataObject $id = $snt->insert(); if (!$id) { + // TRANS: Exception thrown when a tag cannot be saved. throw new Exception(_("Unable to save tag.")); } } diff --git a/classes/Subscription.php b/classes/Subscription.php index 0679c09250..0225ed4df9 100644 --- a/classes/Subscription.php +++ b/classes/Subscription.php @@ -71,14 +71,17 @@ class Subscription extends Memcached_DataObject } if (!$subscriber->hasRight(Right::SUBSCRIBE)) { + // TRANS: Exception thrown when trying to subscribe while being banned from subscribing. throw new Exception(_('You have been banned from subscribing.')); } if (self::exists($subscriber, $other)) { + // TRANS: Exception thrown when trying to subscribe while already subscribed. throw new Exception(_('Already subscribed!')); } if ($other->hasBlocked($subscriber)) { + // TRANS: Exception thrown when trying to subscribe to a user who has blocked the subscribing user. throw new Exception(_('User has blocked you.')); } @@ -129,6 +132,7 @@ class Subscription extends Memcached_DataObject if (!$result) { common_log_db_error($sub, 'INSERT', __FILE__); + // TRANS: Exception thrown when a subscription could not be stored on the server. throw new Exception(_('Could not save subscription.')); } @@ -160,17 +164,18 @@ class Subscription extends Memcached_DataObject * Cancel a subscription * */ - function cancel($subscriber, $other) { if (!self::exists($subscriber, $other)) { + // TRANS: Exception thrown when trying to unsibscribe without a subscription. throw new Exception(_('Not subscribed!')); } // Don't allow deleting self subs if ($subscriber->id == $other->id) { - throw new Exception(_('Couldn\'t delete self-subscription.')); + // TRANS: Exception thrown when trying to unsubscribe a user from themselves. + throw new Exception(_('Could not delete self-subscription.')); } if (Event::handle('StartUnsubscribe', array($subscriber, $other))) { @@ -197,7 +202,8 @@ class Subscription extends Memcached_DataObject if (!$result) { common_log_db_error($token, 'DELETE', __FILE__); - throw new Exception(_('Couldn\'t delete subscription OMB token.')); + // TRANS: Exception thrown when the OMB token for a subscription could not deleted on the server. + throw new Exception(_('Could not delete subscription OMB token.')); } } else { common_log(LOG_ERR, "Couldn't find credentials with token {$token->tok}"); @@ -208,7 +214,8 @@ class Subscription extends Memcached_DataObject if (!$result) { common_log_db_error($sub, 'DELETE', __FILE__); - throw new Exception(_('Couldn\'t delete subscription.')); + // TRANS: Exception thrown when a subscription could not be deleted on the server. + throw new Exception(_('Could not delete subscription.')); } self::blow('user:notices_with_friends:%d', $subscriber->id); diff --git a/classes/User.php b/classes/User.php index cf8d4527b8..8033229c4b 100644 --- a/classes/User.php +++ b/classes/User.php @@ -360,11 +360,12 @@ class User extends Memcached_DataObject __FILE__); } else { $notice = Notice::saveNew($welcomeuser->id, + // TRANS: Notice given on user registration. + // TRANS: %1$s is the sitename, $2$s is the registering user's nickname. sprintf(_('Welcome to %1$s, @%2$s!'), common_config('site', 'name'), $user->nickname), 'system'); - } } @@ -375,7 +376,6 @@ class User extends Memcached_DataObject } // Things we do when the email changes - function emailChanged() { diff --git a/classes/User_group.php b/classes/User_group.php index e04c466266..0b83cfd47d 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -492,6 +492,7 @@ class User_group extends Memcached_DataObject if (!$result) { common_log_db_error($group, 'INSERT', __FILE__); + // TRANS: Server exception thrown when creating a group failed. throw new ServerException(_('Could not create group.')); } @@ -501,6 +502,7 @@ class User_group extends Memcached_DataObject $result = $group->update($orig); if (!$result) { common_log_db_error($group, 'UPDATE', __FILE__); + // TRANS: Server exception thrown when updating a group URI failed. throw new ServerException(_('Could not set group URI.')); } } @@ -508,6 +510,7 @@ class User_group extends Memcached_DataObject $result = $group->setAliases($aliases); if (!$result) { + // TRANS: Server exception thrown when creating group aliases failed. throw new ServerException(_('Could not create aliases.')); } @@ -522,6 +525,7 @@ class User_group extends Memcached_DataObject if (!$result) { common_log_db_error($member, 'INSERT', __FILE__); + // TRANS: Server exception thrown when setting group membership failed. throw new ServerException(_('Could not set group membership.')); } @@ -536,6 +540,7 @@ class User_group extends Memcached_DataObject if (!$result) { common_log_db_error($local_group, 'INSERT', __FILE__); + // TRANS: Server exception thrown when saving local group information failed. throw new ServerException(_('Could not save local group info.')); } }