require_once INSTALLDIR . '/lib/togglepeopletag.php';
/**
- *
+ *
* Action to tag a profile with a single tag.
- *
+ *
* Takes parameters:
*
* - tagged: the ID of the profile being tagged
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class AddpeopletagAction extends Action
{
var $user;
*
* @return boolean success flag
*/
-
function prepare($args)
{
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.'));
return false;
$this->user = common_current_user();
if (empty($this->user)) {
+ // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.'));
return false;
}
$this->tagged = Profile::staticGet('id', $tagged_id);
if (empty($this->tagged)) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing profile.
$this->clientError(_('No such profile.'));
return false;
}
$this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) {
- $this->clientError(_('No such peopletag.'));
+ // TRANS: Client error displayed trying to reference a non-existing people tag.
+ $this->clientError(_('No such people tag.'));
return false;
}
$omb01 = Remote_profile::staticGet('id', $tagged_id);
if (!empty($omb01)) {
+ // TRANS: Client error displayed trying to tag an OMB 0.1 remote profile.
$this->clientError(_('You cannot tag an OMB 0.1'.
' remote profile with this action.'));
return false;
*
* @return void
*/
-
function handle($args)
{
-
// Throws exception on error
$ptag = Profile_tag::setTag($this->user->id, $this->tagged->id,
$this->peopletag->tag);
$user = User::staticGet('id', $id);
if ($user) {
$this->clientError(
- sprintf(_('There was an unexpected error while tagging %s'),
+ // TRANS: Client error displayed when an unknown error occurs while tagging a user.
+ // TRANS: %s is a username.
+ sprintf(_('There was an unexpected error while tagging %s.'),
$user->nickname));
} else {
+ // TRANS: Client error displayed when an unknown error occurs while tagging a user.
+ // TRANS: %s is a profile URL.
$this->clientError(sprintf(_('There was a problem tagging %s.' .
'The remote server is probably not responding correctly, ' .
'please try retrying later.'), $this->profile->profileurl));
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
+ // TRANS: Title after subscribing to a people tag.
$this->element('title', null, _('Subscribed'));
$this->elementEnd('head');
$this->elementStart('body');
/**
* The list in question in the current request
*/
-
var $list = null;
/**
* Is this an update request?
*/
-
var $update = false;
/**
* Is this a delete request?
*/
-
var $delete = false;
/**
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
$this->list = $this->getTargetList($this->arg('user'), $this->arg('id'));
if (empty($this->list)) {
- $this->clientError(_('Not found'), 404, $this->format);
+ // TRANS: Client error displayed when referring to a non-existing list.
+ $this->clientError(_('List not found.'), 404, $this->format);
return false;
}
*
* @return boolean success flag
*/
-
function handle($args)
{
parent::handle($args);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
* require authentication if it is a write action or user is ambiguous
*
*/
-
function requiresAuth()
{
return parent::requiresAuth() ||
*
* @return boolean success
*/
-
function handlePut()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
- _('You can not update lists that don\'t belong to you.'),
+ // TRANS: Client error displayed when trying to update another user's list.
+ _('You cannot update lists that do not belong to you.'),
401,
$this->format
);
if(!$result) {
$this->clientError(
+ // TRANS: Client error displayed when an unknown error occurs updating a list.
_('An error occured.'),
503,
$this->format
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return boolean success
*/
-
function handleDelete()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
- _('You can not delete lists that don\'t belong to you.'),
+ // TRANS: Client error displayed when trying to delete another user's list.
+ _('You cannot delete lists that do not belong to you.'),
401,
$this->format
);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return boolean is_read-only=false
*/
-
function isReadOnly($args)
{
return false;
*
* @return String time_last_modified
*/
-
function lastModified()
{
if(!empty($this->list)) {
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->list)) {
return null;
}
-
}
* @link http://status.net/
* @see ApiBareAuthAction
*/
-
class ApiListMemberAction extends ApiBareAuthAction
{
/**
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
$this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id'));
if (empty($this->list)) {
- $this->clientError(_('Not found'), 404, $this->format);
+ // TRANS: Client error displayed when referring to a non-existing list.
+ $this->clientError(_('List not found.'), 404, $this->format);
return false;
}
if (empty($this->user)) {
- $this->clientError(_('No such user'), 404, $this->format);
+ // TRANS: Client error displayed when referring to a non-existing user.
+ $this->clientError(_('No such user.'), 404, $this->format);
return false;
}
return true;
*
* @return boolean success flag
*/
-
function handle($args)
{
parent::handle($args);
if(empty($ptag)) {
$this->clientError(
- _('The specified user is not a member of this list'),
+ // TRANS: Client error displayed when referring to a non-list member.
+ _('The specified user is not a member of this list.'),
400,
$this->format
);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return boolean success
*/
-
function handlePost()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
- _('You aren\'t allowed to add members to this list'),
+ // TRANS: Client error displayed when trying to add members to a list without having the right to do so.
+ _('You are not allowed to add members to this list.'),
401,
$this->format
);
if($this->user === false) {
$this->clientError(
- _('You must specify a member'),
+ // TRANS: Client error displayed when trying to modify list members without specifying them.
+ _('You must specify a member.'),
400,
$this->format
);
if(empty($result)) {
$this->clientError(
+ // TRANS: Client error displayed when an unknown error occurs viewing list members.
_('An error occured.'),
500,
$this->format
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return boolean success
*/
-
function handleDelete()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
- _('You aren\'t allowed to remove members from this list'),
+ // TRANS: Client error displayed when trying to remove members from a list without having the right to do so.
+ _('You are not allowed to remove members from this list.'),
401,
$this->format
);
if($this->user === false) {
$this->clientError(
- _('You must specify a member'),
+ // TRANS: Client error displayed when trying to modify list members without specifying them.
+ _('You must specify a member.'),
400,
$this->format
);
if(empty($ptag)) {
$this->clientError(
- _('The user you are trying to remove from the list is not a member'),
+ // TRANS: Client error displayed when trying to remove a list member that is not part of a list.
+ _('The user you are trying to remove from the list is not a member.'),
400,
$this->format
);
if(empty($result)) {
$this->clientError(
+ // TRANS: Client error displayed when an unknown error occurs viewing list members.
_('An error occured.'),
500,
$this->format
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
/**
* List the members of a list (people tagged)
*/
-
function getUsers()
{
$fn = array($this->list, 'getTagged');
* @link http://status.net/
* @see ApiBareAuthAction
*/
-
class ApiListMembershipsAction extends ApiBareAuthAction
{
var $lists = array();
* @return boolean success flag
*
*/
-
function prepare($args)
{
parent::prepare($args);
$this->user = $this->getTargetUser($this->arg('user'));
if (empty($this->user)) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
400,
$this->format
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
return true;
* @link http://status.net/
* @see ApiBareAuthAction
*/
-
class ApiListsAction extends ApiBareAuthAction
{
var $lists = null;
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
$this->user = $this->getTargetUser($this->arg('user'));
if (empty($this->user)) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404, $this->format);
return false;
}
* require authentication if it is a write action or user is ambiguous
*
*/
-
function requiresAuth()
{
return parent::requiresAuth() ||
* Show the lists the user has created if the request method is GET
* Create a new list by diferring to handlePost() if it is POST.
*/
-
function handle($args)
{
parent::handle($args);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return boolean success
*/
-
function handlePost()
{
$name=$this->arg('name');
if(empty($name)) {
// mimick twitter
- print _("A list's name can't be blank.");
+ // TRANS: Client error displayed when trying to create a list without a name.
+ print _("A list must have a name.");
exit(1);
}
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
/**
* Get lists
*/
-
function getLists()
{
$cursor = (int) $this->arg('cursor', -1);
*
* @return string etag
*/
-
function etag()
{
if (!$this->create && !empty($this->lists) && (count($this->lists) > 0)) {
return null;
}
-
}
$this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id'));
if (empty($this->list)) {
- $this->clientError(_('Not found'), 404, $this->format);
+ // TRANS: Client error displayed trying to perform an action related to a non-existing list.
+ $this->clientError(_('List not found.'), 404, $this->format);
return false;
}
if (empty($this->user)) {
- $this->clientError(_('No such user'), 404, $this->format);
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
+ $this->clientError(_('No such user.'), 404, $this->format);
return false;
}
return true;
if(empty($sub)) {
$this->clientError(
- _('The specified user is not a subscriber of this list'),
+ // TRANS: Client error displayed when a membership check for a user is nagative.
+ _('The specified user is not a subscriber of this list.'),
400,
$this->format
);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return boolean success
*/
-
function handlePost()
{
$result = Profile_tag_subscription::add($this->list,
if(empty($result)) {
$this->clientError(
+ // TRANS: Client error displayed when an unknown error occurs in the list subscribers action.
_('An error occured.'),
500,
$this->format
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
if(empty($ptag)) {
$this->clientError(
- _('You are not subscribed to this list'),
+ // TRANS: Client error displayed when trying to unsubscribe from a non-subscribed list.
+ _('You are not subscribed to this list.'),
400,
$this->format
);
if(empty($result)) {
$this->clientError(
+ // TRANS: Client error displayed when an unknown error occurs unsubscribing from a list.
_('An error occured.'),
500,
$this->format
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
* @return boolean success flag
*
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
if (empty($this->user)) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
400,
$this->format
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
return true;
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ApiTimelineListAction extends ApiPrivateAuthAction
{
* @return boolean success flag
*
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
if (empty($this->list)) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing list.
$this->clientError(_('List not found.'), 404, $this->format);
return false;
}
*
* @return void
*/
-
function showTimeline()
{
// We'll pull common formatting out of this for other formats
);
break;
case 'atom':
-
header('Content-Type: application/atom+xml; charset=utf-8');
try {
$atom->addEntryFromNotices($this->notices);
$this->raw($atom->getString());
} catch (Atom10FeedException $e) {
- $this->serverError(
- 'Could not generate feed for list - ' . $e->getMessage()
- );
+ // TRANS: Server error displayed whe trying to get a timeline fails.
+ // TRANS: %s is the error message.
+ $this->serverError( sprintf(_('Could not generate feed for list - %s'),$e->getMessage()));
return;
}
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return array notices
*/
-
function getNotices()
{
$fn = array($this->list, 'getNotices');
*
* @return boolean true
*/
-
function isReadOnly($args)
{
return true;
*
* @return string datestamp of the latest notice in the stream
*/
-
function lastModified()
{
if (!empty($this->notices) && (count($this->notices) > 0)) {
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->notices) && (count($this->notices) > 0)) {
return null;
}
-
}
class EditpeopletagAction extends OwnerDesignAction
{
-
var $msg, $confirm, $confirm_args=array();
function title()
{
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $this->boolean('delete')) {
+ // TRANS: Title for edit people tag page after deleting a tag.
+ // TRANS: %s is a tag.
return sprintf(_('Delete %s people tag'), $this->peopletag->tag);
}
+ // TRANS: Title for edit people tag page.
+ // TRANS: %s is a tag.
return sprintf(_('Edit people tag %s'), $this->peopletag->tag);
}
parent::prepare($args);
if (!common_logged_in()) {
+ // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.'));
return false;
}
}
} else {
if (!$tagger) {
+ // TRANS: Error message displayed when trying to perform an action that requires a tagging user or ID.
$this->clientError(_('No tagger or ID.'), 404);
return false;
}
}
if (!$this->peopletag) {
- $this->clientError(_('No such peopletag.'), 404);
+ // TRANS: Client error displayed when referring to a non-exsting people tag.
+ $this->clientError(_('No such people tag.'), 404);
return false;
}
if (!$user) {
// This should not be happening
+ // TRANS: Client error displayed when referring to non-local user.
$this->clientError(_('Not a local user.'), 404);
return false;
}
if ($current->id != $user->id) {
+ // TRANS: Client error displayed when reting to edit a tag that was not self-created.
$this->clientError(_('You must be the creator of the tag to edit it.'), 404);
return false;
}
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
$this->element('p', 'instructions', $this->confirm);
} else {
$this->element('p', 'instructions',
+ // TRANS: Form instruction for edit people tag form.
_('Use this form to edit the people tag.'));
}
}
$cancel = $this->arg('cancel');
if ($delete && $cancel) {
+ // TRANS: Form validation error displayed if the form data for deleting a tag was incorrect.
$this->showForm(_('Delete aborted.'));
return;
}
$set_private = $private && $this->peopletag->private != $private;
if ($delete && !$confirm) {
+ // TRANS: Text in confirmation dialog for deleting a tag.
$this->showConfirm(_('Deleting this tag will permanantly remove ' .
'all its subscription and membership records. ' .
'Do you still want to continue?'), array('delete' => 1));
return;
} else if (common_valid_tag($tag)) {
+ // TRANS: Form validation error displayed if a given tag is invalid.
$this->showForm(_('Invalid tag.'));
return;
} else if ($tag != $this->peopletag->tag && $this->tagExists($tag)) {
+ // TRANS: Form validation error displayed if a given tag is already present.
+ // TRANS: %s is the already present tag.
$this->showForm(sprintf(_('You already have a tag named %s.'), $tag));
return;
} else if (Profile_list::descriptionTooLong($description)) {
- $this->showForm(sprintf(_('description is too long (max %d chars).'), Profile_list::maxDescription()));
+ $this->showForm(sprintf(
+ // TRANS: Client error shown when providing too long a description when editing a people tag.
+ // TRANS: %d is the maximum number of allowed characters.
+ _m('Description is too long (maximum %d character).',
+ 'Description is too long (maximum %d characters).',
+ Profile_list::maxDescription()),
+ Profile_list::maxDescription()));
return;
} else if ($set_private && !$confirm && !$cancel) {
$fwd = array('tag' => $tag,
'description' => $description,
'private' => (int) $private);
+ // TRANS: Text in confirmation dialog for setting a tag from public to private.
$this->showConfirm(_('Setting a public tag as private will ' .
'permanently remove all the existing ' .
'subscriptions to it. Do you still want to continue?'), $fwd);
if (!$result) {
common_log_db_error($this->group, 'UPDATE', __FILE__);
- $this->serverError(_('Could not update peopletag.'));
+ // TRANS: TRANS: Server error displayed when updating a people tag fails.
+ $this->serverError(_('Could not update people tag.'));
}
$this->peopletag->query('COMMIT');
'tag' => $tag)),
303);
} else {
+ // TRANS: Edit people tag form success message.
$this->showForm(_('Options saved.'));
}
}
function title()
{
if ($this->page == 1) {
- return sprintf(_("Public people tag %s"), $this->tag);
+ // TRANS: Title for people tag page.
+ // TRANS: %s is a tag.
+ return sprintf(_('Public people tag %s'), $this->tag);
} else {
- return sprintf(_("Public people tag %s, page %d"), $this->tag, $this->page);
+ // TRANS: Title for people tag page.
+ // TRANS: %1$s is a tag, %2$d is a page number.
+ return sprintf(_('Public people tag %1$s, page %2$d'), $this->tag, $this->page);
}
}
function showAnonymousMessage()
{
$notice =
+ // TRANS: Message for anonymous users on people tag page.
+ // TRANS: This message contains Markdown links in the form [description](link).
_('People tags are how you sort similar ' .
'people on %%site.name%%, a [micro-blogging]' .
'(http://en.wikipedia.org/wiki/Micro-blogging) service ' .
} else {
$ptags->whereAdd('(profile_list.private = false OR (' .
' profile_list.tagger =' . $user->id .
- ' AND profile_list.private = true) )');
+ ' AND profile_list.private = true) )');
$ptags->orderBy('profile_list.modified DESC');
$ptags->find();
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
$this->user = common_current_user();
if (empty($this->user)) {
+ // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.'));
return false;
}
$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;
*
* @return String time
*/
-
function lastModified()
{
return strtotime($this->last_mod);
*
* @return void
*/
-
function handle($args)
{
//common_log(LOG_DEBUG, 'Autocomplete data: ' . json_encode($this->tags));
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class PeopletaggedAction extends OwnerDesignAction
{
var $page = null;
}
if (!$tagger) {
+ // TRANS: Client error displayed when a tagger is expected but not provided.
$this->clientError(_('No tagger.'), 404);
return false;
}
$user = User::staticGet('nickname', $tagger);
if (!$user) {
+ // TRANS: Client error displayed when referring to non-existing user.
$this->clientError(_('No such user.'), 404);
return false;
}
$this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag));
if (!$this->peopletag) {
- $this->clientError(_('No such peopletag.'), 404);
+ // TRANS: Client error displayed when referring to non-existing people tag.
+ $this->clientError(_('No such people tag.'), 404);
return false;
}
function title()
{
if ($this->page == 1) {
- return sprintf(_('People tagged %s by %s'),
+ // TRANS: Title for list of people tagged by the user with a tag.
+ // TRANS: %1$s is a tag, %2$s is a username.
+ return sprintf(_('People tagged %1$s by %2$s'),
$this->peopletag->tag, $this->tagger->nickname);
} else {
- return sprintf(_('People tagged %s by %s, page %d'),
+ // TRANS: Title for list of people tagged by the user with a tag.
+ // TRANS: %1$s is a tag, %2$s is a username, %2$s is a page number.
+ return sprintf(_('People tagged %1$s by %2$s, page %3$d'),
$this->peopletag->tag, $this->user->nickname,
$this->page);
}
parent::showFullName();
if ($this->profile->id == $this->peopletag->tagger) {
$this->out->text(' ');
+ // TRANS: Addition in tag membership list for creator of a tag.
$this->out->element('span', 'role', _('Creator'));
}
}
/**
* Fetch necessary return-to arguments for the profile forms
* to return to this list when they're done.
- *
+ *
* @return array
*/
protected function returnToArgs()
if ($this->page == 1) {
if ($this->isOwner()) {
if ($this->arg('private')) {
+ // TRANS: Title for people tags by a user page for a private tag.
return _('Private people tags by you');
} else if ($this->arg('public')) {
+ // TRANS: Title for people tags by a user page for a public tag.
return _('Public people tags by you');
}
+ // TRANS: Title for people tags by a user page.
return _('People tags by you');
}
- return sprintf(_("People tags by %s"), $this->tagger->nickname);
+ // TRANS: Title for people tags by a user page.
+ // TRANS: %s is a user nickname.
+ return sprintf(_('People tags by %s'), $this->tagger->nickname);
} else {
- return sprintf(_("People tags by %s, page %d"), $this->tagger->nickname, $this->page);
+ // TRANS: Title for people tags by a user page.
+ // TRANS: %1$s is a user nickname, %2$d is a page number.
+ return sprintf(_('People tags by %1$s, page %2$d'), $this->tagger->nickname, $this->page);
}
}
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404);
return false;
}
$this->tagger = $this->user->getProfile();
if (!$this->tagger) {
+ // TRANS: Server error displayed when a user has no profile.
$this->serverError(_('User has no profile.'));
return false;
}
$this->tags = $this->tagger->getOwnedTags(false, $offset, $limit);
} else if ($this->arg('private')) {
if (empty($user)) {
- $this->clientError(_('Not logged in'), 403);
+ // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
+ $this->clientError(_('Not logged in.'), 403);
}
if ($this->isOwner()) {
$this->tags = $this->tagger->getPrivateTags($offset, $limit);
} else {
+ // TRANS: Client error displayed when trying view another user's private people tags.
$this->clientError(_('You cannot view others\' private people tags'), 403);
}
} else {
function showModeSelector()
{
$this->elementStart('dl', array('id'=>'filter_tags'));
+ // TRANS: Mode selector label.
$this->element('dt', null, _('Mode'));
$this->elementStart('dd');
$this->elementStart('ul');
array('href' =>
common_local_url('peopletagsforuser',
array('nickname' => $this->user->nickname))),
+ // TRANS: Link text to show people tags for user %s.
sprintf(_('People tags for %s'), $this->tagger->nickname));
$this->elementEnd('li');
array('nickname' => $this->tagger->nickname)),
'method' => 'post'));
$this->elementStart('fieldset');
+ // TRANS: Fieldset legend.
$this->element('legend', null, _('Select tag to filter'));
$priv = $this->arg('private');
if (!$priv && !$pub) {
$priv = $pub = true;
}
- $this->checkbox('private', _m('Private'), $priv,
- _m('Show private tags'));
- $this->checkbox('public', _m('Public'), $pub,
- _m('Show public tags'));
+ // TRANS: Checkbox label to show private tags.
+ $this->checkbox('private', _m('LABEL','Private'), $priv,
+ // TRANS: Checkbox title.
+ _('Show private tags.'));
+ // TRANS: Checkbox label to show public tags.
+ $this->checkbox('public', _m('LABEL','Public'), $pub,
+ // TRANS: Checkbox title.
+ _('Show public tags.'));
$this->hidden('nickname', $this->user->nickname);
- $this->submit('submit', _('Go'));
+ // TRANS: Submit button text for tag filter form.
+ $this->submit('submit', _m('BUTTON','Go'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
$this->elementEnd('li');
function showAnonymousMessage()
{
$notice =
+ // TRANS: Message displayed for anonymous users on page that displays people tags by a user.
+ // TRANS: This message contains Markdown links in the form [description](links).
+ // TRANS: %s is a tagger nickname.
sprintf(_('These are people tags created by **%s**. ' .
'People tags are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' .
function showEmptyListMessage()
{
+ // TRANS: Message displayed on page that displays people tags by a user when there are none.
+ // TRANS: This message contains Markdown links in the form [description](links).
+ // TRANS: %s is a tagger nickname.
$message = sprintf(_('%s has not created any [people tags](%%%%doc.tags%%%%) yet.'), $this->tagger->nickname);
$this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
function title()
{
if ($this->page == 1) {
- return sprintf(_("People tags for %s"), $this->tagged->nickname);
+ // Page title. %s is a tagged user's nickname.
+ return sprintf(_('People tags for %s'), $this->tagged->nickname);
} else {
- return sprintf(_("People tags for %s, page %d"), $this->tagged->nickname, $this->page);
+ // Page title. %1$s is a tagged user's nickname, %2$s is a page number.
+ return sprintf(_('People tags for %1$s, page %2$d'), $this->tagged->nickname, $this->page);
}
}
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404);
return false;
}
$this->tagged = $this->user->getProfile();
if (!$this->tagged) {
+ // TRANS: Server error displayed when a user has no profile.
$this->serverError(_('User has no profile.'));
return false;
}
function showAnonymousMessage()
{
$notice =
+ // TRANS: Message displayed for anonymous users on page that displays people tags for a user.
+ // TRANS: This message contains Markdown links in the form [description](links).
+ // TRANS: %s is a tagger nickname.
sprintf(_('These are people tags for **%s**. ' .
'People tags are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' .
'class' => 'child_1'));
$user = common_current_user();
+ // TRANS: Page notice.
$text = ($this->tagged->id == @$user->id) ? _('People tags by you') :
+ // TRANS: Page notice. %s is a tagger's nickname.
sprintf(_('People tags by %s'), $this->tagged->nickname);
$this->element('a',
array('href' =>
function showEmptyListMessage()
{
+ // TRANS: Message displayed on page that displays people tags for a user when there are none.
+ // TRANS: This message contains Markdown links in the form [description](links).
+ // TRANS: %s is a tagger nickname.
$message = sprintf(_('%s has not been [tagged](%%%%doc.tags%%%%) by anyone yet.'), $this->tagged->nickname);
$this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class PeopletagsubscribersAction extends OwnerDesignAction
{
var $page = null;
}
if (!$tagger) {
+ // TRANS: Client error displayed when a tagger is expected but not provided.
$this->clientError(_('No tagger.'), 404);
return false;
}
$user = User::staticGet('nickname', $tagger);
if (!$user) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404);
return false;
}
$this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag));
if (!$this->peopletag) {
- $this->clientError(_('No such peopletag.'), 404);
+ // TRANS: Client error displayed trying to reference a non-existing people tag.
+ $this->clientError(_('No such people tag.'), 404);
return false;
}
function title()
{
if ($this->page == 1) {
- return sprintf(_('Subscribers of people tagged %s by %s'),
+ // TRANS: Page title for list of people tag subscribers.
+ // TRANS: %1$s is a tag, %2$s is a user nickname.
+ return sprintf(_('Subscribers of people tagged %1$s by %2$s'),
$this->peopletag->tag, $this->tagger->nickname);
} else {
- return sprintf(_('Subscribers of people tagged %s by %s, page %d'),
+ // TRANS: Page title for list of people tag subscribers.
+ // TRANS: %1$s is a tag, %2$s is a user nickname, %3$d is a page number.
+ return sprintf(_('Subscribers of people tagged %1$s by %2$s, page %3$d'),
$this->peopletag->tag, $this->tagger->nickname,
$this->page);
}
parent::showFullName();
if ($this->profile->id == $this->peopletag->tagger) {
$this->out->text(' ');
+ // TRANS: Addition in tag subscribers list for creator of a tag.
$this->out->element('span', 'role', _('Creator'));
}
}
/**
* Fetch necessary return-to arguments for the profile forms
* to return to this list when they're done.
- *
+ *
* @return array
*/
protected function returnToArgs()
function title()
{
if ($this->page == 1) {
- return sprintf(_("People tags subscriptions by %s"), $this->profile->nickname);
+ // TRANS: Title for page that displays people tags subscribed to by a user.
+ // TRANS: %s is a profile nickname.
+ return sprintf(_('People tags subscriptions by %s'), $this->profile->nickname);
} else {
- return sprintf(_("People tags subscriptions by %s, page %d"), $this->profile->nickname, $this->page);
+ // TRANS: Title for page that displays people tags subscribed to by a user.
+ // TRANS: %1$s is a profile nickname, %2$d is a page number.
+ return sprintf(_('People tags subscriptions by %1$s, page %2$d'), $this->profile->nickname, $this->page);
}
}
$user = User::staticGet('nickname', $nickname);
if (!$user) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404);
return false;
}
$this->profile = $user->getProfile();
if (!$this->profile) {
+ // TRANS: Server error displayed when a user has no profile.
$this->serverError(_('User has no profile.'));
return false;
}
function showAnonymousMessage()
{
$notice =
+ // TRANS: Message displayed for anonymous users on page that displays people tags subscribed to by a user.
+ // TRANS: This message contains Markdown links in the form [description](links).
+ // TRANS: %s is a profile nickname.
sprintf(_('These are people tags subscribed to by **%s**. ' .
'People tags are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' .
*
* @return boolean success flag
*/
-
function prepare($args)
{
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.'));
return false;
$this->user = common_current_user();
if (empty($this->user)) {
+ // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.'));
return false;
}
$this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) {
- $this->clientError(_('No such peopletag.'));
+ // TRANS: Client error displayed trying to reference a non-existing people tag.
+ $this->clientError(_('No such people tag.'));
return false;
}
$field = $this->arg('field');
if (!in_array($field, array('fulltext', 'nickname', 'fullname', 'description', 'location', 'uri'))) {
- $this->clientError(sprintf(_('Unidentified field %s'), htmlspecialchars($field)), 404);
+ // TRANS: Client error displayed when trying to add an unindentified field to profile.
+ // TRANS: %s is a field name.
+ $this->clientError(sprintf(_('Unidentified field %s.'), htmlspecialchars($field)), 404);
return false;
}
$this->field = $field;
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
- $this->element('title', null, _('Search results'));
+ // TRANS: Page title.
+ $this->element('title', null, _m('TITLE','Search results'));
$this->elementEnd('head');
$this->elementStart('body');
$profiles = $this->getResults();
}
$this->elementEnd('ul');
} else {
+ // TRANS: Output when there are no results for a search.
$this->element('p', 'error', _('No results.'));
}
}
$q = $this->arg('q');
$q = strtolower($q);
if (strlen($q) < 3) {
- $this->msg = _('The search string must be atleast 3 characters long');
+ // TRANS: Error message in case a search is shorter than three characters.
+ $this->msg = _('The search string must be at least 3 characters long.');
}
$page = $this->arg('page');
$page = (int) (empty($page) ? 1 : $page);
else {
$cnt = $profile->find();
}
+ // @todo FIXME: Call-time pass-by-reference has been deprecated.
Event::handle('EndProfileCompletionSearch', $this, &$profile, $search_engine);
}
if (!common_valid_profile_tag($tag)) {
// TRANS: Validation error in form for profile settings.
// TRANS: %s is an invalid tag.
- $this->showForm(sprintf(_('Invalid tag: "%s"'), $tag));
+ $this->showForm(sprintf(_('Invalid tag: "%s".'), $tag));
return;
}
*
* @return boolean true
*/
-
function isReadOnly($args)
{
return true;
$tagger_id = $this->arg('tagger_id');
if (!$id) {
+ // TRANS: Client error displayed trying to perform an action without providing an ID.
$this->clientError(_('No ID.'));
return false;
}
$this->peopletag = Profile_list::staticGet('id', $id);
if (!$this->peopletag) {
+ // TRANS: Client error displayed trying to reference a non-existing people tag.
$this->clientError(_('No such people tag.'), 404);
return false;
}
*
* @return void
*/
-
function handle($args)
{
common_redirect($this->peopletag->homeUrl(), 303);
* @copyright 2008-2009 StatusNet, Inc.
* @link http://status.net/
*/
-
class PublicpeopletagcloudAction extends Action
{
function isReadOnly($args)
function title()
{
+ // TRANS: Title for page with public people tag cloud.
return _('Public people tag cloud');
}
function showPageNotice()
{
$this->element('p', 'instructions',
- sprintf(_('These are most used people tags on %s '),
+ // TRANS: Page notice for page with public people tag cloud.
+ // TRANS: %s is a StatusNet sitename.
+ sprintf(_('These are most used people tags on %s'),
common_config('site', 'name')));
}
function showEmptyList()
{
+ // TRANS: Empty list message on page with public people tag cloud.
+ // TRANS: This message contains Markdown links in the form [description](link).
$message = _('No one has [tagged](%%doc.tags%%) anyone yet.') . ' ';
if (common_logged_in()) {
+ // TRANS: Additional empty list message on page with public people tag cloud for logged in users.
$message .= _('Be the first to tag someone!');
}
else {
+ // TRANS: Additional empty list message on page with public people tag cloud for anonymous users.
+ // TRANS: This message contains Markdown links in the form [description](link).
$message .= _('Why not [register an account](%%action.register%%) and be the first to tag someone!');
}
ksort($tw);
$this->elementStart('dl');
+ // TRANS: DT element on on page with public people tag cloud.
$this->element('dt', null, _('People tag cloud'));
$this->elementStart('dd');
$this->elementStart('ul', 'tags xoxo tag-cloud');
$this->elementStart('li', $rel);
- $count = ($weight == 1) ? '1 person tagged' : '%d people tagged';
+ // TRANS: Link title for number of people tagged. %d is the number of people tagged.
+ $title = sprintf(_m('1 person tagged','%d people tagged',$weight),$weight);
$this->element('a', array('href' => common_local_url('peopletag', array('tag' => $tag)),
- 'title' => sprintf(_($count), $weight)), $tag);
+ 'title' => $title), $tag);
$this->elementEnd('li');
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class RemovepeopletagAction extends Action
{
var $user;
*
* @return boolean success flag
*/
-
function prepare($args)
{
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.'));
return false;
$this->user = common_current_user();
if (empty($this->user)) {
+ // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.'));
return false;
}
$this->tagged = Profile::staticGet('id', $tagged_id);
if (empty($this->tagged)) {
+ // TRANS: Client error displayed when referring to a non-existing profile.
$this->clientError(_('No such profile.'));
return false;
}
$this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) {
- $this->clientError(_('No such peopletag.'));
+ // TRANS: Client error displayed trying to reference a non-existing people tag.
+ $this->clientError(_('No such people tag.'));
return false;
}
$omb01 = Remote_profile::staticGet('id', $tagged_id);
if (!empty($omb01)) {
+ // TRANS: Client error displayed when trying to (un)tag an OMB 0.1 remote profile.
$this->clientError(_('You cannot tag or untag an OMB 0.1'.
' remote profile with this action.'));
return false;
*
* @return void
*/
-
function handle($args)
{
// Throws exception on error
$user = User::staticGet('id', $this->tagged->id);
if ($user) {
$this->clientError(
- sprintf(_('There was an unexpected error while tagging %s'),
+ // TRANS: Client error displayed when an unknown error occurs while tagging a user.
+ // TRANS: %s is a username.
+ sprintf(_('There was an unexpected error while tagging %s.'),
$user->nickname));
} else {
+ // TRANS: Client error displayed when an unknown error occurs while tagging a user.
+ // TRANS: %s is a profile URL.
$this->clientError(sprintf(_('There was a problem tagging %s.' .
'The remote server is probably not responding correctly, ' .
'please try retrying later.'), $this->profile->profileurl));
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
+ // TRANS: Title after untagging a people tag.
$this->element('title', null, _('Untagged'));
$this->elementEnd('head');
$this->elementStart('body');
*/
class SelftagAction extends Action
{
-
var $tag = null;
var $page = null;
*/
function showContent()
{
-
$profile = new Profile();
$offset = ($this->page - 1) * PROFILES_PER_PAGE;
*/
function title()
{
- return sprintf(_('Users self-tagged with %1$s - page %2$d'),
+ // TRANS: Page title for page showing self tags.
+ // TRANS: %1$s is a tag, %2$d is a page number.
+ return sprintf(_('Users self-tagged with %1$s, page %2$d'),
$this->tag, $this->page);
}
-
}
class SelfTagProfileList extends ProfileList
}
if (!$tagger) {
+ // TRANS: Client error displayed when a tagger is expected but not provided.
$this->clientError(_('No tagger.'), 404);
return false;
}
$user = User::staticGet('nickname', $tagger);
if (!$user) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404);
return false;
}
($this->peopletag->private && $this->peopletag->tagger === $current->id));
if (!$can_see) {
- $this->clientError(_('No such peopletag.'), 404);
+ // TRANS: Client error displayed trying to reference a non-existing people tag.
+ $this->clientError(_('No such people tag.'), 404);
return false;
}
$this->notice = $this->peopletag->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
if ($this->page > 1 && $this->notice->N == 0) {
- // TRANS: Server error when page not found (404)
+ // TRANS: Server error when page not found (404).
$this->serverError(_('No such page.'), $code = 404);
}
parent::handle($args);
if (!$this->peopletag) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'));
return;
}
function title()
{
if ($this->page > 1) {
-
if($this->peopletag->private) {
- return sprintf(_('Private timeline for people tagged %s by you, page %d'),
+ // TRANS: Title for private people tag timeline.
+ // TRANS: %1$s is a people tag, %2$s is a page number.
+ return sprintf(_('Private timeline for people tagged %1$s by you, page %2$d'),
$this->peopletag->tag, $this->page);
}
$current = common_current_user();
if (!empty($current) && $current->id == $this->peopletag->tagger) {
- return sprintf(_('Timeline for people tagged %s by you, page %d'),
+ // TRANS: Title for public people tag timeline where the viewer is the tagger.
+ // TRANS: %1$s is a people tag, %2$s is a page number.
+ return sprintf(_('Timeline for people tagged %1$s by you, page %2$d'),
$this->peopletag->tag, $this->page);
}
- // TRANS: Page title. %1$s is user nickname, %2$d is page number
+ // TRANS: Title for private people tag timeline.
+ // TRANS: %1$s is a people tag, %2$s is the tagger's nickname, %3$d is a page number.
return sprintf(_('Timeline for people tagged %1$s by %2$s, page %3$d'),
$this->peopletag->tag,
$this->tagger->nickname,
$this->page
);
} else {
-
if($this->peopletag->private) {
+ // TRANS: Title for private people tag timeline.
+ // TRANS: %s is a people tag.
return sprintf(_('Private timeline of people tagged %s by you'),
- $this->peopletag->tag, $this->page);
+ $this->peopletag->tag);
}
$current = common_current_user();
if (!empty($current) && $current->id == $this->peopletag->tagger) {
+ // TRANS: Title for public people tag timeline where the viewer is the tagger.
+ // TRANS: %s is a people tag.
return sprintf(_('Timeline for people tagged %s by you'),
- $this->peopletag->tag, $this->page);
+ $this->peopletag->tag);
}
- // TRANS: Page title. %1$s is user nickname, %2$d is page number
+ // TRANS: Title for private people tag timeline.
+ // TRANS: %1$s is a people tag, %2$s is the tagger's nickname.
return sprintf(_('Timeline for people tagged %1$s by %2$s'),
$this->peopletag->tag,
- $this->tagger->nickname,
- $this->page
+ $this->tagger->nickname
);
}
}
'format' => 'rss'
)
),
- // TRANS: %1$s is user nickname
+ // TRANS: Feed title.
+ // TRANS: %s is tagger's nickname.
sprintf(_('Feed for friends of %s (RSS 2.0)'), $this->tagger->nickname)),
new Feed(Feed::ATOM,
common_local_url(
'format' => 'atom'
)
),
- // TRANS: %1$s is user nickname
- sprintf(_('Feed for people tagged %s by %s (Atom)'),
+ // TRANS: Feed title.
+ // TRANS: %1$s is a people tag, %2$s is tagger's nickname.
+ sprintf(_('Feed for people tagged %1$s by %2$s (Atom)'),
$this->peopletag->tag, $this->tagger->nickname
)
)
function showEmptyListMessage()
{
- // TRANS: %1$s is user nickname
- $message = sprintf(_('This is the timeline for people tagged %s by %s but no one has posted anything yet.'), $this->peopletag->tag, $this->tagger->nickname) . ' ';
+ // TRANS: Empty list message for people tag timeline.
+ // TRANS: %1$s is a people tag, %2$s is a tagger's nickname.
+ $message = sprintf(_('This is the timeline for people tagged %1$s by %2$s but no one has posted anything yet.'),
+ $this->peopletag->tag,
+ $this->tagger->nickname) . ' ';
if (common_logged_in()) {
$current_user = common_current_user();
if ($this->tagger->id == $current_user->id) {
+ // TRANS: Additional empty list message for people tag timeline for currently logged in user tagged tags.
$message .= _('Try tagging more people.');
}
} else {
- $message .= _('Why not [register an account](%%%%action.register%%%%) and start following this timeline.');
+ // TRANS: Additional empty list message for people tag timeline.
+ // TRANS: This message contains Markdown links in the form [description](link).
+ $message .= _('Why not [register an account](%%%%action.register%%%%) and start following this timeline!');
}
$this->elementStart('div', 'guide');
$this->elementStart('div', array('id' => 'entity_tagged',
'class' => 'section'));
if (Event::handle('StartShowTaggedProfilesMiniList', array($this))) {
-
$title = '';
$current = common_current_user();
if(!empty($current) && $this->peopletag->tagger == $current->id) {
+ // TRANS: Header on show profile tag page.
+ // TRANS: %s is a people tag.
$title = sprintf(_('People tagged %s by you'), $this->peopletag->tag);
} else {
+ // TRANS: Header on show profile tag page.
+ // TRANS: %1$s is a people tag, %2$s is a tagger's nickname.
$title = sprintf(_('People tagged %1$s by %2$s'),
$this->peopletag->tag,
$this->tagger->nickname);
$pml = new ProfileMiniList($profile, $this);
$cnt = $pml->show();
if ($cnt == 0) {
+ // TRANS: Content of "People tagged x by a user" if there are no tagged users.
$this->element('p', null, _('(None)'));
}
}
array('nickname' => $this->tagger->nickname,
'profiletag' => $this->peopletag->tag)),
'class' => 'more'),
+ // TRANS: Link for more "People tagged x by a user"
+ // TRANS: if there are more than the mini list's maximum.
_('Show all'));
$this->elementEnd('p');
}
$this->elementStart('div', array('id' => 'entity_subscribers',
'class' => 'section'));
if (Event::handle('StartShowProfileTagSubscribersMiniList', array($this))) {
+ // TRANS: Header for tag subscribers.
$this->element('h2', null, _('Subscribers'));
$cnt = 0;
$pml = new ProfileMiniList($profile, $this);
$cnt = $pml->show();
if ($cnt == 0) {
+ // TRANS: Content of "People following tag x" if there are no subscribed users.
$this->element('p', null, _('(None)'));
}
}
array('nickname' => $this->tagger->nickname,
'profiletag' => $this->peopletag->tag)),
'class' => 'more'),
+ // TRANS: Link for more "People following tag x"
+ // TRANS: if there are more than the mini list's maximum.
_('All subscribers'));
$this->elementEnd('p');
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class SubscribepeopletagAction extends Action
{
var $peopletag = null;
/**
* Prepare to run
*/
-
function prepare($args)
{
parent::prepare($args);
if (!common_logged_in()) {
- $this->clientError(_('You must be logged in to unsubscribe to a peopletag.'));
+ // TRANS: Client error displayed when trying to perform an action while not logged in.
+ $this->clientError(_('You must be logged in to unsubscribe to a people tag.'));
return false;
}
// Only allow POST requests
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ // TRANS: Client error displayed when trying to use another method than POST.
$this->clientError(_('This action only accepts POST requests.'));
return false;
}
$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;
if ($id) {
$this->peopletag = Profile_list::staticGet('id', $id);
} else {
+ // TRANS: Client error displayed when trying to perform an action without providing an ID.
$this->clientError(_('No ID given.'), 404);
return false;
}
if (!$this->peopletag || $this->peopletag->private) {
- $this->clientError(_('No such peopletag.'), 404);
+ // TRANS: Client error displayed trying to reference a non-existing people tag.
+ $this->clientError(_('No such people tag.'), 404);
return false;
}
try {
Profile_tag_subscription::add($this->peopletag, $cur);
} catch (Exception $e) {
- $this->serverError(sprintf(_('Could not subscribe user %1$s to peopletag %2$s.'),
+ // TRANS: Server error displayed subscribing to a people tag fails.
+ // TRANS: %1$s is a user nickname, %2$s is a people tag.
+ $this->serverError(sprintf(_('Could not subscribe user %1$s to people tag %2$s.'),
$cur->nickname, $this->peopletag->tag) . ' ' . $e->getMessage());
}
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
- $this->element('title', null, sprintf(_('%1$s subscribed to peopletag %2$s by %3$s'),
+ // TRANS: Title of form to subscribe to a people tag.
+ // TRANS: %1%s is a user nickname, %2$s is a people tag, %3$s is a tagger nickname.
+ $this->element('title', null, sprintf(_('%1$s subscribed to people tag %2$s by %3$s'),
$cur->nickname,
$this->peopletag->tag,
$this->tagger->nickname));
$this->profile = Profile::staticGet('id', $id);
if (!$this->profile) {
+ // TRANS: Client error displayed when referring to non-existing profile ID.
$this->clientError(_('No profile with that ID.'));
return false;
}
$current = common_current_user()->getProfile();
if ($this->profile && !$current->canTag($this->profile)) {
+ // TRANS: Client error displayed when trying to tag a user that cannot be tagged.
$this->clientError(_('You cannot tag this user.'));
}
return true;
function title()
{
if (!$this->profile) {
+ // TRANS: Title for people tag form when not on a profile page.
return _('Tag a profile');
}
+ // TRANS: Title for people tag form when on a profile page.
+ // TRANS: %s is a profile nickname.
return sprintf(_('Tag %s'), $this->profile->nickname);
}
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
- $this->element('title', null, _('Error'));
+ // TRANS: Title for people tag form when an error has occurred.
+ $this->element('title', null, _m('TITLE','Error'));
$this->elementEnd('head');
$this->elementStart('body');
$this->element('p', 'error', $error);
{
if (Event::handle('StartShowTagProfileForm', array($this, $this->profile)) && $this->profile) {
$this->elementStart('div', 'entity_profile vcard author');
+ // TRANS: Header in people tag form.
$this->element('h2', null, _('User profile'));
$avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
'action' => common_local_url('tagprofile', array('id' => $this->profile->id))));
$this->elementStart('fieldset');
+ // TRANS: Fieldset legend for people tag form.
$this->element('legend', null, _('Tag user'));
$this->hidden('token', common_session_token());
$this->hidden('id', $this->profile->id);
$this->elementStart('li');
$tags = Profile_tag::getTagsArray($user->id, $this->profile->id, $user->id);
- $this->input('tags', _('Tags'),
+ // TRANS: Field label on people tag form.
+ $this->input('tags', _m('LABEL','Tags'),
($this->arg('tags')) ? $this->arg('tags') : implode(' ', $tags),
- _('Tags for this user (letters, numbers, -, ., and _), comma- or space- separated'));
+ // TRANS: Field title on people tag form.
+ _('Tags for this user (letters, numbers, -, ., and _), comma- or space- separated.'));
$this->elementEnd('li');
$this->elementEnd('ul');
- $this->submit('save', _('Save'));
+ // TRANS: Button text to save people tags.
+ $this->submit('save', _m('BUTTON','Save'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
if (Event::handle('StartSavePeopletags', array($this, $tagstring))) {
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;
$tag = common_canonical_tag($tag);
if (!common_valid_profile_tag($tag)) {
- $this->showForm(sprintf(_('Invalid tag: "%s"'), $tag));
+ // TRANS: Form validation error displayed if a given tag is invalid.
+ // TRANS: %s is the invalid tag.
+ $this->showForm(sprintf(_('Invalid tag: "%s".'), $tag));
return;
}
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
- $this->element('title', null, _('Tags'));
+ $this->element('title', null, _m('TITLE','Tags'));
$this->elementEnd('head');
$this->elementStart('body');
$this->elementEnd('body');
$this->elementEnd('html');
} else {
- $this->error = 'Tags saved.';
+ // TRANS: Success message if people tags are saved.
+ $this->error = _('Tags saved.');
$this->showForm();
}
} else {
$this->elementStart('div', 'instructions');
$this->element('p', null,
+ // TRANS: Page notice.
_('Use this form to add tags to your subscribers or subscriptions.'));
$this->elementEnd('div');
}
}
}
-
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class UnsubscribepeopletagAction extends Action
{
var $peopletag = null;
parent::prepare($args);
if (!common_logged_in()) {
- $this->clientError(_('You must be logged in to unsubscribe to a peopletag.'));
+ // TRANS: Client error displayed when trying to perform an action while not logged in.
+ $this->clientError(_('You must be logged in to unsubscribe to a people tag.'));
return false;
}
// Only allow POST requests
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ // TRANS: Client error displayed when trying to use another method than POST.
$this->clientError(_('This action only accepts POST requests.'));
return false;
}
$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;
if ($id) {
$this->peopletag = Profile_list::staticGet('id', $id);
} else {
+ // TRANS: Client error displayed when trying to perform an action without providing an ID.
$this->clientError(_('No ID given.'), 404);
return false;
}
if (!$this->peopletag || $this->peopletag->private) {
- $this->clientError(_('No such peopletag.'), 404);
+ // TRANS: Client error displayed trying to reference a non-existing people tag.
+ $this->clientError(_('No such people tag.'), 404);
return false;
}
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
- $this->element('title', null, sprintf(_('%1$s unsubscribed to peopletag %2$s by %3$s'),
+ // TRANS: Page title for form that allows unsubscribing from a people tag.
+ // TRANS: %1$s is a nickname, %2$s is a people tag, %3$s is a tagger nickname.
+ $this->element('title', null, sprintf(_('%1$s unsubscribed to people tag %2$s by %3$s'),
$cur->nickname,
$this->peopletag->tag,
$this->tagger->nickname));
if (!$id) {
// TRANS: Server exception. %s are the error details.
- throw new ServerException(sprintf(_('Database error inserting hashtag: %s'),
+ throw new ServerException(sprintf(_('Database error inserting hashtag: %s.'),
$last_error->message));
return;
}
$result = $ptagi->insert();
if (!$result) {
common_log_db_error($ptagi, 'INSERT', __FILE__);
+ // TRANS: Server exception thrown when saving profile_tag inbox fails.
throw new ServerException(_('Problem saving profile_tag inbox.'));
}
/**
* Check that the given profile is allowed to read, respond to, or otherwise
* act on this notice.
- *
+ *
* The $scope member is a bitmask of scopes, representing a logical AND of the
* scope requirement. So, 0x03 (Notice::ADDRESSEE_SCOPE | Notice::SITE_SCOPE) means
* "only visible to people who are mentioned in the notice AND are users on this site."
function getGroups($offset=0, $limit=PROFILES_PER_PAGE)
{
$ids = array();
-
+
$keypart = sprintf('profile:groups:%d', $this->id);
$idstring = self::cacheGet($keypart);
if($orig->tag != $this->tag || $orig->tagger != $this->tagger) {
$existing = Profile_list::getByTaggerAndTag($this->tagger, $this->tag);
if(!empty($existing)) {
+ // TRANS: Server exception.
throw new ServerException(_('The tag you are trying to rename ' .
'to already exists.'));
}
* @return mixed Profile_list on success, false on fail
*/
static function saveNew($fields) {
-
extract($fields);
$ptag = new Profile_list();
$ptag->query('BEGIN');
if (empty($tagger)) {
+ // TRANS: Server exception saving new tag without having a tagger specified.
throw new Exception(_('No tagger specified.'));
}
if (empty($tag)) {
+ // TRANS: Server exception saving new tag without having a tag specified.
throw new Exception(_('No tag specified.'));
}
if (!$result) {
common_log_db_error($ptag, 'INSERT', __FILE__);
+ // TRANS: Server exception saving new tag.
throw new ServerException(_('Could not create profile tag.'));
}
$result = $ptag->update($orig);
if (!$result) {
common_log_db_error($ptag, 'UPDATE', __FILE__);
+ // TRANS: Server exception saving new tag.
throw new ServerException(_('Could not set profile tag URI.'));
}
}
$result = $ptag->update($orig);
if (!$result) {
common_log_db_error($ptag, 'UPDATE', __FILE__);
+ // TRANS: Server exception saving new tag.
throw new ServerException(_('Could not set profile tag mainpage.'));
}
}
if (Event::handle('StartTagProfile', array($tagger_profile, $tagged_profile, $tag))) {
if (!$tagger_profile->canTag($tagged_profile)) {
+ // TRANS: Client exception thrown trying to set a tag for a user that cannot be tagged.
throw new ClientException(_('You cannot tag this user.'));
return false;
}
$count = (int) $tags->count('distinct tag');
if ($count >= common_config('peopletag', 'maxtags')) {
+ // TRANS: Client exception thrown trying to set more tags than allowed.
throw new ClientException(sprintf(_('You already have created %d or more tags ' .
'which is the maximum allowed number of tags. ' .
'Try using or deleting some existing tags.'),
$profile_list = Profile_list::ensureTag($tagger, $tag, $desc, $private);
if ($profile_list->taggedCount() >= common_config('peopletag', 'maxpeople')) {
- throw new ClientException(sprintf(_('You already have %d or more people tagged %s ' .
+ // TRANS: Client exception thrown trying to set one tag for more people than allowed.
+ throw new ClientException(sprintf(_('You already have %1$d or more people tagged %2$s, ' .
'which is the maximum allowed number.' .
'Try untagging others with the same tag first.'),
common_config('peopletag', 'maxpeople'), $tag));
if (!$result) {
common_log_db_error($sub, 'INSERT', __FILE__);
- throw new Exception(_("Adding people tag subscription failed."));
+ // TRANS: Exception thrown when inserting a people tag subscription in the database fails.
+ throw new Exception(_('Adding people tag subscription failed.'));
}
$ptag = Profile_list::staticGet('id', $peopletag->id);
if (!$result) {
common_log_db_error($sub, 'DELETE', __FILE__);
- throw new Exception(_("Removing people tag subscription failed."));
+ // TRANS: Exception thrown when deleting a people tag subscription from the database fails.
+ throw new Exception(_('Removing people tag subscription failed.'));
}
$peopletag->subscriberCount(true);
function repeatedToMe($offset=0, $limit=20, $since_id=null, $max_id=null)
{
- throw new Exception("Not implemented since inbox change.");
+ // TRANS: Exception thrown when trying view "repeated to me".
+ throw new Exception(_('Not implemented since inbox change.'));
}
function shareLocation()
$this->script('util.js');
$this->script('xbImportNode.js');
$this->script('geometa.js');
-
}
$this->inlineScript('var _peopletagAC = "' .
common_local_url('peopletagautocomplete') . '";');
* events and appending to the array. Try to avoid adding strings that won't be used, as
* they'll be added to HTML output.
*/
-
function showScriptMessages()
{
$messages = array();
*
* @return nothing
*/
-
function showProfileBlock()
{
if (common_logged_in()) {
$this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id'));
if (empty($this->list)) {
- $this->clientError(_('Not found'), 404, $this->format);
+ // TRANS: Client error displayed when referring to a non-existing list.
+ $this->clientError(_('List not found.'), 404, $this->format);
return false;
}
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->list)) {
return null;
}
-
}
$this->list = $list;
$this->tagger = Profile::staticGet('id', $list->tagger);
- // TRANS: Title in atom list notice feed. %s is a list name.
- $title = sprintf(_("Timeline for people tagged #%s by %s"), $list->tag, $this->tagger->nickname);
+ // TRANS: Title in atom list notice feed. %1$s is a list name, %2$s is a tagger's nickname.
+ $title = sprintf(_('Timeline for people tagged #%1$s by %2$s'), $list->tag, $this->tagger->nickname);
$this->setTitle($title);
$sitename = common_config('site', 'name');
$subtitle = sprintf(
// TRANS: Message is used as a subtitle in atom list notice feed.
- // TRANS: %1$s is a list name, %2$s is a site name.
+ // TRANS: %1$s is a tagger's nickname, %2$s is a list name, %3$s is a site name.
_('Updates from %1$s\'s %2$s people tag on %3$s!'),
$this->tagger->nickname,
$list->tag,
{
return $this->list;
}
-
}
function handle($channel)
{
// TRANS: Error text shown when an unimplemented command is given.
- $channel->error($this->user, _("Sorry, this command is not yet implemented."));
+ $channel->error($this->user, _('Sorry, this command is not yet implemented.'));
}
}
if ($fave->fetch()) {
// TRANS: Error message text shown when a favorite could not be set because it has already been favorited.
- $channel->error($this->user, _('Could not create favorite: already favorited.'));
+ $channel->error($this->user, _('Could not create favorite: Already favorited.'));
return;
}
$cur = $this->user->getProfile();
if (!$profile) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing profile.
$channel->error($cur, _('No such profile.'));
return;
}
if (!$cur->canTag($profile)) {
+ // TRANS: Error displayed when trying to tag a user that cannot be tagged.
$channel->error($cur, _('You cannot tag this user.'));
return;
}
$tag = $clean_tags[] = common_canonical_tag($tag);
if (!common_valid_profile_tag($tag)) {
- $channel->error($cur, sprintf(_('Invalid tag: "%s"'), $tag));
+ // TRANS: Error displayed if a given tag is invalid.
+ // TRANS: %s is the invalid tag.
+ $channel->error($cur, sprintf(_('Invalid tag: "%s".'), $tag));
return;
}
$privs[$tag] = $private;
Profile_tag::setTag($cur->id, $profile->id, $tag, null, $privs[$tag]);
}
} catch (Exception $e) {
- $channel->error($cur, sprintf(_('Error tagging %s: %s'),
+ // TRANS: Error displayed if tagging a user fails.
+ // TRANS: %1$s is the tagged user, %2$s is the error message (no punctuation).
+ $channel->error($cur, sprintf(_('Error tagging %1$s: %2$s'),
$profile->nickname, $e->getMessage()));
return;
}
+ // TRANS: Succes message displayed if tagging a user succeeds.
+ // TRANS: %1$s is the tagged user's nickname, %2$s is a list of tags.
$channel->output($cur, sprintf(_('%1$s was tagged %2$s'),
$profile->nickname,
- implode(', ', $clean_tags)));
+ // TRANS: Separator for list of tags.
+ implode(_(', '), $clean_tags)));
}
}
-
class UntagCommand extends TagCommand
{
function handle($channel)
$cur = $this->user->getProfile();
if (!$profile) {
+ // TRANS: Client error displayed trying to perform an action related to a non-existing profile.
$channel->error($cur, _('No such profile.'));
return;
}
if (!$cur->canTag($profile)) {
+ // TRANS: Error displayed when trying to tag a user that cannot be tagged.
$channel->error($cur, _('You cannot tag this user.'));
return;
}
foreach ($tags as $tag) {
if (!common_valid_profile_tag($tag)) {
+ // TRANS: Error displayed if a given tag is invalid.
+ // TRANS: %s is the invalid tag.
$channel->error($cur, sprintf(_('Invalid tag: "%s"'), $tag));
return;
}
Profile_tag::unTag($cur->id, $profile->id, $tag);
}
} catch (Exception $e) {
- $channel->error($cur, sprintf(_('Error untagging %s: %s'),
+ // TRANS: Error displayed if untagging a user fails.
+ // TRANS: %1$s is the untagged user, %2$s is the error message (no punctuation).
+ $channel->error($cur, sprintf(_('Error untagging %1$s: %2$s'),
$profile->nickname, $e->getMessage()));
return;
}
+ // TRANS: Succes message displayed if untagging a user succeeds.
+ // TRANS: %1$s is the untagged user's nickname, %2$s is a list of tags.
$channel->output($cur, sprintf(_('The following tag(s) were removed from user %1$s: %2$s.'),
$profile->nickname,
- implode(', ', $tags)));
+ // TRANS: Separator for list of tags.
+ implode(_(', '), $tags)));
}
}
{
// TRANS: Header line of help text for commands.
$out = array(_m('COMMANDHELP', "Commands:"));
- $commands = array(// TRANS: Help message for IM/SMS command "on"
+ $commands = array(// TRANS: Help message for IM/SMS command "on".
"on" => _m('COMMANDHELP', "turn on notifications"),
- // TRANS: Help message for IM/SMS command "off"
+ // TRANS: Help message for IM/SMS command "off".
"off" => _m('COMMANDHELP', "turn off notifications"),
- // TRANS: Help message for IM/SMS command "help"
+ // TRANS: Help message for IM/SMS command "help".
"help" => _m('COMMANDHELP', "show this help"),
- // TRANS: Help message for IM/SMS command "follow <nickname>"
+ // TRANS: Help message for IM/SMS command "follow <nickname>".
"follow <nickname>" => _m('COMMANDHELP', "subscribe to user"),
- // TRANS: Help message for IM/SMS command "groups"
+ // TRANS: Help message for IM/SMS command "groups".
"groups" => _m('COMMANDHELP', "lists the groups you have joined"),
- // TRANS: Help message for IM/SMS command "tag"
+ // TRANS: Help message for IM/SMS command "tag".
"tag <nickname> <tags>" => _m('COMMANDHELP',"tag a user"),
- // TRANS: Help message for IM/SMS command "untag"
+ // TRANS: Help message for IM/SMS command "untag".
"untag <nickname> <tags>" => _m('COMMANDHELP',"untag a user"),
- // TRANS: Help message for IM/SMS command "subscriptions"
+ // TRANS: Help message for IM/SMS command "subscriptions".
"subscriptions" => _m('COMMANDHELP', "list the people you follow"),
- // TRANS: Help message for IM/SMS command "subscribers"
+ // TRANS: Help message for IM/SMS command "subscribers".
"subscribers" => _m('COMMANDHELP', "list the people that follow you"),
- // TRANS: Help message for IM/SMS command "leave <nickname>"
+ // TRANS: Help message for IM/SMS command "leave <nickname>".
"leave <nickname>" => _m('COMMANDHELP', "unsubscribe from user"),
- // TRANS: Help message for IM/SMS command "d <nickname> <text>"
+ // TRANS: Help message for IM/SMS command "d <nickname> <text>".
"d <nickname> <text>" => _m('COMMANDHELP', "direct message to user"),
- // TRANS: Help message for IM/SMS command "get <nickname>"
+ // TRANS: Help message for IM/SMS command "get <nickname>".
"get <nickname>" => _m('COMMANDHELP', "get last notice from user"),
- // TRANS: Help message for IM/SMS command "whois <nickname>"
+ // TRANS: Help message for IM/SMS command "whois <nickname>".
"whois <nickname>" => _m('COMMANDHELP', "get profile info on user"),
- // TRANS: Help message for IM/SMS command "lose <nickname>"
+ // TRANS: Help message for IM/SMS command "lose <nickname>".
"lose <nickname>" => _m('COMMANDHELP', "force user to stop following you"),
- // TRANS: Help message for IM/SMS command "fav <nickname>"
+ // TRANS: Help message for IM/SMS command "fav <nickname>".
"fav <nickname>" => _m('COMMANDHELP', "add user's last notice as a 'fave'"),
- // TRANS: Help message for IM/SMS command "fav #<notice_id>"
+ // TRANS: Help message for IM/SMS command "fav #<notice_id>".
"fav #<notice_id>" => _m('COMMANDHELP', "add notice with the given id as a 'fave'"),
- // TRANS: Help message for IM/SMS command "repeat #<notice_id>"
+ // TRANS: Help message for IM/SMS command "repeat #<notice_id>".
"repeat #<notice_id>" => _m('COMMANDHELP', "repeat a notice with a given id"),
- // TRANS: Help message for IM/SMS command "repeat <nickname>"
+ // TRANS: Help message for IM/SMS command "repeat <nickname>".
"repeat <nickname>" => _m('COMMANDHELP', "repeat the last notice from user"),
- // TRANS: Help message for IM/SMS command "reply #<notice_id>"
+ // TRANS: Help message for IM/SMS command "reply #<notice_id>".
"reply #<notice_id>" => _m('COMMANDHELP', "reply to notice with a given id"),
- // TRANS: Help message for IM/SMS command "reply <nickname>"
+ // TRANS: Help message for IM/SMS command "reply <nickname>".
"reply <nickname>" => _m('COMMANDHELP', "reply to the last notice from user"),
- // TRANS: Help message for IM/SMS command "join <group>"
+ // TRANS: Help message for IM/SMS command "join <group>".
"join <group>" => _m('COMMANDHELP', "join group"),
- // TRANS: Help message for IM/SMS command "login"
+ // TRANS: Help message for IM/SMS command "login".
"login" => _m('COMMANDHELP', "Get a link to login to the web interface"),
- // TRANS: Help message for IM/SMS command "drop <group>"
+ // TRANS: Help message for IM/SMS command "drop <group>".
"drop <group>" => _m('COMMANDHELP', "leave group"),
- // TRANS: Help message for IM/SMS command "stats"
+ // TRANS: Help message for IM/SMS command "stats".
"stats" => _m('COMMANDHELP', "get your stats"),
- // TRANS: Help message for IM/SMS command "stop"
+ // TRANS: Help message for IM/SMS command "stop".
"stop" => _m('COMMANDHELP', "same as 'off'"),
- // TRANS: Help message for IM/SMS command "quit"
+ // TRANS: Help message for IM/SMS command "quit".
"quit" => _m('COMMANDHELP', "same as 'off'"),
- // TRANS: Help message for IM/SMS command "sub <nickname>"
+ // TRANS: Help message for IM/SMS command "sub <nickname>".
"sub <nickname>" => _m('COMMANDHELP', "same as 'follow'"),
- // TRANS: Help message for IM/SMS command "unsub <nickname>"
+ // TRANS: Help message for IM/SMS command "unsub <nickname>".
"unsub <nickname>" => _m('COMMANDHELP', "same as 'leave'"),
- // TRANS: Help message for IM/SMS command "last <nickname>"
+ // TRANS: Help message for IM/SMS command "last <nickname>".
"last <nickname>" => _m('COMMANDHELP', "same as 'get'"),
- // TRANS: Help message for IM/SMS command "on <nickname>"
+ // TRANS: Help message for IM/SMS command "on <nickname>".
"on <nickname>" => _m('COMMANDHELP', "not yet implemented."),
- // TRANS: Help message for IM/SMS command "off <nickname>"
+ // TRANS: Help message for IM/SMS command "off <nickname>".
"off <nickname>" => _m('COMMANDHELP', "not yet implemented."),
- // TRANS: Help message for IM/SMS command "nudge <nickname>"
+ // TRANS: Help message for IM/SMS command "nudge <nickname>".
"nudge <nickname>" => _m('COMMANDHELP', "remind a user to update."),
- // TRANS: Help message for IM/SMS command "invite <phone number>"
+ // TRANS: Help message for IM/SMS command "invite <phone number>".
"invite <phone number>" => _m('COMMANDHELP', "not yet implemented."),
- // TRANS: Help message for IM/SMS command "track <word>"
+ // TRANS: Help message for IM/SMS command "track <word>".
"track <word>" => _m('COMMANDHELP', "not yet implemented."),
- // TRANS: Help message for IM/SMS command "untrack <word>"
+ // TRANS: Help message for IM/SMS command "untrack <word>".
"untrack <word>" => _m('COMMANDHELP', "not yet implemented."),
- // TRANS: Help message for IM/SMS command "track off"
+ // TRANS: Help message for IM/SMS command "track off".
"track off" => _m('COMMANDHELP', "not yet implemented."),
- // TRANS: Help message for IM/SMS command "untrack all"
+ // TRANS: Help message for IM/SMS command "untrack all".
"untrack all" => _m('COMMANDHELP', "not yet implemented."),
- // TRANS: Help message for IM/SMS command "tracks"
+ // TRANS: Help message for IM/SMS command "tracks".
"tracks" => _m('COMMANDHELP', "not yet implemented."),
- // TRANS: Help message for IM/SMS command "tracking"
+ // TRANS: Help message for IM/SMS command "tracking".
"tracking" => _m('COMMANDHELP', "not yet implemented."));
// Give plugins a chance to add or override...
default:
$result = false;
}
-
+
Event::handle('EndInterpretCommand', array($cmd, $arg, $user, &$result));
}
'maxpeople' => 500, // maximum no. of people with the same tag by the same user
'allow_tagging' => array('all' => true), // equivalent to array('local' => true, 'remote' => true)
'desclimit' => null),
- 'oembed' =>
+ 'oembed' =>
array('endpoint' => 'http://oohembed.com/oohembed/',
'order' => array('built-in', 'well-known', 'service', 'discovery'),
),
*
* @see GroupEditForm
*/
-
class PeopletagEditForm extends Form
{
/**
* @param Action $out output channel
* @param User_group $group group to join
*/
-
function __construct($out=null, Profile_list $peopletag=null)
{
parent::__construct($out);
*
* @return string ID of the form
*/
-
function id()
{
return 'form_peopletag_edit-' . $this->peopletag->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_settings';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('editpeopletag',
*
* @return void
*/
-
function formLegend()
{
- $this->out->element('legend', null, sprintf(_('Edit peopletag %s'), $this->peopletag->tag));
+ // TRANS: Form legend for people tag edit form.
+ // TRANS: %s is a people tag.
+ $this->out->element('legend', null, sprintf(_('Edit people tag %s'), $this->peopletag->tag));
}
/**
*
* @return void
*/
-
function formData()
{
$id = $this->peopletag->id;
$this->out->elementStart('li');
$this->out->hidden('id', $id);
- $this->out->input('tag', _('Tag'),
+
+ // TRANS: Field label for people tag.
+ $this->out->input('tag', _m('LABEL','Tag'),
($this->out->arg('tag')) ? $this->out->arg('tag') : $tag,
- _('Change the tag (letters, numbers, -, ., and _ are allowed)'));
+ // TRANS: Field title for people tag.
+ _('Change the tag (letters, numbers, -, ., and _ are allowed).'));
$this->out->elementEnd('li');
$this->out->elementStart('li');
$desclimit = Profile_list::maxDescription();
if ($desclimit == 0) {
- $descinstr = _('Describe the people tag or topic');
+ // TRANS: Field title for description of people tag.
+ $descinstr = _('Describe the people tag or topic.');
} else {
- $descinstr = sprintf(_('Describe the people tag or topic in %d characters'), $desclimit);
+ // TRANS: Field title for description of people tag.
+ // TRANS: %d is the maximum number of characters for the description.
+ $descinstr = sprintf(_m('Describe the people tag or topic in %d character.',
+ 'Describe the people tag or topic in %d characters.',
+ $desclimit),
+ $desclimit);
}
+ // TRANS: Field label for description of people tag.
$this->out->textarea('description', _('Description'),
($this->out->arg('description')) ? $this->out->arg('description') : $description,
$descinstr);
+ // TRANS: Checkbox label to mark a people tag private.
$this->out->checkbox('private', _('Private'), $private);
$this->out->elementEnd('li');
$this->out->elementEnd('ul');
*
* @return void
*/
-
function formActions()
{
+ // TRANS: Button text to save a people tag.
$this->out->submit('submit', _('Save'));
$this->out->submit('form_action-yes',
+ // TRANS: Button text to delete a people tag.
_m('BUTTON','Delete'),
'submit',
'delete',
- _('Delete this people tag'));
+ // TRANS: Button title to delete a people tag.
+ _('Delete this people tag.'));
}
function showProfileList()
{
$tagged = $this->peopletag->getTagged();
- $this->out->element('h2', null, 'Add or remove people');
+ // TRANS: Header in people tag edit form.
+ $this->out->element('h2', null, _('Add or remove people'));
$this->out->elementStart('div', 'profile_search_wrap');
- $this->out->element('h3', null, _m('BUTTON', 'Search'));
+ // TRANS: Header in people tag edit form.
+ $this->out->element('h3', null, _m('HEADER','Search'));
$search = new SearchProfileForm($this->out, $this->peopletag);
$search->show();
$this->out->element('ul', array('id' => 'profile_search_results', 'class' => 'empty'));
*
* @see HTMLOutputter
*/
-
class PeopletagGroupNav extends Widget
{
var $action = null;
*
* @param Action $action current action, used for output
*/
-
function __construct($action=null)
{
parent::__construct($action);
*
* @return void
*/
-
function show()
{
$user = null;
// People tag timeline
$this->out->menuItem(common_local_url('showprofiletag', array('tagger' => $user_profile->nickname,
'tag' => $tag->tag)),
- _('People tag'),
- sprintf(_('%s tag by %s'), $tag->tag,
+ // TRANS: Menu item in people tag navigation panel.
+ _m('MENU','People tag'),
+ // TRANS: Menu item title in people tag navigation panel.
+ // TRANS: %1$s is a tag, %2$s is a nickname.
+ sprintf(_('%1$s tag by %2$s.'), $tag->tag,
(($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'showprofiletag', 'nav_timeline_peopletag');
// Tagged
$this->out->menuItem(common_local_url('peopletagged', array('tagger' => $user->nickname,
'tag' => $tag->tag)),
- _('Tagged'),
- sprintf(_('%s tag by %s'), $tag->tag,
+ // TRANS: Menu item in people tag navigation panel.
+ _m('MENU','Tagged'),
+ // TRANS: Menu item title in people tag navigation panel.
+ // TRANS: %1$s is a tag, %2$s is a nickname.
+ sprintf(_('%1$s tag by %2$s.'), $tag->tag,
(($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'peopletagged', 'nav_peopletag_tagged');
// Subscribers
$this->out->menuItem(common_local_url('peopletagsubscribers', array('tagger' => $user->nickname,
'tag' => $tag->tag)),
- _('Subscribers'),
- sprintf(_('Subscribers to %s tag by %s'), $tag->tag,
+ // TRANS: Menu item in people tag navigation panel.
+ _m('MENU','Subscribers'),
+ // TRANS: Menu item title in people tag navigation panel.
+ // TRANS: %1$s is a tag, %2$s is a nickname.
+ sprintf(_('Subscribers to %1$s tag by %2$s.'), $tag->tag,
(($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'peopletagsubscribers', 'nav_peopletag_subscribers');
// Edit
$this->out->menuItem(common_local_url('editpeopletag', array('tagger' => $user->nickname,
'tag' => $tag->tag)),
- _('Edit'),
- sprintf(_('Edit %s tag by you'), $tag->tag,
+ // TRANS: Menu item in people tag navigation panel.
+ _m('MENU','Edit'),
+ // TRANS: Menu item title in people tag navigation panel.
+ // TRANS: %s is a tag.
+ sprintf(_('Edit %s tag by you.'), $tag->tag,
(($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'editpeopletag', 'nav_peopletag_edit');
}
<?php
-
/**
* StatusNet, the distributed open-source microblogging tool
*
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class PeopletagList extends Widget
{
/** Current peopletag, peopletag query. */
*
* @param Notice $notice The notice we'll display
*/
-
function __construct($peopletag, $current, $out=null)
{
parent::__construct($out);
*
* @return void
*/
-
function url()
{
return $this->peopletag->homeUrl();
array('href' => common_local_url('peopletagged',
array('tagger' => $this->profile->nickname,
'tag' => $this->peopletag->tag))),
+ // TRANS: Link description for link to list of users tagged with a tag.
_('Tagged'));
$this->out->raw($this->peopletag->taggedCount());
$this->out->elementEnd('span');
array('href' => common_local_url('peopletagsubscribers',
array('tagger' => $this->profile->nickname,
'tag' => $this->peopletag->tag))),
+ // TRANS: Link description for link to list of users subscribed to a tag.
_('Subscribers'));
$this->out->raw($this->peopletag->subscriberCount());
$this->out->elementEnd('span');
$this->out->element('a', array('href' =>
common_local_url('editpeopletag', array('tagger' => $this->profile->nickname,
'tag' => $this->peopletag->tag)),
- 'title' => _('Edit peopletag settings')),
+ // TRANS: Title for link to edit people tag settings.
+ 'title' => _('Edit people tag settings.')),
+ // TRANS: Text for link to edit people tag settings.
_('Edit'));
$this->out->elementEnd('li');
}
$this->out->elementStart('a',
array('href' => common_local_url('peopletagsbyuser',
array('nickname' => $this->profile->nickname, 'private' => 1))));
- $this->out->element('span', 'privacy_mode', _('Private'));
+ // TRANS: Privacy mode text in people tag list item for private tags.
+ $this->out->element('span', 'privacy_mode', _m('MODE','Private'));
$this->out->elementEnd('a');
}
}
* Copyright (C) 2011, StatusNet, Inc.
*
* Stream of notices for a people tag
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* @author Shashi Gowda <connect2shashi@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
*/
-
class PeopletagsWidget extends Widget
{
/*
function label()
{
- return _('Tags by you');
+ // TRANS: Label in people tags widget.
+ return _m('LABEL','Tags by you');
}
function showTags()
'action' => common_local_url('tagprofile', array('id' => $this->tagged->id))));
$this->out->elementStart('fieldset');
- $this->out->element('legend', null, _('Edit tags'));
+ // TRANS: Fieldset legend in people tags widget.
+ $this->out->element('legend', null, _m('LEGEND','Edit tags'));
$this->out->hidden('token', common_session_token());
$this->out->hidden('id', $this->tagged->id);
$this->out->input('tags', $this->label(),
($this->out->arg('tags')) ? $this->out->arg('tags') : implode(' ', $tags));
- $this->out->submit('save', _('Save'));
+ // TRANS: Button text to save tags for a profile.
+ $this->out->submit('save', _m('BUTTON','Save'));
$this->out->elementEnd('fieldset');
$this->out->elementEnd('form');
}
$this->out->elementStart('ul', $class);
+ // TRANS: Empty list message for tags.
$this->out->element('li', null, _('(None)'));
$this->out->elementEnd('ul');
function label()
{
- return _('Tags');
+ // TRANS: Label in self tags widget.
+ return _m('LABEL','Tags');
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class PeopletagsBySubsSection extends PeopletagSection
{
function getPeopletags()
function title()
{
+ // TRANS: Title for section contaning people tags with the most subscribers.
return _('People tags with most subscribers');
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class PeopletagSection extends Section
{
function showContent()
function showTag()
{
- $title = _('Tagged: ') . $this->peopletag->taggedCount() .
- ' ' . _('Subscribers: ') . $this->peopletag->subscriberCount();
+ // TRANS: Tag summary. %1$d is the number of users tagged with the tag,
+ // TRANS: %2$d is the number of subscribers to the tag.
+ $title = sprintf(_('Tagged: %1$d Subscribers: %2$d'),
+ $this->peopletag->taggedCount(),
+ $this->peopletag->subscriberCount());
$this->out->elementStart('span', 'entry-title tag');
$this->out->element('a',
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class PeopletagsForUserSection extends PeopletagSection
{
var $profile=null;
if ($this->profile->id == common_current_user()->id) {
$name = 'you';
}
+ // TRANS: Title for page that displays which people tags a user has been tagged with.
+ // TRANS: %s is a profile name.
return sprintf(_('People tags for %s'), $name);
}
-
function link()
{
return common_local_url('peopletagsforuser',
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class PeopletagSubscriptionsSection extends PeopletagSection
{
var $profile=null;
function title()
{
+ // TRANS: Title for page that displays people tags a user has subscribed to.
return _('People tag subscriptions');
}
$mine && $action =='showfavorites', 'nav_timeline_favorites');
$this->out->menuItem(common_local_url('peopletagsbyuser', array('nickname' =>
$nickname)),
- _('People tags'),
- sprintf(_('People tags by %s'), ($user_profile) ? $name : _('User')),
+ // TRANS: Menu item in personal group navigation menu.
+ _m('MENU','People tags'),
+ // @todo i18n FIXME: Need to make this two messages.
+ // TRANS: Menu item title in personal group navigation menu.
+ // TRANS: %s is a username.
+ sprintf(_('People tags by %s'),
+ // TRANS: Replaces %s in 'People tags by %s'. (Yes, we know we need to fix this.)
+ ($user_profile) ? $name : _('User')),
in_array($action, array('peopletagsbyuser', 'peopletagsforuser')),
'nav_timeline_peopletags');
* Copyright (C) 2011, StatusNet, Inc.
*
* Superclass for profile blocks
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
<?php
-
/**
* StatusNet, the distributed open-source microblogging tool
*
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ProfileList extends Widget
{
/** Current profile, profile query. */
// TRANS: Menu item title in search group navigation panel.
_('Recent tags'), $action_name == 'publictagcloud', 'nav_recent-tags');
- $this->out->menuItem(common_local_url('publicpeopletagcloud'), _('People tags'),
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('publicpeopletagcloud'), _m('MENU','People tags'),
+ // TRANS: Menu item title in search group navigation panel.
_('People tags'), in_array($action_name, array('publicpeopletagcloud',
'peopletag', 'selftag')), 'nav_people-tags');
$this->out->menuItem(common_local_url('peopletagsbyuser',
array('nickname' =>
$this->user->nickname)),
- _('People tags'),
- sprintf(_('People tags by %s'),
+ // TRANS: Menu item title in local navigation menu.
+ _m('MENU','People tags'),
+ // TRANS: Menu item title in local navigation menu.
+ // TRANS: %s is a user nickname.
+ sprintf(_('People tags by %s.'),
$this->user->nickname),
in_array($action, array('peopletagsbyuser', 'peopletagsforuser')),
'nav_timeline_peopletags');
*
* @see UnsubscribeForm
*/
-
class SubscribePeopletagForm extends Form
{
/**
* peopletag for the user to join
*/
-
var $peopletag = null;
/**
* @param HTMLOutputter $out output channel
* @param peopletag $peopletag peopletag to subscribe to
*/
-
function __construct($out=null, $peopletag=null)
{
parent::__construct($out);
*
* @return string ID of the form
*/
-
function id()
{
return 'peopletag-subscribe-' . $this->peopletag->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_peopletag_subscribe';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('subscribepeopletag',
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Subscribe'));
+ // TRANS: Button text for subscribing to a people tag.
+ $this->out->submit('submit', m('BUTTON','Subscribe'));
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class SubscriptionList extends ProfileList
{
/** Owner of this list */
*
* @see GroupEditForm
*/
-
class SearchProfileForm extends Form
{
var $peopletag;
*
* @return string ID of the form
*/
-
function id()
{
return 'form_peopletag-add-' . $this->peopletag->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_peopletag_edit_user_search';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('profilecompletion');
*
* @return void
*/
-
function formLegend()
{
+ // TRANS: Form legend.
$this->out->element('legend', null, sprintf(_('Search and list people')));
}
*
* @return void
*/
-
function formData()
{
- $fields = array('fulltext' => 'Everything',
- 'nickname' => 'Nickname',
- 'fullname' => 'Fullname',
- 'description' => 'Description',
- 'location' => 'Location',
- 'uri' => 'Uri (Remote users)');
-
+ // TRANS: Dropdown option for searching in profiles.
+ $fields = array('fulltext' => _('Everything'),
+ // TRANS: Dropdown option for searching in profiles.
+ 'nickname' => _('Nickname'),
+ // TRANS: Dropdown option for searching in profiles.
+ 'fullname' => _('Fullname'),
+ // TRANS: Dropdown option for searching in profiles.
+ 'description' => _('Description'),
+ // TRANS: Dropdown option for searching in profiles.
+ 'location' => _('Location'),
+ // TRANS: Dropdown option for searching in profiles.
+ 'uri' => _('URI (Remote users)'));
+
$this->out->hidden('peopletag_id', $this->peopletag->id);
$this->out->input('q', null);
- $this->out->dropdown('field', _('Search in'), $fields,
- _('Choose a field to search'), false, 'fulltext');
+ // TRANS: Dropdown field label.
+ $this->out->dropdown('field', _m('LABEL','Search in'), $fields,
+ // TRANS: Dropdown field title.
+ _('Choose a field to search.'), false, 'fulltext');
}
/**
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Search'));
+ // TRANS: Button text to search profiles.
+ $this->out->submit('submit', _m('BUTTON','Search'));
}
}
*
* @return string ID of the form
*/
-
function id()
{
return 'form_peopletag-' . $this->peopletag->id . '-remove-' . $this->profile->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_user_remove_peopletag';
*
* @return void
*/
-
function formLegend()
{
- $this->out->element('legend', null, sprintf(_('Untag %s as %s'),
+ // TRANS: Form legend.
+ // TRANS: %1$s is a nickname, $2$s is a people tag.
+ $this->out->element('legend', null, sprintf(_('Untag %1$s as %2$s'),
$this->profile->nickname, $this->peopletag->tag));
}
*
* @return void
*/
-
function formData()
{
$this->out->hidden('peopletag_id', $this->peopletag->id);
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Remove'));
+ // TRANS: Button text to untag a profile.
+ $this->out->submit('submit', _m('BUTTON','Remove'));
}
}
-
class TagButton extends Form
{
var $profile;
*
* @return string ID of the form
*/
-
function id()
{
return 'form_peopletag-' . $this->peopletag->id . '-add-' . $this->profile->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_user_add_peopletag';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('addpeopletag');
*
* @return void
*/
-
function formLegend()
{
- $this->out->element('legend', null, sprintf(_('Tag %s as %s'),
+ // TRANS: Legend on form to add a tag to a profile.
+ // TRANS: %1$s is a nickname, %2$s ia a people tag.
+ $this->out->element('legend', null, sprintf(_('Tag %1$s as %2$s'),
$this->profile->nickname, $this->peopletag->tag));
}
*
* @return void
*/
-
function formData()
{
UntagButton::formData();
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Add'));
+ // TRANS: Button text to tag a profile.
+ $this->out->submit('submit', _m('BUTTON','Add'));
}
}
*
* @see UnunsubscribeForm
*/
-
class UnsubscribePeopletagForm extends Form
{
/**
* peopletag for the user to join
*/
-
var $peopletag = null;
/**
* @param HTMLOutputter $out output channel
* @param peopletag $peopletag peopletag to unsubscribe to
*/
-
function __construct($out=null, $peopletag=null)
{
parent::__construct($out);
*
* @return string ID of the form
*/
-
function id()
{
return 'peopletag-unsubscribe-' . $this->peopletag->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_peopletag_unsubscribe';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('unsubscribepeopletag',
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Unsubscribe'));
+ // TRANS: Button text for unsubscribing from a people tag.
+ $this->out->submit('submit', _m('BUTTON','Unsubscribe'));
}
}