Fix L10n/i18n.

Some remaining people tag -> list.
Favor -> like
Update translator documentation.
Whitespace updates.
This commit is contained in:
Siebrand Mazeland 2011-04-29 18:59:47 +02:00
parent c13fbfb2d2
commit 4651c9d94a
14 changed files with 106 additions and 50 deletions

View File

@ -575,8 +575,7 @@ class OStatusPlugin extends Plugin
} }
$url = $notice->url; $url = $notice->url;
// TRANS: Title. // TRANS: Title. %s is a domain name.
// TRANS: %s is a domain name.
$title = sprintf(_m('Sent from %s via OStatus'), $domain); $title = sprintf(_m('Sent from %s via OStatus'), $domain);
return false; return false;
} }
@ -774,7 +773,7 @@ class OStatusPlugin extends Plugin
$act->object = $oprofile->asActivityObject(); $act->object = $oprofile->asActivityObject();
$act->time = time(); $act->time = time();
// TRANS: Title to join a remote group. // TRANS: Title for joining a remote groep.
$act->title = _m('TITLE','Join'); $act->title = _m('TITLE','Join');
// TRANS: Success message for subscribe to group attempt through OStatus. // TRANS: Success message for subscribe to group attempt through OStatus.
// TRANS: %1$s is the member name, %2$s is the subscribed group's name. // TRANS: %1$s is the member name, %2$s is the subscribed group's name.
@ -872,11 +871,11 @@ class OStatusPlugin extends Plugin
$act->object = $oprofile->asActivityObject(); $act->object = $oprofile->asActivityObject();
$act->time = time(); $act->time = time();
// TRANS: Title for remote follow list. // TRANS: Title for following a remote list.
$act->title = _m('TITLE','Follow list'); $act->title = _m('TITLE','Follow list');
// TRANS: Success message for remote list follow through OStatus. // TRANS: Success message for remote list follow through OStatus.
// TRANS: %1$s is the subscriber name, %2$s is the list, %3$s is the tagger's name. // TRANS: %1$s is the subscriber name, %2$s is the list, %3$s is the tagger's name.
$act->content = sprintf(_m("%1$s is now following people listed in %2$s by %3$s."), $act->content = sprintf(_m('%1$s is now following people listed in %2$s by %3$s.'),
$sub->getBestName(), $sub->getBestName(),
$oprofile->getBestName(), $oprofile->getBestName(),
$tagger->getBestName()); $tagger->getBestName());
@ -922,7 +921,10 @@ class OStatusPlugin extends Plugin
$act->object = $oprofile->asActivityObject(); $act->object = $oprofile->asActivityObject();
$act->time = time(); $act->time = time();
// TRANS: Title for unfollowing a remote list.
$act->title = _m('Unfollow list'); $act->title = _m('Unfollow list');
// TRANS: Success message for remote list unfollow through OStatus.
// TRANS: %1$s is the subscriber name, %2$s is the list, %3$s is the tagger's name.
$act->content = sprintf(_m('%1$s stopped following the list %2$s by %3$s.'), $act->content = sprintf(_m('%1$s stopped following the list %2$s by %3$s.'),
$sub->getBestName(), $sub->getBestName(),
$oprofile->getBestName(), $oprofile->getBestName(),
@ -999,7 +1001,10 @@ class OStatusPlugin extends Plugin
$plist->tagger, $plist->id, $plist->tagger, $plist->id,
common_date_iso8601(time())); common_date_iso8601(time()));
$act->time = time(); $act->time = time();
$act->title = _m('TITLE','Tag'); // TRANS: Title for listing a remote profile.
$act->title = _m('TITLE','List');
// TRANS: Success message for remote list addition through OStatus.
// TRANS: %1$s is the list creator's name, %2$s is the added list member, %3$s is the list name.
$act->content = sprintf(_m('%1$s listed %2$s in the list %3$s.'), $act->content = sprintf(_m('%1$s listed %2$s in the list %3$s.'),
$tagger->getBestName(), $tagger->getBestName(),
$tagged->getBestName(), $tagged->getBestName(),
@ -1013,8 +1018,9 @@ class OStatusPlugin extends Plugin
// initiate a PuSH subscription for the person being tagged // initiate a PuSH subscription for the person being tagged
if (!$oprofile->subscribe()) { if (!$oprofile->subscribe()) {
// TRANS: Exception thrown when subscribing to a remote list fails.
throw new Exception(sprintf(_m('Could not complete subscription to remote '. throw new Exception(sprintf(_m('Could not complete subscription to remote '.
'profile\'s feed. Tag %s could not be saved.'), $ptag->tag)); 'profile\'s feed. List %s could not be saved.'), $ptag->tag));
return false; return false;
} }
return true; return true;
@ -1052,8 +1058,11 @@ class OStatusPlugin extends Plugin
$plist->tagger, $plist->id, $plist->tagger, $plist->id,
common_date_iso8601(time())); common_date_iso8601(time()));
$act->time = time(); $act->time = time();
$act->title = _m('TITLE','Untag'); // TRANS: Title for unlisting a remote profile.
$act->content = sprintf(_('%1$s untagged %2$s from the list %3$s.'), $act->title = _m('TITLE','Unlist');
// TRANS: Success message for remote list removal through OStatus.
// TRANS: %1$s is the list creator's name, %2$s is the removed list member, %3$s is the list name.
$act->content = sprintf(_m('%1$s removed %2$s from the list %3$s.'),
$tagger->getBestName(), $tagger->getBestName(),
$tagged->getBestName(), $tagged->getBestName(),
$plist->getBestName()); $plist->getBestName());
@ -1100,10 +1109,11 @@ class OStatusPlugin extends Plugin
$notice->id, $notice->id,
common_date_iso8601(time())); common_date_iso8601(time()));
$act->time = time(); $act->time = time();
$act->title = _m('Disfavor'); // TRANS: Title for unliking a remote notice.
$act->title = _m('Unlike');
// TRANS: Success message for remove a favorite notice through OStatus. // TRANS: Success message for remove a favorite notice through OStatus.
// TRANS: %1$s is the unfavoring user's name, %2$s is URI to the no longer favored notice. // TRANS: %1$s is the unfavoring user's name, %2$s is URI to the no longer favored notice.
$act->content = sprintf(_m('%1$s marked notice %2$s as no longer a favorite.'), $act->content = sprintf(_m('%1$s no longer likes %2$s.'),
$profile->getBestName(), $profile->getBestName(),
$notice->uri); $notice->uri);
@ -1219,7 +1229,7 @@ class OStatusPlugin extends Plugin
common_date_iso8601(time())); common_date_iso8601(time()));
$act->time = time(); $act->time = time();
// TRANS: Title for activity. // TRANS: Title for activity.
$act->title = _m("Profile update"); $act->title = _m('Profile update');
// TRANS: Ping text for remote profile update through OStatus. // TRANS: Ping text for remote profile update through OStatus.
// TRANS: %s is user that updated their profile. // TRANS: %s is user that updated their profile.
$act->content = sprintf(_m('%s has updated their profile page.'), $act->content = sprintf(_m('%s has updated their profile page.'),
@ -1265,6 +1275,7 @@ class OStatusPlugin extends Plugin
array('nickname' => $profileUser->nickname)); array('nickname' => $profileUser->nickname));
$output->element('a', array('href' => $url, $output->element('a', array('href' => $url,
'class' => 'entity_remote_tag'), 'class' => 'entity_remote_tag'),
// TRANS: Link text for a user to tag an OStatus user.
_m('Tag')); _m('Tag'));
$output->elementEnd('li'); $output->elementEnd('li');
} }

View File

@ -144,6 +144,7 @@ class GroupsalmonAction extends SalmonAction
} }
if (Group_block::isBlocked($this->group, $profile)) { if (Group_block::isBlocked($this->group, $profile)) {
// TRANS: Client error displayed when trying to join a group the user is blocked from by a group admin.
$this->clientError(_m('You have been blocked from that group by the admin.'), 403); $this->clientError(_m('You have been blocked from that group by the admin.'), 403);
return false; return false;
} }
@ -164,9 +165,12 @@ class GroupsalmonAction extends SalmonAction
{ {
$oprofile = $this->ensureProfile(); $oprofile = $this->ensureProfile();
if (!$oprofile) { if (!$oprofile) {
// TRANS: Client error displayed when group membership cannot be cancelled
// TRANS: because the remote profile could not be read.
$this->clientError(_m('Cannot read profile to cancel group membership.')); $this->clientError(_m('Cannot read profile to cancel group membership.'));
} }
if ($oprofile->isGroup()) { if ($oprofile->isGroup()) {
// TRANS: Client error displayed when trying to have a group join another group.
$this->clientError(_m('Groups cannot join groups.')); $this->clientError(_m('Groups cannot join groups.'));
} }

View File

@ -102,7 +102,8 @@ class OStatusGroupAction extends OStatusSubAction
$cur = common_current_user(); $cur = common_current_user();
if ($cur->isMember($group)) { if ($cur->isMember($group)) {
$this->element('div', array('class' => 'error'), $this->element('div', array('class' => 'error'),
_m("You are already a member of this group.")); // TRANS: Error text displayed when trying to join a remote group the user is already a member of.
_m('You are already a member of this group.'));
$ok = false; $ok = false;
} else { } else {
$ok = true; $ok = true;
@ -168,7 +169,7 @@ class OStatusGroupAction extends OStatusSubAction
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions. // TRANS: Form instructions.
return _m('You can subscribe to groups from other supported sites. Paste the group\'s profile URI below:'); return _m('You can subscribe to groups from other supported sites. Paste the group\'s profile URI below:');
} }

View File

@ -231,6 +231,7 @@ class OStatusInitAction extends Action
} else if ($this->peopletag && $this->tagger) { } else if ($this->peopletag && $this->tagger) {
$user = User::staticGet('nickname', $this->tagger); $user = User::staticGet('nickname', $this->tagger);
if (empty($user)) { if (empty($user)) {
// TRANS: Client error.
$this->clientError(_m('No such user.')); $this->clientError(_m('No such user.'));
} }
@ -239,6 +240,7 @@ class OStatusInitAction extends Action
return common_local_url('profiletagbyid', return common_local_url('profiletagbyid',
array('tagger_id' => $user->id, 'id' => $peopletag->id)); array('tagger_id' => $user->id, 'id' => $peopletag->id));
} }
// TRANS: Client error.
$this->clientError(_m('No such list.')); $this->clientError(_m('No such list.'));
} else { } else {
// TRANS: Client error. // TRANS: Client error.

View File

@ -70,13 +70,16 @@ class OStatusPeopletagAction extends OStatusSubAction
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
$this->elementStart('li'); $this->elementStart('li');
$this->input('profile', $this->input('profile',
// TRANS: Field label.
_m('Subscribe to list'), _m('Subscribe to list'),
$this->profile_uri, $this->profile_uri,
_m("Address of the OStatus list, like http://example.net/user/all/tag")); // TRANS: Field title.
_m("Address of the OStatus list, like http://example.net/user/all/tag."));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
$this->submit('validate', _m('Continue')); // TRANS: Button text to continue joining a remote list.
$this->submit('validate', _m('BUTTON','Continue'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
@ -95,6 +98,7 @@ class OStatusPeopletagAction extends OStatusSubAction
$cur = common_current_user(); $cur = common_current_user();
if ($ptag->hasSubscriber($cur->id)) { if ($ptag->hasSubscriber($cur->id)) {
$this->element('div', array('class' => 'error'), $this->element('div', array('class' => 'error'),
// TRANS: Error text displayed when trying to subscribe to a list already a subscriber to.
_m('You are already subscribed to this list.')); _m('You are already subscribed to this list.'));
$ok = false; $ok = false;
} else { } else {
@ -170,7 +174,7 @@ class OStatusPeopletagAction extends OStatusSubAction
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for OStatus list subscription form. // TRANS: Instructions for OStatus list subscription form.
return _m('You can subscribe to lists from other supported sites. Paste the lists\'s URI below:'); return _m('You can subscribe to lists from other supported sites. Paste the list\'s URI below:');
} }
function selfLink() function selfLink()

View File

@ -68,7 +68,7 @@ class OStatusSubAction extends Action
_m('Subscribe to'), _m('Subscribe to'),
$this->profile_uri, $this->profile_uri,
// TRANS: Tooltip for field label "Subscribe to". // TRANS: Tooltip for field label "Subscribe to".
_m('OStatus user\'s address, like nickname@example.com or http://example.net/nickname')); _m('OStatus user\'s address, like nickname@example.com or http://example.net/nickname.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
// TRANS: Button text. // TRANS: Button text.
@ -106,8 +106,8 @@ class OStatusSubAction extends Action
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
$this->hidden('profile', $this->profile_uri); $this->hidden('profile', $this->profile_uri);
if ($this->oprofile->isGroup()) { if ($this->oprofile->isGroup()) {
$this->submit('submit', _m('Join'), 'submit', null,
// TRANS: Button text. // TRANS: Button text.
$this->submit('submit', _m('Join'), 'submit', null,
// TRANS: Tooltip for button "Join". // TRANS: Tooltip for button "Join".
_m('BUTTON','Join this group')); _m('BUTTON','Join this group'));
} else { } else {
@ -135,7 +135,7 @@ class OStatusSubAction extends Action
$cur = common_current_user(); $cur = common_current_user();
if ($cur->isSubscribed($profile)) { if ($cur->isSubscribed($profile)) {
$this->element('div', array('class' => 'error'), $this->element('div', array('class' => 'error'),
_m("You are already subscribed to this user.")); _m('You are already subscribed to this user.'));
$ok = false; $ok = false;
} else { } else {
$ok = true; $ok = true;
@ -393,7 +393,7 @@ class OStatusSubAction extends Action
function title() function title()
{ {
// TRANS: Page title for OStatus remote subscription form // TRANS: Page title for OStatus remote subscription form.
return _m('Confirm'); return _m('Confirm');
} }

View File

@ -27,7 +27,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
class OStatusTagAction extends OStatusInitAction class OStatusTagAction extends OStatusInitAction
{ {
var $nickname; var $nickname;
var $profile; var $profile;
var $err; var $err;
@ -37,6 +36,7 @@ class OStatusTagAction extends OStatusInitAction
parent::prepare($args); parent::prepare($args);
if (common_logged_in()) { if (common_logged_in()) {
// TRANS: Client error displayed when trying to tag a local object as if it is remote.
$this->clientError(_m('You can use the local tagging!')); $this->clientError(_m('You can use the local tagging!'));
return false; return false;
} }
@ -51,8 +51,10 @@ class OStatusTagAction extends OStatusInitAction
function showContent() function showContent()
{ {
// TRANS: Header for tagging a remote object. %s is a remote object's name.
$header = sprintf(_m('Tag %s'), $this->nickname); $header = sprintf(_m('Tag %s'), $this->nickname);
$submit = _m('Go'); // TRANS: Button text to tag a remote object.
$submit = _m('BUTTON','Go');
$this->elementStart('form', array('id' => 'form_ostatus_connect', $this->elementStart('form', array('id' => 'form_ostatus_connect',
'method' => 'post', 'method' => 'post',
'class' => 'form_settings', 'class' => 'form_settings',
@ -63,12 +65,16 @@ class OStatusTagAction extends OStatusInitAction
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
$this->elementStart('li', array('id' => 'ostatus_nickname')); $this->elementStart('li', array('id' => 'ostatus_nickname'));
// TRANS: Field label.
$this->input('nickname', _m('User nickname'), $this->nickname, $this->input('nickname', _m('User nickname'), $this->nickname,
_m('Nickname of the user you want to tag')); // TRANS: Field title.
_m('Nickname of the user you want to tag.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li', array('id' => 'ostatus_profile')); $this->elementStart('li', array('id' => 'ostatus_profile'));
// TRANS: Field label.
$this->input('profile', _m('Profile Account'), $this->profile, $this->input('profile', _m('Profile Account'), $this->profile,
_m('Your account id (i.e. user@identi.ca)')); // TRANS: Field title.
_m('Your account id (i.e. user@identi.ca).'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
$this->submit('submit', $submit); $this->submit('submit', $submit);
@ -83,6 +89,7 @@ class OStatusTagAction extends OStatusInitAction
$disco = new Discovery; $disco = new Discovery;
$result = $disco->lookup($acct); $result = $disco->lookup($acct);
if (!$result) { if (!$result) {
// TRANS: Client error displayed when remote profile could not be looked up.
$this->clientError(_m('Could not look up OStatus account profile.')); $this->clientError(_m('Could not look up OStatus account profile.'));
} }
@ -95,6 +102,7 @@ class OStatusTagAction extends OStatusInitAction
} }
} }
// TRANS: Client error displayed when remote profile address could not be confirmed.
$this->clientError(_m('Could not confirm remote profile address.')); $this->clientError(_m('Could not confirm remote profile address.'));
} }
@ -112,6 +120,7 @@ class OStatusTagAction extends OStatusInitAction
function title() function title()
{ {
// TRANS: Title for an OStatus list.
return _m('OStatus list'); return _m('OStatus list');
} }
} }

View File

@ -36,6 +36,7 @@ class OwnerxrdAction extends XrdAction
$this->user = User::siteOwner(); $this->user = User::siteOwner();
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed when referring to a non-existing user.
$this->clientError(_m('No such user.'), 404); $this->clientError(_m('No such user.'), 404);
return false; return false;
} }

View File

@ -36,18 +36,21 @@ class PeopletagsalmonAction extends SalmonAction
$id = $this->trimmed('id'); $id = $this->trimmed('id');
if (!$id) { if (!$id) {
// TRANS: Client error displayed trying to perform an action without providing an ID.
$this->clientError(_m('No ID.')); $this->clientError(_m('No ID.'));
} }
$this->peopletag = Profile_list::staticGet('id', $id); $this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) { if (empty($this->peopletag)) {
// TRANS: Client error displayed when referring to a non-existing list.
$this->clientError(_m('No such list.')); $this->clientError(_m('No such list.'));
} }
$oprofile = Ostatus_profile::staticGet('peopletag_id', $id); $oprofile = Ostatus_profile::staticGet('peopletag_id', $id);
if (!empty($oprofile)) { if (!empty($oprofile)) {
// TRANS: Client error displayed when trying to send a message to a remote list.
$this->clientError(_m('Cannot accept remote posts for a remote list.')); $this->clientError(_m('Cannot accept remote posts for a remote list.'));
} }
@ -81,14 +84,15 @@ class PeopletagsalmonAction extends SalmonAction
* currently we're doing the main logic in joingroup action * currently we're doing the main logic in joingroup action
* and so have to repeat it here. * and so have to repeat it here.
*/ */
function handleSubscribe() function handleSubscribe()
{ {
$oprofile = $this->ensureProfile(); $oprofile = $this->ensureProfile();
if (!$oprofile) { if (!$oprofile) {
$this->clientError(_m('Cannot read profile to set up profile tag subscription.')); // TRANS: Client error displayed when referring to a non-existing remote list.
$this->clientError(_m('Cannot read profile to set up list subscription.'));
} }
if ($oprofile->isGroup()) { if ($oprofile->isGroup()) {
// TRANS: Client error displayed when trying to subscribe a group to a list.
$this->clientError(_m('Groups cannot subscribe to lists.')); $this->clientError(_m('Groups cannot subscribe to lists.'));
} }
@ -107,22 +111,25 @@ class PeopletagsalmonAction extends SalmonAction
try { try {
Profile_tag_subscription::add($this->peopletag, $profile); Profile_tag_subscription::add($this->peopletag, $profile);
} catch (Exception $e) { } catch (Exception $e) {
// TRANS: Server error displayed when subscribing a remote user to a list fails.
// TRANS: %1$s is a profile URI, %2$s is a list name.
$this->serverError(sprintf(_m('Could not subscribe remote user %1$s to list %2$s.'), $this->serverError(sprintf(_m('Could not subscribe remote user %1$s to list %2$s.'),
$oprofile->uri, $this->peopletag->getBestName())); $oprofile->uri, $this->peopletag->getBestName()));
} }
} }
/** /**
* A remote user unsubscribed from our peopletag. * A remote user unsubscribed from our list.
*/ */
function handleUnsubscribe() function handleUnsubscribe()
{ {
$oprofile = $this->ensureProfile(); $oprofile = $this->ensureProfile();
if (!$oprofile) { if (!$oprofile) {
$this->clientError(_m('Cannot read profile to cancel list membership.')); // TRANS: Client error displayed when trying to unsubscribe from non-existing list.
$this->clientError(_m('Cannot read profile to cancel list subscription.'));
} }
if ($oprofile->isGroup()) { if ($oprofile->isGroup()) {
// TRANS: Client error displayed when trying to unsubscribe a group from a list.
$this->clientError(_m('Groups cannot subscribe to lists.')); $this->clientError(_m('Groups cannot subscribe to lists.'));
} }
@ -133,7 +140,9 @@ class PeopletagsalmonAction extends SalmonAction
Profile_tag_subscription::remove($this->peopletag->tagger, $this->peopletag->tag, $profile->id); Profile_tag_subscription::remove($this->peopletag->tagger, $this->peopletag->tag, $profile->id);
} catch (Exception $e) { } catch (Exception $e) {
$this->serverError(sprintf(_m('Could not remove remote user %1$s from list %2$s.'), // TRANS: Client error displayed when trying to unsubscribe a remote user from a list fails.
// TRANS: %1$s is a profile URL, %2$s is a list name.
$this->serverError(sprintf(_m('Could not unsubscribe remote user %1$s from list %2$s.'),
$oprofile->uri, $this->peopletag->getBestName())); $oprofile->uri, $this->peopletag->getBestName()));
return; return;
} }

View File

@ -47,6 +47,7 @@ class PushCallbackAction extends Action
$feedid = $this->arg('feed'); $feedid = $this->arg('feed');
common_log(LOG_INFO, "POST for feed id $feedid"); common_log(LOG_INFO, "POST for feed id $feedid");
if (!$feedid) { if (!$feedid) {
// TRANS: Server exception thrown when referring to a non-existing or empty feed.
throw new ServerException(_m('Empty or invalid feed id.'), 400); throw new ServerException(_m('Empty or invalid feed id.'), 400);
} }

View File

@ -34,12 +34,14 @@ class UsersalmonAction extends SalmonAction
$id = $this->trimmed('id'); $id = $this->trimmed('id');
if (!$id) { if (!$id) {
// TRANS: Client error displayed trying to perform an action without providing an ID.
$this->clientError(_m('No ID.')); $this->clientError(_m('No ID.'));
} }
$this->user = User::staticGet('id', $id); $this->user = User::staticGet('id', $id);
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error displayed when referring to a non-existing user.
$this->clientError(_m('No such user.')); $this->clientError(_m('No such user.'));
} }
@ -67,6 +69,7 @@ class UsersalmonAction extends SalmonAction
case ActivityObject::COMMENT: case ActivityObject::COMMENT:
break; break;
default: default:
// TRANS: Client exception thrown when an undefied activity is performed.
throw new ClientException(_m('Cannot handle that kind of post.')); throw new ClientException(_m('Cannot handle that kind of post.'));
} }
@ -92,11 +95,11 @@ class UsersalmonAction extends SalmonAction
!in_array(common_profile_url($this->user->nickname), $context->attention)) { !in_array(common_profile_url($this->user->nickname), $context->attention)) {
common_log(LOG_ERR, "{$this->user->uri} not in attention list (".implode(',', $context->attention).")"); common_log(LOG_ERR, "{$this->user->uri} not in attention list (".implode(',', $context->attention).")");
// TRANS: Client exception. // TRANS: Client exception.
throw new ClientException('To the attention of user(s), not including this one.'); throw new ClientException(_m('To the attention of user(s), not including this one.'));
} }
} else { } else {
// TRANS: Client exception. // TRANS: Client exception.
throw new ClientException('Not to anyone in reply to anything.'); throw new ClientException(_m('Not to anyone in reply to anything.'));
} }
$existing = Notice::staticGet('uri', $this->activity->objects[0]->id); $existing = Notice::staticGet('uri', $this->activity->objects[0]->id);
@ -189,18 +192,21 @@ class UsersalmonAction extends SalmonAction
{ {
if ($this->activity->target->type == ActivityObject::_LIST) { if ($this->activity->target->type == ActivityObject::_LIST) {
if ($this->activity->objects[0]->type != ActivityObject::PERSON) { if ($this->activity->objects[0]->type != ActivityObject::PERSON) {
throw new ClientException("Not a person object"); // TRANS: Client exception.
throw new ClientException(_m('Not a person object.'));
return false; return false;
} }
// this is a peopletag // this is a peopletag
$tagged = User::staticGet('uri', $this->activity->objects[0]->id); $tagged = User::staticGet('uri', $this->activity->objects[0]->id);
if (empty($tagged)) { if (empty($tagged)) {
throw new ClientException("Unidentified profile being tagged"); // TRANS: Client exception.
throw new ClientException(_m('Unidentified profile being tagged.'));
} }
if ($tagged->id !== $this->user->id) { if ($tagged->id !== $this->user->id) {
throw new ClientException("This user is not the one being tagged"); // TRANS: Client exception.
throw new ClientException(_m('This user is not the one being tagged.'));
} }
// save the list // save the list
@ -210,7 +216,8 @@ class UsersalmonAction extends SalmonAction
$ptag = $list->localPeopletag(); $ptag = $list->localPeopletag();
$result = Profile_tag::setTag($ptag->tagger, $tagged->id, $ptag->tag); $result = Profile_tag::setTag($ptag->tagger, $tagged->id, $ptag->tag);
if (!$result) { if (!$result) {
throw new ClientException("The tag could not be saved."); // TRANS: Client exception.
throw new ClientException(_m('The tag could not be saved.'));
} }
} }
} }
@ -219,18 +226,21 @@ class UsersalmonAction extends SalmonAction
{ {
if ($this->activity->target->type == ActivityObject::_LIST) { if ($this->activity->target->type == ActivityObject::_LIST) {
if ($this->activity->objects[0]->type != ActivityObject::PERSON) { if ($this->activity->objects[0]->type != ActivityObject::PERSON) {
throw new ClientException("Not a person object"); // TRANS: Client exception.
throw new ClientException(_m('Not a person object.'));
return false; return false;
} }
// this is a peopletag // this is a peopletag
$tagged = User::staticGet('uri', $this->activity->objects[0]->id); $tagged = User::staticGet('uri', $this->activity->objects[0]->id);
if (empty($tagged)) { if (empty($tagged)) {
throw new ClientException("Unidentified profile being untagged"); // TRANS: Client exception.
throw new ClientException(_m('Unidentified profile being untagged.'));
} }
if ($tagged->id !== $this->user->id) { if ($tagged->id !== $this->user->id) {
throw new ClientException("This user is not the one being untagged"); // TRANS: Client exception.
throw new ClientException(_m('This user is not the one being untagged.'));
} }
// save the list // save the list
@ -241,7 +251,8 @@ class UsersalmonAction extends SalmonAction
$result = Profile_tag::unTag($ptag->tagger, $tagged->id, $ptag->tag); $result = Profile_tag::unTag($ptag->tagger, $tagged->id, $ptag->tag);
if (!$result) { if (!$result) {
throw new ClientException("The tag could not be deleted."); // TRANS: Client exception.
throw new ClientException(_m('The tag could not be deleted.'));
} }
} }
} }

View File

@ -171,10 +171,10 @@ class Ostatus_profile extends Managed_DataObject
return true; return true;
} else if ($this->group_id && ($this->profile_id || $this->peopletag_id)) { } else if ($this->group_id && ($this->profile_id || $this->peopletag_id)) {
// TRANS: Server exception. %s is a URI // TRANS: Server exception. %s is a URI
throw new ServerException(sprintf(_m('Invalid ostatus_profile state: two or more IDs set for %s.'), $this->uri)); throw new ServerException(sprintf(_m('Invalid ostatus_profile state: Two or more IDs set for %s.'), $this->uri));
} else { } else {
// TRANS: Server exception. %s is a URI // TRANS: Server exception. %s is a URI
throw new ServerException(sprintf(_m('Invalid ostatus_profile state: all IDs empty for %s.'), $this->uri)); throw new ServerException(sprintf(_m('Invalid ostatus_profile state: All IDs empty for %s.'), $this->uri));
} }
} }
@ -189,10 +189,10 @@ class Ostatus_profile extends Managed_DataObject
return true; return true;
} else if ($this->peopletag_id && ($this->profile_id || $this->group_id)) { } else if ($this->peopletag_id && ($this->profile_id || $this->group_id)) {
// TRANS: Server exception. %s is a URI // TRANS: Server exception. %s is a URI
throw new ServerException(sprintf(_m('Invalid ostatus_profile state: two or more IDs set for %s.'), $this->uri)); throw new ServerException(sprintf(_m('Invalid ostatus_profile state: Two or more IDs set for %s.'), $this->uri));
} else { } else {
// TRANS: Server exception. %s is a URI // TRANS: Server exception. %s is a URI
throw new ServerException(sprintf(_m('Invalid ostatus_profile state: all IDs empty for %s.'), $this->uri)); throw new ServerException(sprintf(_m('Invalid ostatus_profile state: All IDs empty for %s.'), $this->uri));
} }
} }
@ -1209,6 +1209,7 @@ class Ostatus_profile extends Managed_DataObject
if ($object->link && common_valid_http_url($object->link)) { if ($object->link && common_valid_http_url($object->link)) {
return $object->link; return $object->link;
} }
// TRANS: Server exception.
throw new ServerException(_m('No author ID URI found.')); throw new ServerException(_m('No author ID URI found.'));
} }
@ -1234,6 +1235,7 @@ class Ostatus_profile extends Managed_DataObject
if (!$homeuri) { if (!$homeuri) {
common_log(LOG_DEBUG, __METHOD__ . " empty actor profile URI: " . var_export($activity, true)); common_log(LOG_DEBUG, __METHOD__ . " empty actor profile URI: " . var_export($activity, true));
// TRANS: Exception.
throw new Exception(_m('No profile URI.')); throw new Exception(_m('No profile URI.'));
} }
@ -1252,6 +1254,7 @@ class Ostatus_profile extends Managed_DataObject
if ($ptag) { if ($ptag) {
$local_user = User::staticGet('id', $ptag->tagger); $local_user = User::staticGet('id', $ptag->tagger);
if (!empty($local_user)) { if (!empty($local_user)) {
// TRANS: Exception.
throw new Exception(_m('Local list cannot be referenced as remote.')); throw new Exception(_m('Local list cannot be referenced as remote.'));
} }
} }
@ -1326,6 +1329,7 @@ class Ostatus_profile extends Managed_DataObject
$oprofile->peopletag_id = $ptag->insert(); $oprofile->peopletag_id = $ptag->insert();
if (!$oprofile->peopletag_id) { if (!$oprofile->peopletag_id) {
// TRANS: Server exception.
throw new ServerException(_m('Cannot save local list.')); throw new ServerException(_m('Cannot save local list.'));
} }
} }
@ -1731,7 +1735,6 @@ class Ostatus_profile extends Managed_DataObject
// XXX: try FOAF // XXX: try FOAF
if (array_key_exists('salmon', $hints)) { if (array_key_exists('salmon', $hints)) {
$salmonEndpoint = $hints['salmon']; $salmonEndpoint = $hints['salmon'];
// An account URL, a salmon endpoint, and a dream? Not much to go // An account URL, a salmon endpoint, and a dream? Not much to go

View File

@ -44,7 +44,7 @@ class SalmonAction extends Action
} }
if (empty($_SERVER['CONTENT_TYPE']) || $_SERVER['CONTENT_TYPE'] != 'application/magic-envelope+xml') { if (empty($_SERVER['CONTENT_TYPE']) || $_SERVER['CONTENT_TYPE'] != 'application/magic-envelope+xml') {
// TRANS: Client error. Do not translate "application/magic-envelope+xml" // TRANS: Client error. Do not translate "application/magic-envelope+xml".
$this->clientError(_m('Salmon requires "application/magic-envelope+xml".')); $this->clientError(_m('Salmon requires "application/magic-envelope+xml".'));
} }