Update/add translator documentation.

L10n/i18n updates.
Superfluous whitespace removed.
Add FIXME for a few i18n issues I couldn't solve this quickly.

Takes care of documentation for all core code added in merge of "people tags" feature (Commit:e75c9988ebe33822e493ac225859bc593ff9b855).
This commit is contained in:
Siebrand Mazeland 2011-04-10 19:59:55 +02:00
parent cad040ce4e
commit f0d762f196
58 changed files with 545 additions and 334 deletions

View File

@ -34,9 +34,9 @@ if (!defined('STATUSNET')) {
require_once INSTALLDIR . '/lib/togglepeopletag.php'; require_once INSTALLDIR . '/lib/togglepeopletag.php';
/** /**
* *
* Action to tag a profile with a single tag. * Action to tag a profile with a single tag.
* *
* Takes parameters: * Takes parameters:
* *
* - tagged: the ID of the profile being tagged * - tagged: the ID of the profile being tagged
@ -52,7 +52,6 @@ require_once INSTALLDIR . '/lib/togglepeopletag.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class AddpeopletagAction extends Action class AddpeopletagAction extends Action
{ {
var $user; var $user;
@ -66,7 +65,6 @@ class AddpeopletagAction extends Action
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -76,6 +74,7 @@ class AddpeopletagAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_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.'. $this->clientError(_('There was a problem with your session token.'.
' Try again, please.')); ' Try again, please.'));
return false; return false;
@ -86,6 +85,7 @@ class AddpeopletagAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->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.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
@ -97,6 +97,7 @@ class AddpeopletagAction extends Action
$this->tagged = Profile::staticGet('id', $tagged_id); $this->tagged = Profile::staticGet('id', $tagged_id);
if (empty($this->tagged)) { if (empty($this->tagged)) {
// TRANS: Client error displayed trying to perform an action related to a non-existing profile.
$this->clientError(_('No such profile.')); $this->clientError(_('No such profile.'));
return false; return false;
} }
@ -105,7 +106,8 @@ class AddpeopletagAction extends Action
$this->peopletag = Profile_list::staticGet('id', $id); $this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) { 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; return false;
} }
@ -115,6 +117,7 @@ class AddpeopletagAction extends Action
$omb01 = Remote_profile::staticGet('id', $tagged_id); $omb01 = Remote_profile::staticGet('id', $tagged_id);
if (!empty($omb01)) { 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'. $this->clientError(_('You cannot tag an OMB 0.1'.
' remote profile with this action.')); ' remote profile with this action.'));
return false; return false;
@ -132,10 +135,8 @@ class AddpeopletagAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
// Throws exception on error // Throws exception on error
$ptag = Profile_tag::setTag($this->user->id, $this->tagged->id, $ptag = Profile_tag::setTag($this->user->id, $this->tagged->id,
$this->peopletag->tag); $this->peopletag->tag);
@ -144,9 +145,13 @@ class AddpeopletagAction extends Action
$user = User::staticGet('id', $id); $user = User::staticGet('id', $id);
if ($user) { if ($user) {
$this->clientError( $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)); $user->nickname));
} else { } 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.' . $this->clientError(sprintf(_('There was a problem tagging %s.' .
'The remote server is probably not responding correctly, ' . 'The remote server is probably not responding correctly, ' .
'please try retrying later.'), $this->profile->profileurl)); 'please try retrying later.'), $this->profile->profileurl));
@ -156,6 +161,7 @@ class AddpeopletagAction extends Action
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $this->elementStart('head');
// TRANS: Title after subscribing to a people tag.
$this->element('title', null, _('Subscribed')); $this->element('title', null, _('Subscribed'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');

View File

@ -37,19 +37,16 @@ class ApiListAction extends ApiBareAuthAction
/** /**
* The list in question in the current request * The list in question in the current request
*/ */
var $list = null; var $list = null;
/** /**
* Is this an update request? * Is this an update request?
*/ */
var $update = false; var $update = false;
/** /**
* Is this a delete request? * Is this a delete request?
*/ */
var $delete = false; var $delete = false;
/** /**
@ -64,7 +61,6 @@ class ApiListAction extends ApiBareAuthAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -81,7 +77,8 @@ class ApiListAction extends ApiBareAuthAction
$this->list = $this->getTargetList($this->arg('user'), $this->arg('id')); $this->list = $this->getTargetList($this->arg('user'), $this->arg('id'));
if (empty($this->list)) { 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 false;
} }
@ -93,7 +90,6 @@ class ApiListAction extends ApiBareAuthAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -117,6 +113,7 @@ class ApiListAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -129,7 +126,6 @@ class ApiListAction extends ApiBareAuthAction
* require authentication if it is a write action or user is ambiguous * require authentication if it is a write action or user is ambiguous
* *
*/ */
function requiresAuth() function requiresAuth()
{ {
return parent::requiresAuth() || return parent::requiresAuth() ||
@ -141,12 +137,12 @@ class ApiListAction extends ApiBareAuthAction
* *
* @return boolean success * @return boolean success
*/ */
function handlePut() function handlePut()
{ {
if($this->auth_user->id != $this->list->tagger) { if($this->auth_user->id != $this->list->tagger) {
$this->clientError( $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, 401,
$this->format $this->format
); );
@ -161,6 +157,7 @@ class ApiListAction extends ApiBareAuthAction
if(!$result) { if(!$result) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when an unknown error occurs updating a list.
_('An error occured.'), _('An error occured.'),
503, 503,
$this->format $this->format
@ -176,6 +173,7 @@ class ApiListAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -189,12 +187,12 @@ class ApiListAction extends ApiBareAuthAction
* *
* @return boolean success * @return boolean success
*/ */
function handleDelete() function handleDelete()
{ {
if($this->auth_user->id != $this->list->tagger) { if($this->auth_user->id != $this->list->tagger) {
$this->clientError( $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, 401,
$this->format $this->format
); );
@ -212,6 +210,7 @@ class ApiListAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -225,7 +224,6 @@ class ApiListAction extends ApiBareAuthAction
* *
* @return boolean is_read-only=false * @return boolean is_read-only=false
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return false; return false;
@ -236,7 +234,6 @@ class ApiListAction extends ApiBareAuthAction
* *
* @return String time_last_modified * @return String time_last_modified
*/ */
function lastModified() function lastModified()
{ {
if(!empty($this->list)) { if(!empty($this->list)) {
@ -253,7 +250,6 @@ class ApiListAction extends ApiBareAuthAction
* *
* @return string etag * @return string etag
*/ */
function etag() function etag()
{ {
if (!empty($this->list)) { if (!empty($this->list)) {
@ -271,5 +267,4 @@ class ApiListAction extends ApiBareAuthAction
return null; return null;
} }
} }

View File

@ -42,7 +42,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
* @link http://status.net/ * @link http://status.net/
* @see ApiBareAuthAction * @see ApiBareAuthAction
*/ */
class ApiListMemberAction extends ApiBareAuthAction class ApiListMemberAction extends ApiBareAuthAction
{ {
/** /**
@ -59,7 +58,6 @@ class ApiListMemberAction extends ApiBareAuthAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -68,12 +66,14 @@ class ApiListMemberAction extends ApiBareAuthAction
$this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id')); $this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id'));
if (empty($this->list)) { 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 false;
} }
if (empty($this->user)) { 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 false;
} }
return true; return true;
@ -84,7 +84,6 @@ class ApiListMemberAction extends ApiBareAuthAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -96,7 +95,8 @@ class ApiListMemberAction extends ApiBareAuthAction
if(empty($ptag)) { if(empty($ptag)) {
$this->clientError( $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, 400,
$this->format $this->format
); );
@ -113,6 +113,7 @@ class ApiListMemberAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -39,12 +39,12 @@ class ApiListMembersAction extends ApiListUsersAction
* *
* @return boolean success * @return boolean success
*/ */
function handlePost() function handlePost()
{ {
if($this->auth_user->id != $this->list->tagger) { if($this->auth_user->id != $this->list->tagger) {
$this->clientError( $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, 401,
$this->format $this->format
); );
@ -53,7 +53,8 @@ class ApiListMembersAction extends ApiListUsersAction
if($this->user === false) { if($this->user === false) {
$this->clientError( $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, 400,
$this->format $this->format
); );
@ -65,6 +66,7 @@ class ApiListMembersAction extends ApiListUsersAction
if(empty($result)) { if(empty($result)) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when an unknown error occurs viewing list members.
_('An error occured.'), _('An error occured.'),
500, 500,
$this->format $this->format
@ -81,6 +83,7 @@ class ApiListMembersAction extends ApiListUsersAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -95,12 +98,12 @@ class ApiListMembersAction extends ApiListUsersAction
* *
* @return boolean success * @return boolean success
*/ */
function handleDelete() function handleDelete()
{ {
if($this->auth_user->id != $this->list->tagger) { if($this->auth_user->id != $this->list->tagger) {
$this->clientError( $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, 401,
$this->format $this->format
); );
@ -109,7 +112,8 @@ class ApiListMembersAction extends ApiListUsersAction
if($this->user === false) { if($this->user === false) {
$this->clientError( $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, 400,
$this->format $this->format
); );
@ -123,7 +127,8 @@ class ApiListMembersAction extends ApiListUsersAction
if(empty($ptag)) { if(empty($ptag)) {
$this->clientError( $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, 400,
$this->format $this->format
); );
@ -134,6 +139,7 @@ class ApiListMembersAction extends ApiListUsersAction
if(empty($result)) { if(empty($result)) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when an unknown error occurs viewing list members.
_('An error occured.'), _('An error occured.'),
500, 500,
$this->format $this->format
@ -150,6 +156,7 @@ class ApiListMembersAction extends ApiListUsersAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -163,7 +170,6 @@ class ApiListMembersAction extends ApiListUsersAction
/** /**
* List the members of a list (people tagged) * List the members of a list (people tagged)
*/ */
function getUsers() function getUsers()
{ {
$fn = array($this->list, 'getTagged'); $fn = array($this->list, 'getTagged');

View File

@ -43,7 +43,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
* @link http://status.net/ * @link http://status.net/
* @see ApiBareAuthAction * @see ApiBareAuthAction
*/ */
class ApiListMembershipsAction extends ApiBareAuthAction class ApiListMembershipsAction extends ApiBareAuthAction
{ {
var $lists = array(); var $lists = array();
@ -60,7 +59,6 @@ class ApiListMembershipsAction extends ApiBareAuthAction
* @return boolean success flag * @return boolean success flag
* *
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -69,6 +67,7 @@ class ApiListMembershipsAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('user')); $this->user = $this->getTargetUser($this->arg('user'));
if (empty($this->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); $this->clientError(_('No such user.'), 404, $this->format);
return; return;
} }
@ -87,7 +86,6 @@ class ApiListMembershipsAction extends ApiBareAuthAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -101,6 +99,7 @@ class ApiListMembershipsAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
400, 400,
$this->format $this->format
@ -118,7 +117,6 @@ class ApiListMembershipsAction extends ApiBareAuthAction
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;

View File

@ -42,7 +42,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
* @link http://status.net/ * @link http://status.net/
* @see ApiBareAuthAction * @see ApiBareAuthAction
*/ */
class ApiListsAction extends ApiBareAuthAction class ApiListsAction extends ApiBareAuthAction
{ {
var $lists = null; var $lists = null;
@ -64,7 +63,6 @@ class ApiListsAction extends ApiBareAuthAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -76,6 +74,7 @@ class ApiListsAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('user')); $this->user = $this->getTargetUser($this->arg('user'));
if (empty($this->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); $this->clientError(_('No such user.'), 404, $this->format);
return false; return false;
} }
@ -89,7 +88,6 @@ class ApiListsAction extends ApiBareAuthAction
* require authentication if it is a write action or user is ambiguous * require authentication if it is a write action or user is ambiguous
* *
*/ */
function requiresAuth() function requiresAuth()
{ {
return parent::requiresAuth() || return parent::requiresAuth() ||
@ -101,7 +99,6 @@ class ApiListsAction extends ApiBareAuthAction
* Show the lists the user has created if the request method is GET * 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. * Create a new list by diferring to handlePost() if it is POST.
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -119,6 +116,7 @@ class ApiListsAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -132,13 +130,13 @@ class ApiListsAction extends ApiBareAuthAction
* *
* @return boolean success * @return boolean success
*/ */
function handlePost() function handlePost()
{ {
$name=$this->arg('name'); $name=$this->arg('name');
if(empty($name)) { if(empty($name)) {
// mimick twitter // 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); exit(1);
} }
@ -170,6 +168,7 @@ class ApiListsAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -182,7 +181,6 @@ class ApiListsAction extends ApiBareAuthAction
/** /**
* Get lists * Get lists
*/ */
function getLists() function getLists()
{ {
$cursor = (int) $this->arg('cursor', -1); $cursor = (int) $this->arg('cursor', -1);
@ -220,7 +218,6 @@ class ApiListsAction extends ApiBareAuthAction
* *
* @return string etag * @return string etag
*/ */
function etag() function etag()
{ {
if (!$this->create && !empty($this->lists) && (count($this->lists) > 0)) { if (!$this->create && !empty($this->lists) && (count($this->lists) > 0)) {
@ -240,5 +237,4 @@ class ApiListsAction extends ApiBareAuthAction
return null; return null;
} }
} }

View File

@ -43,12 +43,14 @@ class ApiListSubscriberAction extends ApiBareAuthAction
$this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id')); $this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id'));
if (empty($this->list)) { 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; return false;
} }
if (empty($this->user)) { 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 false;
} }
return true; return true;
@ -64,7 +66,8 @@ class ApiListSubscriberAction extends ApiBareAuthAction
if(empty($sub)) { if(empty($sub)) {
$this->clientError( $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, 400,
$this->format $this->format
); );
@ -81,6 +84,7 @@ class ApiListSubscriberAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -38,7 +38,6 @@ class ApiListSubscribersAction extends ApiListUsersAction
* *
* @return boolean success * @return boolean success
*/ */
function handlePost() function handlePost()
{ {
$result = Profile_tag_subscription::add($this->list, $result = Profile_tag_subscription::add($this->list,
@ -46,6 +45,7 @@ class ApiListSubscribersAction extends ApiListUsersAction
if(empty($result)) { if(empty($result)) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when an unknown error occurs in the list subscribers action.
_('An error occured.'), _('An error occured.'),
500, 500,
$this->format $this->format
@ -62,6 +62,7 @@ class ApiListSubscribersAction extends ApiListUsersAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -79,7 +80,8 @@ class ApiListSubscribersAction extends ApiListUsersAction
if(empty($ptag)) { if(empty($ptag)) {
$this->clientError( $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, 400,
$this->format $this->format
); );
@ -90,6 +92,7 @@ class ApiListSubscribersAction extends ApiListUsersAction
if(empty($result)) { if(empty($result)) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when an unknown error occurs unsubscribing from a list.
_('An error occured.'), _('An error occured.'),
500, 500,
$this->format $this->format
@ -106,6 +109,7 @@ class ApiListSubscribersAction extends ApiListUsersAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format

View File

@ -48,7 +48,6 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
* @return boolean success flag * @return boolean success flag
* *
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -69,12 +68,12 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
if (empty($this->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); $this->clientError(_('No such user.'), 404, $this->format);
return; return;
} }
@ -88,6 +87,7 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
400, 400,
$this->format $this->format
@ -105,7 +105,6 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;

View File

@ -50,7 +50,6 @@ require_once INSTALLDIR . '/lib/atomlistnoticefeed.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ApiTimelineListAction extends ApiPrivateAuthAction class ApiTimelineListAction extends ApiPrivateAuthAction
{ {
@ -68,7 +67,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
* @return boolean success flag * @return boolean success flag
* *
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -88,12 +86,12 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
if (empty($this->list)) { 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); $this->clientError(_('List not found.'), 404, $this->format);
return false; return false;
} }
@ -107,7 +105,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
* *
* @return void * @return void
*/ */
function showTimeline() function showTimeline()
{ {
// We'll pull common formatting out of this for other formats // We'll pull common formatting out of this for other formats
@ -145,7 +142,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
); );
break; break;
case 'atom': case 'atom':
header('Content-Type: application/atom+xml; charset=utf-8'); header('Content-Type: application/atom+xml; charset=utf-8');
try { try {
@ -154,9 +150,9 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
$atom->addEntryFromNotices($this->notices); $atom->addEntryFromNotices($this->notices);
$this->raw($atom->getString()); $this->raw($atom->getString());
} catch (Atom10FeedException $e) { } catch (Atom10FeedException $e) {
$this->serverError( // TRANS: Server error displayed whe trying to get a timeline fails.
'Could not generate feed for list - ' . $e->getMessage() // TRANS: %s is the error message.
); $this->serverError( sprintf(_('Could not generate feed for list - %s'),$e->getMessage()));
return; return;
} }
@ -182,6 +178,7 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -195,7 +192,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
* *
* @return array notices * @return array notices
*/ */
function getNotices() function getNotices()
{ {
$fn = array($this->list, 'getNotices'); $fn = array($this->list, 'getNotices');
@ -213,7 +209,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
* *
* @return boolean true * @return boolean true
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;
@ -224,7 +219,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
* *
* @return string datestamp of the latest notice in the stream * @return string datestamp of the latest notice in the stream
*/ */
function lastModified() function lastModified()
{ {
if (!empty($this->notices) && (count($this->notices) > 0)) { if (!empty($this->notices) && (count($this->notices) > 0)) {
@ -242,7 +236,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
* *
* @return string etag * @return string etag
*/ */
function etag() function etag()
{ {
if (!empty($this->notices) && (count($this->notices) > 0)) { if (!empty($this->notices) && (count($this->notices) > 0)) {
@ -262,5 +255,4 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
return null; return null;
} }
} }

View File

@ -42,14 +42,17 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
class EditpeopletagAction extends OwnerDesignAction class EditpeopletagAction extends OwnerDesignAction
{ {
var $msg, $confirm, $confirm_args=array(); var $msg, $confirm, $confirm_args=array();
function title() function title()
{ {
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $this->boolean('delete')) { 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); 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); return sprintf(_('Edit people tag %s'), $this->peopletag->tag);
} }
@ -62,6 +65,7 @@ class EditpeopletagAction extends OwnerDesignAction
parent::prepare($args); parent::prepare($args);
if (!common_logged_in()) { 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.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
@ -91,6 +95,7 @@ class EditpeopletagAction extends OwnerDesignAction
} }
} else { } else {
if (!$tagger) { 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); $this->clientError(_('No tagger or ID.'), 404);
return false; return false;
} }
@ -100,17 +105,20 @@ class EditpeopletagAction extends OwnerDesignAction
} }
if (!$this->peopletag) { 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; return false;
} }
if (!$user) { if (!$user) {
// This should not be happening // This should not be happening
// TRANS: Client error displayed when referring to non-local user.
$this->clientError(_('Not a local user.'), 404); $this->clientError(_('Not a local user.'), 404);
return false; return false;
} }
if ($current->id != $user->id) { 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); $this->clientError(_('You must be the creator of the tag to edit it.'), 404);
return false; return false;
} }
@ -129,7 +137,6 @@ class EditpeopletagAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -208,6 +215,7 @@ class EditpeopletagAction extends OwnerDesignAction
$this->element('p', 'instructions', $this->confirm); $this->element('p', 'instructions', $this->confirm);
} else { } else {
$this->element('p', 'instructions', $this->element('p', 'instructions',
// TRANS: Form instruction for edit people tag form.
_('Use this form to edit the people tag.')); _('Use this form to edit the people tag.'));
} }
} }
@ -228,6 +236,7 @@ class EditpeopletagAction extends OwnerDesignAction
$cancel = $this->arg('cancel'); $cancel = $this->arg('cancel');
if ($delete && $cancel) { if ($delete && $cancel) {
// TRANS: Form validation error displayed if the form data for deleting a tag was incorrect.
$this->showForm(_('Delete aborted.')); $this->showForm(_('Delete aborted.'));
return; return;
} }
@ -235,24 +244,35 @@ class EditpeopletagAction extends OwnerDesignAction
$set_private = $private && $this->peopletag->private != $private; $set_private = $private && $this->peopletag->private != $private;
if ($delete && !$confirm) { if ($delete && !$confirm) {
// TRANS: Text in confirmation dialog for deleting a tag.
$this->showConfirm(_('Deleting this tag will permanantly remove ' . $this->showConfirm(_('Deleting this tag will permanantly remove ' .
'all its subscription and membership records. ' . 'all its subscription and membership records. ' .
'Do you still want to continue?'), array('delete' => 1)); 'Do you still want to continue?'), array('delete' => 1));
return; return;
} else if (common_valid_tag($tag)) { } else if (common_valid_tag($tag)) {
// TRANS: Form validation error displayed if a given tag is invalid.
$this->showForm(_('Invalid tag.')); $this->showForm(_('Invalid tag.'));
return; return;
} else if ($tag != $this->peopletag->tag && $this->tagExists($tag)) { } 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)); $this->showForm(sprintf(_('You already have a tag named %s.'), $tag));
return; return;
} else if (Profile_list::descriptionTooLong($description)) { } 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; return;
} else if ($set_private && !$confirm && !$cancel) { } else if ($set_private && !$confirm && !$cancel) {
$fwd = array('tag' => $tag, $fwd = array('tag' => $tag,
'description' => $description, 'description' => $description,
'private' => (int) $private); '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 ' . $this->showConfirm(_('Setting a public tag as private will ' .
'permanently remove all the existing ' . 'permanently remove all the existing ' .
'subscriptions to it. Do you still want to continue?'), $fwd); 'subscriptions to it. Do you still want to continue?'), $fwd);
@ -273,7 +293,8 @@ class EditpeopletagAction extends OwnerDesignAction
if (!$result) { if (!$result) {
common_log_db_error($this->group, 'UPDATE', __FILE__); 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'); $this->peopletag->query('COMMIT');
@ -297,6 +318,7 @@ class EditpeopletagAction extends OwnerDesignAction
'tag' => $tag)), 'tag' => $tag)),
303); 303);
} else { } else {
// TRANS: Edit people tag form success message.
$this->showForm(_('Options saved.')); $this->showForm(_('Options saved.'));
} }
} }

View File

@ -52,9 +52,13 @@ class PeopletagAction extends Action
function title() function title()
{ {
if ($this->page == 1) { 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 { } 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);
} }
} }
@ -96,6 +100,8 @@ class PeopletagAction extends Action
function showAnonymousMessage() function showAnonymousMessage()
{ {
$notice = $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 tags are how you sort similar ' .
'people on %%site.name%%, a [micro-blogging]' . 'people on %%site.name%%, a [micro-blogging]' .
'(http://en.wikipedia.org/wiki/Micro-blogging) service ' . '(http://en.wikipedia.org/wiki/Micro-blogging) service ' .
@ -140,7 +146,7 @@ class PeopletagAction extends Action
} else { } else {
$ptags->whereAdd('(profile_list.private = false OR (' . $ptags->whereAdd('(profile_list.private = false OR (' .
' profile_list.tagger =' . $user->id . ' profile_list.tagger =' . $user->id .
' AND profile_list.private = true) )'); ' AND profile_list.private = true) )');
$ptags->orderBy('profile_list.modified DESC'); $ptags->orderBy('profile_list.modified DESC');
$ptags->find(); $ptags->find();

View File

@ -44,7 +44,6 @@ class PeopletagautocompleteAction extends Action
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -54,6 +53,7 @@ class PeopletagautocompleteAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->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.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
@ -63,6 +63,7 @@ class PeopletagautocompleteAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_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.'. $this->clientError(_('There was a problem with your session token.'.
' Try again, please.')); ' Try again, please.'));
return false; return false;
@ -99,7 +100,6 @@ class PeopletagautocompleteAction extends Action
* *
* @return String time * @return String time
*/ */
function lastModified() function lastModified()
{ {
return strtotime($this->last_mod); return strtotime($this->last_mod);
@ -114,7 +114,6 @@ class PeopletagautocompleteAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
//common_log(LOG_DEBUG, 'Autocomplete data: ' . json_encode($this->tags)); //common_log(LOG_DEBUG, 'Autocomplete data: ' . json_encode($this->tags));

View File

@ -42,7 +42,6 @@ require_once(INSTALLDIR.'/lib/profilelist.php');
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class PeopletaggedAction extends OwnerDesignAction class PeopletaggedAction extends OwnerDesignAction
{ {
var $page = null; var $page = null;
@ -76,6 +75,7 @@ class PeopletaggedAction extends OwnerDesignAction
} }
if (!$tagger) { if (!$tagger) {
// TRANS: Client error displayed when a tagger is expected but not provided.
$this->clientError(_('No tagger.'), 404); $this->clientError(_('No tagger.'), 404);
return false; return false;
} }
@ -83,6 +83,7 @@ class PeopletaggedAction extends OwnerDesignAction
$user = User::staticGet('nickname', $tagger); $user = User::staticGet('nickname', $tagger);
if (!$user) { if (!$user) {
// TRANS: Client error displayed when referring to non-existing user.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }
@ -91,7 +92,8 @@ class PeopletaggedAction extends OwnerDesignAction
$this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag)); $this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag));
if (!$this->peopletag) { 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; return false;
} }
@ -101,10 +103,14 @@ class PeopletaggedAction extends OwnerDesignAction
function title() function title()
{ {
if ($this->page == 1) { 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); $this->peopletag->tag, $this->tagger->nickname);
} else { } 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->peopletag->tag, $this->user->nickname,
$this->page); $this->page);
} }
@ -182,6 +188,7 @@ class PeopletagMemberListItem extends ProfileListItem
parent::showFullName(); parent::showFullName();
if ($this->profile->id == $this->peopletag->tagger) { if ($this->profile->id == $this->peopletag->tagger) {
$this->out->text(' '); $this->out->text(' ');
// TRANS: Addition in tag membership list for creator of a tag.
$this->out->element('span', 'role', _('Creator')); $this->out->element('span', 'role', _('Creator'));
} }
} }
@ -206,7 +213,7 @@ class PeopletagMemberListItem extends ProfileListItem
/** /**
* Fetch necessary return-to arguments for the profile forms * Fetch necessary return-to arguments for the profile forms
* to return to this list when they're done. * to return to this list when they're done.
* *
* @return array * @return array
*/ */
protected function returnToArgs() protected function returnToArgs()

View File

@ -49,15 +49,22 @@ class PeopletagsbyuserAction extends OwnerDesignAction
if ($this->page == 1) { if ($this->page == 1) {
if ($this->isOwner()) { if ($this->isOwner()) {
if ($this->arg('private')) { if ($this->arg('private')) {
// TRANS: Title for people tags by a user page for a private tag.
return _('Private people tags by you'); return _('Private people tags by you');
} else if ($this->arg('public')) { } else if ($this->arg('public')) {
// TRANS: Title for people tags by a user page for a public tag.
return _('Public people tags by you'); return _('Public people tags by you');
} }
// TRANS: Title for people tags by a user page.
return _('People tags by you'); 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 { } 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);
} }
} }
@ -86,6 +93,7 @@ class PeopletagsbyuserAction extends OwnerDesignAction
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }
@ -93,6 +101,7 @@ class PeopletagsbyuserAction extends OwnerDesignAction
$this->tagger = $this->user->getProfile(); $this->tagger = $this->user->getProfile();
if (!$this->tagger) { if (!$this->tagger) {
// TRANS: Server error displayed when a user has no profile.
$this->serverError(_('User has no profile.')); $this->serverError(_('User has no profile.'));
return false; return false;
} }
@ -108,12 +117,14 @@ class PeopletagsbyuserAction extends OwnerDesignAction
$this->tags = $this->tagger->getOwnedTags(false, $offset, $limit); $this->tags = $this->tagger->getOwnedTags(false, $offset, $limit);
} else if ($this->arg('private')) { } else if ($this->arg('private')) {
if (empty($user)) { 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()) { if ($this->isOwner()) {
$this->tags = $this->tagger->getPrivateTags($offset, $limit); $this->tags = $this->tagger->getPrivateTags($offset, $limit);
} else { } else {
// TRANS: Client error displayed when trying view another user's private people tags.
$this->clientError(_('You cannot view others\' private people tags'), 403); $this->clientError(_('You cannot view others\' private people tags'), 403);
} }
} else { } else {
@ -139,6 +150,7 @@ class PeopletagsbyuserAction extends OwnerDesignAction
function showModeSelector() function showModeSelector()
{ {
$this->elementStart('dl', array('id'=>'filter_tags')); $this->elementStart('dl', array('id'=>'filter_tags'));
// TRANS: Mode selector label.
$this->element('dt', null, _('Mode')); $this->element('dt', null, _('Mode'));
$this->elementStart('dd'); $this->elementStart('dd');
$this->elementStart('ul'); $this->elementStart('ul');
@ -148,6 +160,7 @@ class PeopletagsbyuserAction extends OwnerDesignAction
array('href' => array('href' =>
common_local_url('peopletagsforuser', common_local_url('peopletagsforuser',
array('nickname' => $this->user->nickname))), array('nickname' => $this->user->nickname))),
// TRANS: Link text to show people tags for user %s.
sprintf(_('People tags for %s'), $this->tagger->nickname)); sprintf(_('People tags for %s'), $this->tagger->nickname));
$this->elementEnd('li'); $this->elementEnd('li');
@ -159,6 +172,7 @@ class PeopletagsbyuserAction extends OwnerDesignAction
array('nickname' => $this->tagger->nickname)), array('nickname' => $this->tagger->nickname)),
'method' => 'post')); 'method' => 'post'));
$this->elementStart('fieldset'); $this->elementStart('fieldset');
// TRANS: Fieldset legend.
$this->element('legend', null, _('Select tag to filter')); $this->element('legend', null, _('Select tag to filter'));
$priv = $this->arg('private'); $priv = $this->arg('private');
@ -167,12 +181,17 @@ class PeopletagsbyuserAction extends OwnerDesignAction
if (!$priv && !$pub) { if (!$priv && !$pub) {
$priv = $pub = true; $priv = $pub = true;
} }
$this->checkbox('private', _m('Private'), $priv, // TRANS: Checkbox label to show private tags.
_m('Show private tags')); $this->checkbox('private', _m('LABEL','Private'), $priv,
$this->checkbox('public', _m('Public'), $pub, // TRANS: Checkbox title.
_m('Show public tags')); _('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->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('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
$this->elementEnd('li'); $this->elementEnd('li');
@ -185,6 +204,9 @@ class PeopletagsbyuserAction extends OwnerDesignAction
function showAnonymousMessage() function showAnonymousMessage()
{ {
$notice = $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**. ' . sprintf(_('These are people tags created by **%s**. ' .
'People tags are how you sort similar ' . 'People tags are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' . 'people on %%%%site.name%%%%, a [micro-blogging]' .
@ -239,6 +261,9 @@ class PeopletagsbyuserAction extends OwnerDesignAction
function showEmptyListMessage() 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); $message = sprintf(_('%s has not created any [people tags](%%%%doc.tags%%%%) yet.'), $this->tagger->nickname);
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message)); $this->raw(common_markup_to_html($message));

View File

@ -46,9 +46,11 @@ class PeopletagsforuserAction extends OwnerDesignAction
function title() function title()
{ {
if ($this->page == 1) { 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 { } 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);
} }
} }
@ -73,6 +75,7 @@ class PeopletagsforuserAction extends OwnerDesignAction
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }
@ -80,6 +83,7 @@ class PeopletagsforuserAction extends OwnerDesignAction
$this->tagged = $this->user->getProfile(); $this->tagged = $this->user->getProfile();
if (!$this->tagged) { if (!$this->tagged) {
// TRANS: Server error displayed when a user has no profile.
$this->serverError(_('User has no profile.')); $this->serverError(_('User has no profile.'));
return false; return false;
} }
@ -98,6 +102,9 @@ class PeopletagsforuserAction extends OwnerDesignAction
function showAnonymousMessage() function showAnonymousMessage()
{ {
$notice = $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**. ' . sprintf(_('These are people tags for **%s**. ' .
'People tags are how you sort similar ' . 'People tags are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' . 'people on %%%%site.name%%%%, a [micro-blogging]' .
@ -117,7 +124,9 @@ class PeopletagsforuserAction extends OwnerDesignAction
'class' => 'child_1')); 'class' => 'child_1'));
$user = common_current_user(); $user = common_current_user();
// TRANS: Page notice.
$text = ($this->tagged->id == @$user->id) ? _('People tags by you') : $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); sprintf(_('People tags by %s'), $this->tagged->nickname);
$this->element('a', $this->element('a',
array('href' => array('href' =>
@ -150,6 +159,9 @@ class PeopletagsforuserAction extends OwnerDesignAction
function showEmptyListMessage() 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); $message = sprintf(_('%s has not been [tagged](%%%%doc.tags%%%%) by anyone yet.'), $this->tagged->nickname);
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message)); $this->raw(common_markup_to_html($message));

View File

@ -42,7 +42,6 @@ require_once(INSTALLDIR.'/lib/profilelist.php');
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class PeopletagsubscribersAction extends OwnerDesignAction class PeopletagsubscribersAction extends OwnerDesignAction
{ {
var $page = null; var $page = null;
@ -76,6 +75,7 @@ class PeopletagsubscribersAction extends OwnerDesignAction
} }
if (!$tagger) { if (!$tagger) {
// TRANS: Client error displayed when a tagger is expected but not provided.
$this->clientError(_('No tagger.'), 404); $this->clientError(_('No tagger.'), 404);
return false; return false;
} }
@ -83,6 +83,7 @@ class PeopletagsubscribersAction extends OwnerDesignAction
$user = User::staticGet('nickname', $tagger); $user = User::staticGet('nickname', $tagger);
if (!$user) { if (!$user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }
@ -91,7 +92,8 @@ class PeopletagsubscribersAction extends OwnerDesignAction
$this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag)); $this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag));
if (!$this->peopletag) { 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; return false;
} }
@ -101,10 +103,14 @@ class PeopletagsubscribersAction extends OwnerDesignAction
function title() function title()
{ {
if ($this->page == 1) { 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); $this->peopletag->tag, $this->tagger->nickname);
} else { } 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->peopletag->tag, $this->tagger->nickname,
$this->page); $this->page);
} }
@ -182,6 +188,7 @@ class PeopletagSubscriberListItem extends ProfileListItem
parent::showFullName(); parent::showFullName();
if ($this->profile->id == $this->peopletag->tagger) { if ($this->profile->id == $this->peopletag->tagger) {
$this->out->text(' '); $this->out->text(' ');
// TRANS: Addition in tag subscribers list for creator of a tag.
$this->out->element('span', 'role', _('Creator')); $this->out->element('span', 'role', _('Creator'));
} }
} }
@ -221,7 +228,7 @@ class PeopletagSubscriberListItem extends ProfileListItem
/** /**
* Fetch necessary return-to arguments for the profile forms * Fetch necessary return-to arguments for the profile forms
* to return to this list when they're done. * to return to this list when they're done.
* *
* @return array * @return array
*/ */
protected function returnToArgs() protected function returnToArgs()

View File

@ -46,9 +46,13 @@ class PeopletagsubscriptionsAction extends OwnerDesignAction
function title() function title()
{ {
if ($this->page == 1) { 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 { } 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);
} }
} }
@ -73,6 +77,7 @@ class PeopletagsubscriptionsAction extends OwnerDesignAction
$user = User::staticGet('nickname', $nickname); $user = User::staticGet('nickname', $nickname);
if (!$user) { if (!$user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }
@ -80,6 +85,7 @@ class PeopletagsubscriptionsAction extends OwnerDesignAction
$this->profile = $user->getProfile(); $this->profile = $user->getProfile();
if (!$this->profile) { if (!$this->profile) {
// TRANS: Server error displayed when a user has no profile.
$this->serverError(_('User has no profile.')); $this->serverError(_('User has no profile.'));
return false; return false;
} }
@ -98,6 +104,9 @@ class PeopletagsubscriptionsAction extends OwnerDesignAction
function showAnonymousMessage() function showAnonymousMessage()
{ {
$notice = $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**. ' . sprintf(_('These are people tags subscribed to by **%s**. ' .
'People tags are how you sort similar ' . 'People tags are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' . 'people on %%%%site.name%%%%, a [micro-blogging]' .

View File

@ -68,7 +68,6 @@ class ProfilecompletionAction extends Action
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -78,6 +77,7 @@ class ProfilecompletionAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_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.'. $this->clientError(_('There was a problem with your session token.'.
' Try again, please.')); ' Try again, please.'));
return false; return false;
@ -88,6 +88,7 @@ class ProfilecompletionAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->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.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
@ -96,13 +97,16 @@ class ProfilecompletionAction extends Action
$this->peopletag = Profile_list::staticGet('id', $id); $this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) { 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; return false;
} }
$field = $this->arg('field'); $field = $this->arg('field');
if (!in_array($field, array('fulltext', 'nickname', 'fullname', 'description', 'location', 'uri'))) { 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; return false;
} }
$this->field = $field; $this->field = $field;
@ -126,7 +130,8 @@ class ProfilecompletionAction extends Action
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $this->elementStart('head');
$this->element('title', null, _('Search results')); // TRANS: Page title.
$this->element('title', null, _m('TITLE','Search results'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');
$profiles = $this->getResults(); $profiles = $this->getResults();
@ -141,6 +146,7 @@ class ProfilecompletionAction extends Action
} }
$this->elementEnd('ul'); $this->elementEnd('ul');
} else { } else {
// TRANS: Output when there are no results for a search.
$this->element('p', 'error', _('No results.')); $this->element('p', 'error', _('No results.'));
} }
} }
@ -154,7 +160,8 @@ class ProfilecompletionAction extends Action
$q = $this->arg('q'); $q = $this->arg('q');
$q = strtolower($q); $q = strtolower($q);
if (strlen($q) < 3) { 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 = $this->arg('page');
$page = (int) (empty($page) ? 1 : $page); $page = (int) (empty($page) ? 1 : $page);
@ -172,6 +179,7 @@ class ProfilecompletionAction extends Action
else { else {
$cnt = $profile->find(); $cnt = $profile->find();
} }
// @todo FIXME: Call-time pass-by-reference has been deprecated.
Event::handle('EndProfileCompletionSearch', $this, &$profile, $search_engine); Event::handle('EndProfileCompletionSearch', $this, &$profile, $search_engine);
} }

View File

@ -311,7 +311,7 @@ class ProfilesettingsAction extends SettingsAction
if (!common_valid_profile_tag($tag)) { if (!common_valid_profile_tag($tag)) {
// TRANS: Validation error in form for profile settings. // TRANS: Validation error in form for profile settings.
// TRANS: %s is an invalid tag. // TRANS: %s is an invalid tag.
$this->showForm(sprintf(_('Invalid tag: "%s"'), $tag)); $this->showForm(sprintf(_('Invalid tag: "%s".'), $tag));
return; return;
} }

View File

@ -40,7 +40,6 @@ class ProfiletagbyidAction extends Action
* *
* @return boolean true * @return boolean true
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;
@ -54,6 +53,7 @@ class ProfiletagbyidAction extends Action
$tagger_id = $this->arg('tagger_id'); $tagger_id = $this->arg('tagger_id');
if (!$id) { if (!$id) {
// TRANS: Client error displayed trying to perform an action without providing an ID.
$this->clientError(_('No ID.')); $this->clientError(_('No ID.'));
return false; return false;
} }
@ -63,6 +63,7 @@ class ProfiletagbyidAction extends Action
$this->peopletag = Profile_list::staticGet('id', $id); $this->peopletag = Profile_list::staticGet('id', $id);
if (!$this->peopletag) { if (!$this->peopletag) {
// TRANS: Client error displayed trying to reference a non-existing people tag.
$this->clientError(_('No such people tag.'), 404); $this->clientError(_('No such people tag.'), 404);
return false; return false;
} }
@ -84,7 +85,6 @@ class ProfiletagbyidAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
common_redirect($this->peopletag->homeUrl(), 303); common_redirect($this->peopletag->homeUrl(), 303);

View File

@ -44,7 +44,6 @@ define('TAGS_PER_PAGE', 100);
* @copyright 2008-2009 StatusNet, Inc. * @copyright 2008-2009 StatusNet, Inc.
* @link http://status.net/ * @link http://status.net/
*/ */
class PublicpeopletagcloudAction extends Action class PublicpeopletagcloudAction extends Action
{ {
function isReadOnly($args) function isReadOnly($args)
@ -54,24 +53,32 @@ class PublicpeopletagcloudAction extends Action
function title() function title()
{ {
// TRANS: Title for page with public people tag cloud.
return _('Public people tag cloud'); return _('Public people tag cloud');
} }
function showPageNotice() function showPageNotice()
{ {
$this->element('p', 'instructions', $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'))); common_config('site', 'name')));
} }
function showEmptyList() 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.') . ' '; $message = _('No one has [tagged](%%doc.tags%%) anyone yet.') . ' ';
if (common_logged_in()) { 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!'); $message .= _('Be the first to tag someone!');
} }
else { 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!'); $message .= _('Why not [register an account](%%action.register%%) and be the first to tag someone!');
} }
@ -125,6 +132,7 @@ class PublicpeopletagcloudAction extends Action
ksort($tw); ksort($tw);
$this->elementStart('dl'); $this->elementStart('dl');
// TRANS: DT element on on page with public people tag cloud.
$this->element('dt', null, _('People tag cloud')); $this->element('dt', null, _('People tag cloud'));
$this->elementStart('dd'); $this->elementStart('dd');
$this->elementStart('ul', 'tags xoxo tag-cloud'); $this->elementStart('ul', 'tags xoxo tag-cloud');
@ -165,9 +173,10 @@ class PublicpeopletagcloudAction extends Action
$this->elementStart('li', $rel); $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)), $this->element('a', array('href' => common_local_url('peopletag', array('tag' => $tag)),
'title' => sprintf(_($count), $weight)), $tag); 'title' => $title), $tag);
$this->elementEnd('li'); $this->elementEnd('li');
} }
} }

View File

@ -53,7 +53,6 @@ require_once INSTALLDIR . '/lib/togglepeopletag.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class RemovepeopletagAction extends Action class RemovepeopletagAction extends Action
{ {
var $user; var $user;
@ -67,7 +66,6 @@ class RemovepeopletagAction extends Action
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -77,6 +75,7 @@ class RemovepeopletagAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_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.'. $this->clientError(_('There was a problem with your session token.'.
' Try again, please.')); ' Try again, please.'));
return false; return false;
@ -87,6 +86,7 @@ class RemovepeopletagAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->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.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
@ -98,6 +98,7 @@ class RemovepeopletagAction extends Action
$this->tagged = Profile::staticGet('id', $tagged_id); $this->tagged = Profile::staticGet('id', $tagged_id);
if (empty($this->tagged)) { if (empty($this->tagged)) {
// TRANS: Client error displayed when referring to a non-existing profile.
$this->clientError(_('No such profile.')); $this->clientError(_('No such profile.'));
return false; return false;
} }
@ -106,7 +107,8 @@ class RemovepeopletagAction extends Action
$this->peopletag = Profile_list::staticGet('id', $id); $this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) { 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; return false;
} }
@ -116,6 +118,7 @@ class RemovepeopletagAction extends Action
$omb01 = Remote_profile::staticGet('id', $tagged_id); $omb01 = Remote_profile::staticGet('id', $tagged_id);
if (!empty($omb01)) { 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'. $this->clientError(_('You cannot tag or untag an OMB 0.1'.
' remote profile with this action.')); ' remote profile with this action.'));
return false; return false;
@ -133,7 +136,6 @@ class RemovepeopletagAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
// Throws exception on error // Throws exception on error
@ -145,9 +147,13 @@ class RemovepeopletagAction extends Action
$user = User::staticGet('id', $this->tagged->id); $user = User::staticGet('id', $this->tagged->id);
if ($user) { if ($user) {
$this->clientError( $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)); $user->nickname));
} else { } 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.' . $this->clientError(sprintf(_('There was a problem tagging %s.' .
'The remote server is probably not responding correctly, ' . 'The remote server is probably not responding correctly, ' .
'please try retrying later.'), $this->profile->profileurl)); 'please try retrying later.'), $this->profile->profileurl));
@ -157,6 +163,7 @@ class RemovepeopletagAction extends Action
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $this->elementStart('head');
// TRANS: Title after untagging a people tag.
$this->element('title', null, _('Untagged')); $this->element('title', null, _('Untagged'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');

View File

@ -46,7 +46,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
*/ */
class SelftagAction extends Action class SelftagAction extends Action
{ {
var $tag = null; var $tag = null;
var $page = null; var $page = null;
@ -100,7 +99,6 @@ class SelftagAction extends Action
*/ */
function showContent() function showContent()
{ {
$profile = new Profile(); $profile = new Profile();
$offset = ($this->page - 1) * PROFILES_PER_PAGE; $offset = ($this->page - 1) * PROFILES_PER_PAGE;
@ -151,10 +149,11 @@ class SelftagAction extends Action
*/ */
function title() 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); $this->tag, $this->page);
} }
} }
class SelfTagProfileList extends ProfileList class SelfTagProfileList extends ProfileList

View File

@ -61,6 +61,7 @@ class ShowprofiletagAction extends Action
} }
if (!$tagger) { if (!$tagger) {
// TRANS: Client error displayed when a tagger is expected but not provided.
$this->clientError(_('No tagger.'), 404); $this->clientError(_('No tagger.'), 404);
return false; return false;
} }
@ -68,6 +69,7 @@ class ShowprofiletagAction extends Action
$user = User::staticGet('nickname', $tagger); $user = User::staticGet('nickname', $tagger);
if (!$user) { if (!$user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }
@ -80,7 +82,8 @@ class ShowprofiletagAction extends Action
($this->peopletag->private && $this->peopletag->tagger === $current->id)); ($this->peopletag->private && $this->peopletag->tagger === $current->id));
if (!$can_see) { 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; return false;
} }
@ -88,7 +91,7 @@ class ShowprofiletagAction extends Action
$this->notice = $this->peopletag->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); $this->notice = $this->peopletag->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
if ($this->page > 1 && $this->notice->N == 0) { 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); $this->serverError(_('No such page.'), $code = 404);
} }
@ -100,6 +103,7 @@ class ShowprofiletagAction extends Action
parent::handle($args); parent::handle($args);
if (!$this->peopletag) { if (!$this->peopletag) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return; return;
} }
@ -110,42 +114,49 @@ class ShowprofiletagAction extends Action
function title() function title()
{ {
if ($this->page > 1) { if ($this->page > 1) {
if($this->peopletag->private) { 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); $this->peopletag->tag, $this->page);
} }
$current = common_current_user(); $current = common_current_user();
if (!empty($current) && $current->id == $this->peopletag->tagger) { 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); $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'), return sprintf(_('Timeline for people tagged %1$s by %2$s, page %3$d'),
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname, $this->tagger->nickname,
$this->page $this->page
); );
} else { } else {
if($this->peopletag->private) { 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'), return sprintf(_('Private timeline of people tagged %s by you'),
$this->peopletag->tag, $this->page); $this->peopletag->tag);
} }
$current = common_current_user(); $current = common_current_user();
if (!empty($current) && $current->id == $this->peopletag->tagger) { 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'), 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'), return sprintf(_('Timeline for people tagged %1$s by %2$s'),
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname, $this->tagger->nickname
$this->page
); );
} }
} }
@ -161,7 +172,8 @@ class ShowprofiletagAction extends Action
'format' => 'rss' '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)), sprintf(_('Feed for friends of %s (RSS 2.0)'), $this->tagger->nickname)),
new Feed(Feed::ATOM, new Feed(Feed::ATOM,
common_local_url( common_local_url(
@ -171,8 +183,9 @@ class ShowprofiletagAction extends Action
'format' => 'atom' 'format' => 'atom'
) )
), ),
// TRANS: %1$s is user nickname // TRANS: Feed title.
sprintf(_('Feed for people tagged %s by %s (Atom)'), // 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 $this->peopletag->tag, $this->tagger->nickname
) )
) )
@ -187,16 +200,22 @@ class ShowprofiletagAction extends Action
function showEmptyListMessage() function showEmptyListMessage()
{ {
// TRANS: %1$s is user nickname // TRANS: Empty list message for people tag timeline.
$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: %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()) { if (common_logged_in()) {
$current_user = common_current_user(); $current_user = common_current_user();
if ($this->tagger->id == $current_user->id) { 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.'); $message .= _('Try tagging more people.');
} }
} else { } 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', 'guide');
@ -259,13 +278,16 @@ class ShowprofiletagAction extends Action
$this->elementStart('div', array('id' => 'entity_tagged', $this->elementStart('div', array('id' => 'entity_tagged',
'class' => 'section')); 'class' => 'section'));
if (Event::handle('StartShowTaggedProfilesMiniList', array($this))) { if (Event::handle('StartShowTaggedProfilesMiniList', array($this))) {
$title = ''; $title = '';
$current = common_current_user(); $current = common_current_user();
if(!empty($current) && $this->peopletag->tagger == $current->id) { 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); $title = sprintf(_('People tagged %s by you'), $this->peopletag->tag);
} else { } 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'), $title = sprintf(_('People tagged %1$s by %2$s'),
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname); $this->tagger->nickname);
@ -279,6 +301,7 @@ class ShowprofiletagAction extends Action
$pml = new ProfileMiniList($profile, $this); $pml = new ProfileMiniList($profile, $this);
$cnt = $pml->show(); $cnt = $pml->show();
if ($cnt == 0) { if ($cnt == 0) {
// TRANS: Content of "People tagged x by a user" if there are no tagged users.
$this->element('p', null, _('(None)')); $this->element('p', null, _('(None)'));
} }
} }
@ -289,6 +312,8 @@ class ShowprofiletagAction extends Action
array('nickname' => $this->tagger->nickname, array('nickname' => $this->tagger->nickname,
'profiletag' => $this->peopletag->tag)), 'profiletag' => $this->peopletag->tag)),
'class' => 'more'), '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')); _('Show all'));
$this->elementEnd('p'); $this->elementEnd('p');
} }
@ -305,6 +330,7 @@ class ShowprofiletagAction extends Action
$this->elementStart('div', array('id' => 'entity_subscribers', $this->elementStart('div', array('id' => 'entity_subscribers',
'class' => 'section')); 'class' => 'section'));
if (Event::handle('StartShowProfileTagSubscribersMiniList', array($this))) { if (Event::handle('StartShowProfileTagSubscribersMiniList', array($this))) {
// TRANS: Header for tag subscribers.
$this->element('h2', null, _('Subscribers')); $this->element('h2', null, _('Subscribers'));
$cnt = 0; $cnt = 0;
@ -313,6 +339,7 @@ class ShowprofiletagAction extends Action
$pml = new ProfileMiniList($profile, $this); $pml = new ProfileMiniList($profile, $this);
$cnt = $pml->show(); $cnt = $pml->show();
if ($cnt == 0) { if ($cnt == 0) {
// TRANS: Content of "People following tag x" if there are no subscribed users.
$this->element('p', null, _('(None)')); $this->element('p', null, _('(None)'));
} }
} }
@ -323,6 +350,8 @@ class ShowprofiletagAction extends Action
array('nickname' => $this->tagger->nickname, array('nickname' => $this->tagger->nickname,
'profiletag' => $this->peopletag->tag)), 'profiletag' => $this->peopletag->tag)),
'class' => 'more'), 'class' => 'more'),
// TRANS: Link for more "People following tag x"
// TRANS: if there are more than the mini list's maximum.
_('All subscribers')); _('All subscribers'));
$this->elementEnd('p'); $this->elementEnd('p');
} }

View File

@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class SubscribepeopletagAction extends Action class SubscribepeopletagAction extends Action
{ {
var $peopletag = null; var $peopletag = null;
@ -51,18 +50,19 @@ class SubscribepeopletagAction extends Action
/** /**
* Prepare to run * Prepare to run
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
if (!common_logged_in()) { 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; return false;
} }
// Only allow POST requests // Only allow POST requests
if ($_SERVER['REQUEST_METHOD'] != 'POST') { 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.')); $this->clientError(_('This action only accepts POST requests.'));
return false; return false;
} }
@ -72,6 +72,7 @@ class SubscribepeopletagAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_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.'. $this->clientError(_('There was a problem with your session token.'.
' Try again, please.')); ' Try again, please.'));
return false; return false;
@ -84,12 +85,14 @@ class SubscribepeopletagAction extends Action
if ($id) { if ($id) {
$this->peopletag = Profile_list::staticGet('id', $id); $this->peopletag = Profile_list::staticGet('id', $id);
} else { } else {
// TRANS: Client error displayed when trying to perform an action without providing an ID.
$this->clientError(_('No ID given.'), 404); $this->clientError(_('No ID given.'), 404);
return false; return false;
} }
if (!$this->peopletag || $this->peopletag->private) { 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 false;
} }
@ -117,14 +120,18 @@ class SubscribepeopletagAction extends Action
try { try {
Profile_tag_subscription::add($this->peopletag, $cur); Profile_tag_subscription::add($this->peopletag, $cur);
} catch (Exception $e) { } 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()); $cur->nickname, $this->peopletag->tag) . ' ' . $e->getMessage());
} }
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $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, $cur->nickname,
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname)); $this->tagger->nickname));

View File

@ -44,6 +44,7 @@ class TagprofileAction extends Action
$this->profile = Profile::staticGet('id', $id); $this->profile = Profile::staticGet('id', $id);
if (!$this->profile) { if (!$this->profile) {
// TRANS: Client error displayed when referring to non-existing profile ID.
$this->clientError(_('No profile with that ID.')); $this->clientError(_('No profile with that ID.'));
return false; return false;
} }
@ -51,6 +52,7 @@ class TagprofileAction extends Action
$current = common_current_user()->getProfile(); $current = common_current_user()->getProfile();
if ($this->profile && !$current->canTag($this->profile)) { 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.')); $this->clientError(_('You cannot tag this user.'));
} }
return true; return true;
@ -72,8 +74,11 @@ class TagprofileAction extends Action
function title() function title()
{ {
if (!$this->profile) { if (!$this->profile) {
// TRANS: Title for people tag form when not on a profile page.
return _('Tag a profile'); 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); return sprintf(_('Tag %s'), $this->profile->nickname);
} }
@ -83,7 +88,8 @@ class TagprofileAction extends Action
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $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->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');
$this->element('p', 'error', $error); $this->element('p', 'error', $error);
@ -98,6 +104,7 @@ class TagprofileAction extends Action
{ {
if (Event::handle('StartShowTagProfileForm', array($this, $this->profile)) && $this->profile) { if (Event::handle('StartShowTagProfileForm', array($this, $this->profile)) && $this->profile) {
$this->elementStart('div', 'entity_profile vcard author'); $this->elementStart('div', 'entity_profile vcard author');
// TRANS: Header in people tag form.
$this->element('h2', null, _('User profile')); $this->element('h2', null, _('User profile'));
$avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
@ -140,6 +147,7 @@ class TagprofileAction extends Action
'action' => common_local_url('tagprofile', array('id' => $this->profile->id)))); 'action' => common_local_url('tagprofile', array('id' => $this->profile->id))));
$this->elementStart('fieldset'); $this->elementStart('fieldset');
// TRANS: Fieldset legend for people tag form.
$this->element('legend', null, _('Tag user')); $this->element('legend', null, _('Tag user'));
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
$this->hidden('id', $this->profile->id); $this->hidden('id', $this->profile->id);
@ -150,12 +158,15 @@ class TagprofileAction extends Action
$this->elementStart('li'); $this->elementStart('li');
$tags = Profile_tag::getTagsArray($user->id, $this->profile->id, $user->id); $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), ($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('li');
$this->elementEnd('ul'); $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('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
@ -171,6 +182,7 @@ class TagprofileAction extends Action
if (Event::handle('StartSavePeopletags', array($this, $tagstring))) { if (Event::handle('StartSavePeopletags', array($this, $tagstring))) {
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '. $this->showForm(_('There was a problem with your session token. '.
'Try again, please.')); 'Try again, please.'));
return; return;
@ -188,7 +200,9 @@ class TagprofileAction extends Action
$tag = common_canonical_tag($tag); $tag = common_canonical_tag($tag);
if (!common_valid_profile_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; return;
} }
@ -211,7 +225,7 @@ class TagprofileAction extends Action
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $this->elementStart('head');
$this->element('title', null, _('Tags')); $this->element('title', null, _m('TITLE','Tags'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');
@ -226,7 +240,8 @@ class TagprofileAction extends Action
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->elementEnd('html');
} else { } else {
$this->error = 'Tags saved.'; // TRANS: Success message if people tags are saved.
$this->error = _('Tags saved.');
$this->showForm(); $this->showForm();
} }
@ -241,9 +256,9 @@ class TagprofileAction extends Action
} else { } else {
$this->elementStart('div', 'instructions'); $this->elementStart('div', 'instructions');
$this->element('p', null, $this->element('p', null,
// TRANS: Page notice.
_('Use this form to add tags to your subscribers or subscriptions.')); _('Use this form to add tags to your subscribers or subscriptions.'));
$this->elementEnd('div'); $this->elementEnd('div');
} }
} }
} }

View File

@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class UnsubscribepeopletagAction extends Action class UnsubscribepeopletagAction extends Action
{ {
var $peopletag = null; var $peopletag = null;
@ -57,12 +56,14 @@ class UnsubscribepeopletagAction extends Action
parent::prepare($args); parent::prepare($args);
if (!common_logged_in()) { 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; return false;
} }
// Only allow POST requests // Only allow POST requests
if ($_SERVER['REQUEST_METHOD'] != 'POST') { 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.')); $this->clientError(_('This action only accepts POST requests.'));
return false; return false;
} }
@ -72,6 +73,7 @@ class UnsubscribepeopletagAction extends Action
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_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.'. $this->clientError(_('There was a problem with your session token.'.
' Try again, please.')); ' Try again, please.'));
return false; return false;
@ -84,12 +86,14 @@ class UnsubscribepeopletagAction extends Action
if ($id) { if ($id) {
$this->peopletag = Profile_list::staticGet('id', $id); $this->peopletag = Profile_list::staticGet('id', $id);
} else { } else {
// TRANS: Client error displayed when trying to perform an action without providing an ID.
$this->clientError(_('No ID given.'), 404); $this->clientError(_('No ID given.'), 404);
return false; return false;
} }
if (!$this->peopletag || $this->peopletag->private) { 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 false;
} }
@ -107,7 +111,6 @@ class UnsubscribepeopletagAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -119,7 +122,9 @@ class UnsubscribepeopletagAction extends Action
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $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, $cur->nickname,
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname)); $this->tagger->nickname));

View File

@ -208,7 +208,7 @@ class Notice extends Memcached_DataObject
if (!$id) { if (!$id) {
// TRANS: Server exception. %s are the error details. // 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)); $last_error->message));
return; return;
} }
@ -1190,6 +1190,7 @@ class Notice extends Memcached_DataObject
$result = $ptagi->insert(); $result = $ptagi->insert();
if (!$result) { if (!$result) {
common_log_db_error($ptagi, 'INSERT', __FILE__); 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.')); throw new ServerException(_('Problem saving profile_tag inbox.'));
} }
@ -2289,7 +2290,7 @@ class Notice extends Memcached_DataObject
/** /**
* Check that the given profile is allowed to read, respond to, or otherwise * Check that the given profile is allowed to read, respond to, or otherwise
* act on this notice. * act on this notice.
* *
* The $scope member is a bitmask of scopes, representing a logical AND of the * 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 * 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." * "only visible to people who are mentioned in the notice AND are users on this site."

View File

@ -239,7 +239,7 @@ class Profile extends Memcached_DataObject
function getGroups($offset=0, $limit=PROFILES_PER_PAGE) function getGroups($offset=0, $limit=PROFILES_PER_PAGE)
{ {
$ids = array(); $ids = array();
$keypart = sprintf('profile:groups:%d', $this->id); $keypart = sprintf('profile:groups:%d', $this->id);
$idstring = self::cacheGet($keypart); $idstring = self::cacheGet($keypart);

View File

@ -397,6 +397,7 @@ class Profile_list extends Memcached_DataObject
if($orig->tag != $this->tag || $orig->tagger != $this->tagger) { if($orig->tag != $this->tag || $orig->tagger != $this->tagger) {
$existing = Profile_list::getByTaggerAndTag($this->tagger, $this->tag); $existing = Profile_list::getByTaggerAndTag($this->tagger, $this->tag);
if(!empty($existing)) { if(!empty($existing)) {
// TRANS: Server exception.
throw new ServerException(_('The tag you are trying to rename ' . throw new ServerException(_('The tag you are trying to rename ' .
'to already exists.')); 'to already exists.'));
} }
@ -597,7 +598,6 @@ class Profile_list extends Memcached_DataObject
* @return mixed Profile_list on success, false on fail * @return mixed Profile_list on success, false on fail
*/ */
static function saveNew($fields) { static function saveNew($fields) {
extract($fields); extract($fields);
$ptag = new Profile_list(); $ptag = new Profile_list();
@ -605,10 +605,12 @@ class Profile_list extends Memcached_DataObject
$ptag->query('BEGIN'); $ptag->query('BEGIN');
if (empty($tagger)) { if (empty($tagger)) {
// TRANS: Server exception saving new tag without having a tagger specified.
throw new Exception(_('No tagger specified.')); throw new Exception(_('No tagger specified.'));
} }
if (empty($tag)) { if (empty($tag)) {
// TRANS: Server exception saving new tag without having a tag specified.
throw new Exception(_('No tag specified.')); throw new Exception(_('No tag specified.'));
} }
@ -646,6 +648,7 @@ class Profile_list extends Memcached_DataObject
if (!$result) { if (!$result) {
common_log_db_error($ptag, 'INSERT', __FILE__); common_log_db_error($ptag, 'INSERT', __FILE__);
// TRANS: Server exception saving new tag.
throw new ServerException(_('Could not create profile tag.')); throw new ServerException(_('Could not create profile tag.'));
} }
@ -655,6 +658,7 @@ class Profile_list extends Memcached_DataObject
$result = $ptag->update($orig); $result = $ptag->update($orig);
if (!$result) { if (!$result) {
common_log_db_error($ptag, 'UPDATE', __FILE__); common_log_db_error($ptag, 'UPDATE', __FILE__);
// TRANS: Server exception saving new tag.
throw new ServerException(_('Could not set profile tag URI.')); throw new ServerException(_('Could not set profile tag URI.'));
} }
} }
@ -671,6 +675,7 @@ class Profile_list extends Memcached_DataObject
$result = $ptag->update($orig); $result = $ptag->update($orig);
if (!$result) { if (!$result) {
common_log_db_error($ptag, 'UPDATE', __FILE__); common_log_db_error($ptag, 'UPDATE', __FILE__);
// TRANS: Server exception saving new tag.
throw new ServerException(_('Could not set profile tag mainpage.')); throw new ServerException(_('Could not set profile tag mainpage.'));
} }
} }

View File

@ -143,6 +143,7 @@ class Profile_tag extends Memcached_DataObject
if (Event::handle('StartTagProfile', array($tagger_profile, $tagged_profile, $tag))) { if (Event::handle('StartTagProfile', array($tagger_profile, $tagged_profile, $tag))) {
if (!$tagger_profile->canTag($tagged_profile)) { 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.')); throw new ClientException(_('You cannot tag this user.'));
return false; return false;
} }
@ -152,6 +153,7 @@ class Profile_tag extends Memcached_DataObject
$count = (int) $tags->count('distinct tag'); $count = (int) $tags->count('distinct tag');
if ($count >= common_config('peopletag', 'maxtags')) { 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 ' . throw new ClientException(sprintf(_('You already have created %d or more tags ' .
'which is the maximum allowed number of tags. ' . 'which is the maximum allowed number of tags. ' .
'Try using or deleting some existing tags.'), 'Try using or deleting some existing tags.'),
@ -165,7 +167,8 @@ class Profile_tag extends Memcached_DataObject
$profile_list = Profile_list::ensureTag($tagger, $tag, $desc, $private); $profile_list = Profile_list::ensureTag($tagger, $tag, $desc, $private);
if ($profile_list->taggedCount() >= common_config('peopletag', 'maxpeople')) { 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.' . 'which is the maximum allowed number.' .
'Try untagging others with the same tag first.'), 'Try untagging others with the same tag first.'),
common_config('peopletag', 'maxpeople'), $tag)); common_config('peopletag', 'maxpeople'), $tag));

View File

@ -50,7 +50,8 @@ class Profile_tag_subscription extends Memcached_DataObject
if (!$result) { if (!$result) {
common_log_db_error($sub, 'INSERT', __FILE__); 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); $ptag = Profile_list::staticGet('id', $peopletag->id);
@ -76,7 +77,8 @@ class Profile_tag_subscription extends Memcached_DataObject
if (!$result) { if (!$result) {
common_log_db_error($sub, 'DELETE', __FILE__); 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); $peopletag->subscriberCount(true);

View File

@ -809,7 +809,8 @@ class User extends Memcached_DataObject
function repeatedToMe($offset=0, $limit=20, $since_id=null, $max_id=null) 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() function shareLocation()

View File

@ -328,7 +328,6 @@ class Action extends HTMLOutputter // lawsuit
$this->script('util.js'); $this->script('util.js');
$this->script('xbImportNode.js'); $this->script('xbImportNode.js');
$this->script('geometa.js'); $this->script('geometa.js');
} }
$this->inlineScript('var _peopletagAC = "' . $this->inlineScript('var _peopletagAC = "' .
common_local_url('peopletagautocomplete') . '";'); common_local_url('peopletagautocomplete') . '";');
@ -349,7 +348,6 @@ class Action extends HTMLOutputter // lawsuit
* events and appending to the array. Try to avoid adding strings that won't be used, as * events and appending to the array. Try to avoid adding strings that won't be used, as
* they'll be added to HTML output. * they'll be added to HTML output.
*/ */
function showScriptMessages() function showScriptMessages()
{ {
$messages = array(); $messages = array();
@ -747,7 +745,6 @@ class Action extends HTMLOutputter // lawsuit
* *
* @return nothing * @return nothing
*/ */
function showProfileBlock() function showProfileBlock()
{ {
if (common_logged_in()) { if (common_logged_in()) {

View File

@ -63,7 +63,8 @@ class ApiListUsersAction extends ApiBareAuthAction
$this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id')); $this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id'));
if (empty($this->list)) { 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 false;
} }
@ -144,6 +145,7 @@ class ApiListUsersAction extends ApiBareAuthAction
break; break;
default: default:
$this->clientError( $this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'), _('API method not found.'),
404, 404,
$this->format $this->format
@ -185,7 +187,6 @@ class ApiListUsersAction extends ApiBareAuthAction
* *
* @return string etag * @return string etag
*/ */
function etag() function etag()
{ {
if (!empty($this->list)) { if (!empty($this->list)) {
@ -203,5 +204,4 @@ class ApiListUsersAction extends ApiBareAuthAction
return null; return null;
} }
} }

View File

@ -61,14 +61,14 @@ class AtomListNoticeFeed extends AtomNoticeFeed
$this->list = $list; $this->list = $list;
$this->tagger = Profile::staticGet('id', $list->tagger); $this->tagger = Profile::staticGet('id', $list->tagger);
// TRANS: Title in atom list notice feed. %s is a list name. // 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 #%s by %s"), $list->tag, $this->tagger->nickname); $title = sprintf(_('Timeline for people tagged #%1$s by %2$s'), $list->tag, $this->tagger->nickname);
$this->setTitle($title); $this->setTitle($title);
$sitename = common_config('site', 'name'); $sitename = common_config('site', 'name');
$subtitle = sprintf( $subtitle = sprintf(
// TRANS: Message is used as a subtitle in atom list notice feed. // 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!'), _('Updates from %1$s\'s %2$s people tag on %3$s!'),
$this->tagger->nickname, $this->tagger->nickname,
$list->tag, $list->tag,
@ -101,5 +101,4 @@ class AtomListNoticeFeed extends AtomNoticeFeed
{ {
return $this->list; return $this->list;
} }
} }

View File

@ -180,7 +180,7 @@ class UnimplementedCommand extends Command
function handle($channel) function handle($channel)
{ {
// TRANS: Error text shown when an unimplemented command is given. // 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.'));
} }
} }
@ -295,7 +295,7 @@ class FavCommand extends Command
if ($fave->fetch()) { if ($fave->fetch()) {
// TRANS: Error message text shown when a favorite could not be set because it has already been favorited. // 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; return;
} }
@ -431,10 +431,12 @@ class TagCommand extends Command
$cur = $this->user->getProfile(); $cur = $this->user->getProfile();
if (!$profile) { if (!$profile) {
// TRANS: Client error displayed trying to perform an action related to a non-existing profile.
$channel->error($cur, _('No such profile.')); $channel->error($cur, _('No such profile.'));
return; return;
} }
if (!$cur->canTag($profile)) { 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.')); $channel->error($cur, _('You cannot tag this user.'));
return; return;
} }
@ -448,7 +450,9 @@ class TagCommand extends Command
$tag = $clean_tags[] = common_canonical_tag($tag); $tag = $clean_tags[] = common_canonical_tag($tag);
if (!common_valid_profile_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; return;
} }
$privs[$tag] = $private; $privs[$tag] = $private;
@ -459,18 +463,22 @@ class TagCommand extends Command
Profile_tag::setTag($cur->id, $profile->id, $tag, null, $privs[$tag]); Profile_tag::setTag($cur->id, $profile->id, $tag, null, $privs[$tag]);
} }
} catch (Exception $e) { } 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())); $profile->nickname, $e->getMessage()));
return; 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'), $channel->output($cur, sprintf(_('%1$s was tagged %2$s'),
$profile->nickname, $profile->nickname,
implode(', ', $clean_tags))); // TRANS: Separator for list of tags.
implode(_(', '), $clean_tags)));
} }
} }
class UntagCommand extends TagCommand class UntagCommand extends TagCommand
{ {
function handle($channel) function handle($channel)
@ -479,10 +487,12 @@ class UntagCommand extends TagCommand
$cur = $this->user->getProfile(); $cur = $this->user->getProfile();
if (!$profile) { if (!$profile) {
// TRANS: Client error displayed trying to perform an action related to a non-existing profile.
$channel->error($cur, _('No such profile.')); $channel->error($cur, _('No such profile.'));
return; return;
} }
if (!$cur->canTag($profile)) { 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.')); $channel->error($cur, _('You cannot tag this user.'));
return; return;
} }
@ -491,6 +501,8 @@ class UntagCommand extends TagCommand
foreach ($tags as $tag) { foreach ($tags as $tag) {
if (!common_valid_profile_tag($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)); $channel->error($cur, sprintf(_('Invalid tag: "%s"'), $tag));
return; return;
} }
@ -501,14 +513,19 @@ class UntagCommand extends TagCommand
Profile_tag::unTag($cur->id, $profile->id, $tag); Profile_tag::unTag($cur->id, $profile->id, $tag);
} }
} catch (Exception $e) { } 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())); $profile->nickname, $e->getMessage()));
return; 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.'), $channel->output($cur, sprintf(_('The following tag(s) were removed from user %1$s: %2$s.'),
$profile->nickname, $profile->nickname,
implode(', ', $tags))); // TRANS: Separator for list of tags.
implode(_(', '), $tags)));
} }
} }
@ -991,83 +1008,83 @@ class HelpCommand extends Command
{ {
// TRANS: Header line of help text for commands. // TRANS: Header line of help text for commands.
$out = array(_m('COMMANDHELP', "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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'"), "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'"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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"), "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'"), "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'"), "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'"), "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'"), "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'"), "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."), "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."), "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."), "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."), "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."), "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."), "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."), "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."), "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."), "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.")); "tracking" => _m('COMMANDHELP', "not yet implemented."));
// Give plugins a chance to add or override... // Give plugins a chance to add or override...

View File

@ -339,7 +339,7 @@ class CommandInterpreter
default: default:
$result = false; $result = false;
} }
Event::handle('EndInterpretCommand', array($cmd, $arg, $user, &$result)); Event::handle('EndInterpretCommand', array($cmd, $arg, $user, &$result));
} }

View File

@ -274,7 +274,7 @@ $default =
'maxpeople' => 500, // maximum no. of people with the same tag by the same user '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) 'allow_tagging' => array('all' => true), // equivalent to array('local' => true, 'remote' => true)
'desclimit' => null), 'desclimit' => null),
'oembed' => 'oembed' =>
array('endpoint' => 'http://oohembed.com/oohembed/', array('endpoint' => 'http://oohembed.com/oohembed/',
'order' => array('built-in', 'well-known', 'service', 'discovery'), 'order' => array('built-in', 'well-known', 'service', 'discovery'),
), ),

View File

@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/togglepeopletag.php';
* *
* @see GroupEditForm * @see GroupEditForm
*/ */
class PeopletagEditForm extends Form class PeopletagEditForm extends Form
{ {
/** /**
@ -60,7 +59,6 @@ class PeopletagEditForm extends Form
* @param Action $out output channel * @param Action $out output channel
* @param User_group $group group to join * @param User_group $group group to join
*/ */
function __construct($out=null, Profile_list $peopletag=null) function __construct($out=null, Profile_list $peopletag=null)
{ {
parent::__construct($out); parent::__construct($out);
@ -74,7 +72,6 @@ class PeopletagEditForm extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'form_peopletag_edit-' . $this->peopletag->id; return 'form_peopletag_edit-' . $this->peopletag->id;
@ -85,7 +82,6 @@ class PeopletagEditForm extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_settings'; return 'form_settings';
@ -96,7 +92,6 @@ class PeopletagEditForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return common_local_url('editpeopletag', return common_local_url('editpeopletag',
@ -108,10 +103,11 @@ class PeopletagEditForm extends Form
* *
* @return void * @return void
*/ */
function formLegend() 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));
} }
/** /**
@ -119,7 +115,6 @@ class PeopletagEditForm extends Form
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
$id = $this->peopletag->id; $id = $this->peopletag->id;
@ -131,21 +126,32 @@ class PeopletagEditForm extends Form
$this->out->elementStart('li'); $this->out->elementStart('li');
$this->out->hidden('id', $id); $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, ($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->elementEnd('li');
$this->out->elementStart('li'); $this->out->elementStart('li');
$desclimit = Profile_list::maxDescription(); $desclimit = Profile_list::maxDescription();
if ($desclimit == 0) { 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 { } 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->textarea('description', _('Description'),
($this->out->arg('description')) ? $this->out->arg('description') : $description, ($this->out->arg('description')) ? $this->out->arg('description') : $description,
$descinstr); $descinstr);
// TRANS: Checkbox label to mark a people tag private.
$this->out->checkbox('private', _('Private'), $private); $this->out->checkbox('private', _('Private'), $private);
$this->out->elementEnd('li'); $this->out->elementEnd('li');
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
@ -156,24 +162,28 @@ class PeopletagEditForm extends Form
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
// TRANS: Button text to save a people tag.
$this->out->submit('submit', _('Save')); $this->out->submit('submit', _('Save'));
$this->out->submit('form_action-yes', $this->out->submit('form_action-yes',
// TRANS: Button text to delete a people tag.
_m('BUTTON','Delete'), _m('BUTTON','Delete'),
'submit', 'submit',
'delete', 'delete',
_('Delete this people tag')); // TRANS: Button title to delete a people tag.
_('Delete this people tag.'));
} }
function showProfileList() function showProfileList()
{ {
$tagged = $this->peopletag->getTagged(); $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->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 = new SearchProfileForm($this->out, $this->peopletag);
$search->show(); $search->show();
$this->out->element('ul', array('id' => 'profile_search_results', 'class' => 'empty')); $this->out->element('ul', array('id' => 'profile_search_results', 'class' => 'empty'));

View File

@ -52,7 +52,6 @@ require_once INSTALLDIR.'/lib/widget.php';
* *
* @see HTMLOutputter * @see HTMLOutputter
*/ */
class PeopletagGroupNav extends Widget class PeopletagGroupNav extends Widget
{ {
var $action = null; var $action = null;
@ -62,7 +61,6 @@ class PeopletagGroupNav extends Widget
* *
* @param Action $action current action, used for output * @param Action $action current action, used for output
*/ */
function __construct($action=null) function __construct($action=null)
{ {
parent::__construct($action); parent::__construct($action);
@ -74,7 +72,6 @@ class PeopletagGroupNav extends Widget
* *
* @return void * @return void
*/ */
function show() function show()
{ {
$user = null; $user = null;
@ -106,24 +103,33 @@ class PeopletagGroupNav extends Widget
// People tag timeline // People tag timeline
$this->out->menuItem(common_local_url('showprofiletag', array('tagger' => $user_profile->nickname, $this->out->menuItem(common_local_url('showprofiletag', array('tagger' => $user_profile->nickname,
'tag' => $tag->tag)), 'tag' => $tag->tag)),
_('People tag'), // TRANS: Menu item in people tag navigation panel.
sprintf(_('%s tag by %s'), $tag->tag, _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)), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'showprofiletag', 'nav_timeline_peopletag'); $action == 'showprofiletag', 'nav_timeline_peopletag');
// Tagged // Tagged
$this->out->menuItem(common_local_url('peopletagged', array('tagger' => $user->nickname, $this->out->menuItem(common_local_url('peopletagged', array('tagger' => $user->nickname,
'tag' => $tag->tag)), 'tag' => $tag->tag)),
_('Tagged'), // TRANS: Menu item in people tag navigation panel.
sprintf(_('%s tag by %s'), $tag->tag, _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)), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'peopletagged', 'nav_peopletag_tagged'); $action == 'peopletagged', 'nav_peopletag_tagged');
// Subscribers // Subscribers
$this->out->menuItem(common_local_url('peopletagsubscribers', array('tagger' => $user->nickname, $this->out->menuItem(common_local_url('peopletagsubscribers', array('tagger' => $user->nickname,
'tag' => $tag->tag)), 'tag' => $tag->tag)),
_('Subscribers'), // TRANS: Menu item in people tag navigation panel.
sprintf(_('Subscribers to %s tag by %s'), $tag->tag, _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)), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'peopletagsubscribers', 'nav_peopletag_subscribers'); $action == 'peopletagsubscribers', 'nav_peopletag_subscribers');
@ -132,8 +138,11 @@ class PeopletagGroupNav extends Widget
// Edit // Edit
$this->out->menuItem(common_local_url('editpeopletag', array('tagger' => $user->nickname, $this->out->menuItem(common_local_url('editpeopletag', array('tagger' => $user->nickname,
'tag' => $tag->tag)), 'tag' => $tag->tag)),
_('Edit'), // TRANS: Menu item in people tag navigation panel.
sprintf(_('Edit %s tag by you'), $tag->tag, _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)), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'editpeopletag', 'nav_peopletag_edit'); $action == 'editpeopletag', 'nav_peopletag_edit');
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* StatusNet, the distributed open-source microblogging tool * StatusNet, the distributed open-source microblogging tool
* *
@ -44,7 +43,6 @@ define('PEOPLETAGS_PER_PAGE', 20);
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class PeopletagList extends Widget class PeopletagList extends Widget
{ {
/** Current peopletag, peopletag query. */ /** Current peopletag, peopletag query. */
@ -104,7 +102,6 @@ class PeopletagListItem extends Widget
* *
* @param Notice $notice The notice we'll display * @param Notice $notice The notice we'll display
*/ */
function __construct($peopletag, $current, $out=null) function __construct($peopletag, $current, $out=null)
{ {
parent::__construct($out); parent::__construct($out);
@ -121,7 +118,6 @@ class PeopletagListItem extends Widget
* *
* @return void * @return void
*/ */
function url() function url()
{ {
return $this->peopletag->homeUrl(); return $this->peopletag->homeUrl();
@ -173,6 +169,7 @@ class PeopletagListItem extends Widget
array('href' => common_local_url('peopletagged', array('href' => common_local_url('peopletagged',
array('tagger' => $this->profile->nickname, array('tagger' => $this->profile->nickname,
'tag' => $this->peopletag->tag))), 'tag' => $this->peopletag->tag))),
// TRANS: Link description for link to list of users tagged with a tag.
_('Tagged')); _('Tagged'));
$this->out->raw($this->peopletag->taggedCount()); $this->out->raw($this->peopletag->taggedCount());
$this->out->elementEnd('span'); $this->out->elementEnd('span');
@ -182,6 +179,7 @@ class PeopletagListItem extends Widget
array('href' => common_local_url('peopletagsubscribers', array('href' => common_local_url('peopletagsubscribers',
array('tagger' => $this->profile->nickname, array('tagger' => $this->profile->nickname,
'tag' => $this->peopletag->tag))), 'tag' => $this->peopletag->tag))),
// TRANS: Link description for link to list of users subscribed to a tag.
_('Subscribers')); _('Subscribers'));
$this->out->raw($this->peopletag->subscriberCount()); $this->out->raw($this->peopletag->subscriberCount());
$this->out->elementEnd('span'); $this->out->elementEnd('span');
@ -194,7 +192,9 @@ class PeopletagListItem extends Widget
$this->out->element('a', array('href' => $this->out->element('a', array('href' =>
common_local_url('editpeopletag', array('tagger' => $this->profile->nickname, common_local_url('editpeopletag', array('tagger' => $this->profile->nickname,
'tag' => $this->peopletag->tag)), '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')); _('Edit'));
$this->out->elementEnd('li'); $this->out->elementEnd('li');
} }
@ -256,7 +256,8 @@ class PeopletagListItem extends Widget
$this->out->elementStart('a', $this->out->elementStart('a',
array('href' => common_local_url('peopletagsbyuser', array('href' => common_local_url('peopletagsbyuser',
array('nickname' => $this->profile->nickname, 'private' => 1)))); 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'); $this->out->elementEnd('a');
} }
} }

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc. * Copyright (C) 2011, StatusNet, Inc.
* *
* Stream of notices for a people tag * Stream of notices for a people tag
* *
* PHP version 5 * PHP version 5
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify

View File

@ -40,7 +40,6 @@ require_once INSTALLDIR.'/lib/widget.php';
* @author Shashi Gowda <connect2shashi@gmail.com> * @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 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
*/ */
class PeopletagsWidget extends Widget class PeopletagsWidget extends Widget
{ {
/* /*
@ -84,7 +83,8 @@ class PeopletagsWidget extends Widget
function label() function label()
{ {
return _('Tags by you'); // TRANS: Label in people tags widget.
return _m('LABEL','Tags by you');
} }
function showTags() function showTags()
@ -131,7 +131,8 @@ class PeopletagsWidget extends Widget
'action' => common_local_url('tagprofile', array('id' => $this->tagged->id)))); 'action' => common_local_url('tagprofile', array('id' => $this->tagged->id))));
$this->out->elementStart('fieldset'); $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('token', common_session_token());
$this->out->hidden('id', $this->tagged->id); $this->out->hidden('id', $this->tagged->id);
@ -141,7 +142,8 @@ class PeopletagsWidget extends Widget
$this->out->input('tags', $this->label(), $this->out->input('tags', $this->label(),
($this->out->arg('tags')) ? $this->out->arg('tags') : implode(' ', $tags)); ($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('fieldset');
$this->out->elementEnd('form'); $this->out->elementEnd('form');
@ -160,6 +162,7 @@ class PeopletagsWidget extends Widget
} }
$this->out->elementStart('ul', $class); $this->out->elementStart('ul', $class);
// TRANS: Empty list message for tags.
$this->out->element('li', null, _('(None)')); $this->out->element('li', null, _('(None)'));
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
@ -186,6 +189,7 @@ class SelftagsWidget extends PeopletagsWidget
function label() function label()
{ {
return _('Tags'); // TRANS: Label in self tags widget.
return _m('LABEL','Tags');
} }
} }

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class PeopletagsBySubsSection extends PeopletagSection class PeopletagsBySubsSection extends PeopletagSection
{ {
function getPeopletags() function getPeopletags()
@ -66,6 +65,7 @@ class PeopletagsBySubsSection extends PeopletagSection
function title() function title()
{ {
// TRANS: Title for section contaning people tags with the most subscribers.
return _('People tags with most subscribers'); return _('People tags with most subscribers');
} }

View File

@ -46,7 +46,6 @@ define('PEOPLETAGS_PER_SECTION', 6);
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class PeopletagSection extends Section class PeopletagSection extends Section
{ {
function showContent() function showContent()
@ -120,8 +119,11 @@ class PeopletagSectionItem extends PeopletagListItem
function showTag() function showTag()
{ {
$title = _('Tagged: ') . $this->peopletag->taggedCount() . // TRANS: Tag summary. %1$d is the number of users tagged with the tag,
' ' . _('Subscribers: ') . $this->peopletag->subscriberCount(); // 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->elementStart('span', 'entry-title tag');
$this->out->element('a', $this->out->element('a',

View File

@ -39,7 +39,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class PeopletagsForUserSection extends PeopletagSection class PeopletagsForUserSection extends PeopletagSection
{ {
var $profile=null; var $profile=null;
@ -67,10 +66,11 @@ class PeopletagsForUserSection extends PeopletagSection
if ($this->profile->id == common_current_user()->id) { if ($this->profile->id == common_current_user()->id) {
$name = 'you'; $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); return sprintf(_('People tags for %s'), $name);
} }
function link() function link()
{ {
return common_local_url('peopletagsforuser', return common_local_url('peopletagsforuser',

View File

@ -39,7 +39,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class PeopletagSubscriptionsSection extends PeopletagSection class PeopletagSubscriptionsSection extends PeopletagSection
{ {
var $profile=null; var $profile=null;
@ -62,6 +61,7 @@ class PeopletagSubscriptionsSection extends PeopletagSection
function title() function title()
{ {
// TRANS: Title for page that displays people tags a user has subscribed to.
return _('People tag subscriptions'); return _('People tag subscriptions');
} }

View File

@ -105,8 +105,14 @@ class PersonalGroupNav extends Menu
$mine && $action =='showfavorites', 'nav_timeline_favorites'); $mine && $action =='showfavorites', 'nav_timeline_favorites');
$this->out->menuItem(common_local_url('peopletagsbyuser', array('nickname' => $this->out->menuItem(common_local_url('peopletagsbyuser', array('nickname' =>
$nickname)), $nickname)),
_('People tags'), // TRANS: Menu item in personal group navigation menu.
sprintf(_('People tags by %s'), ($user_profile) ? $name : _('User')), _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')), in_array($action, array('peopletagsbyuser', 'peopletagsforuser')),
'nav_timeline_peopletags'); 'nav_timeline_peopletags');

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc. * Copyright (C) 2011, StatusNet, Inc.
* *
* Superclass for profile blocks * Superclass for profile blocks
* *
* PHP version 5 * PHP version 5
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* StatusNet, the distributed open-source microblogging tool * StatusNet, the distributed open-source microblogging tool
* *
@ -45,7 +44,6 @@ require_once INSTALLDIR.'/lib/peopletags.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ProfileList extends Widget class ProfileList extends Widget
{ {
/** Current profile, profile query. */ /** Current profile, profile query. */

View File

@ -74,7 +74,9 @@ class PublicGroupNav extends Menu
// TRANS: Menu item title in search group navigation panel. // TRANS: Menu item title in search group navigation panel.
_('Recent tags'), $action_name == 'publictagcloud', 'nav_recent-tags'); _('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', _('People tags'), in_array($action_name, array('publicpeopletagcloud',
'peopletag', 'selftag')), 'nav_people-tags'); 'peopletag', 'selftag')), 'nav_people-tags');

View File

@ -131,8 +131,11 @@ class SubGroupNav extends Menu
$this->out->menuItem(common_local_url('peopletagsbyuser', $this->out->menuItem(common_local_url('peopletagsbyuser',
array('nickname' => array('nickname' =>
$this->user->nickname)), $this->user->nickname)),
_('People tags'), // TRANS: Menu item title in local navigation menu.
sprintf(_('People tags by %s'), _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), $this->user->nickname),
in_array($action, array('peopletagsbyuser', 'peopletagsforuser')), in_array($action, array('peopletagsbyuser', 'peopletagsforuser')),
'nav_timeline_peopletags'); 'nav_timeline_peopletags');

View File

@ -44,13 +44,11 @@ require_once INSTALLDIR.'/lib/form.php';
* *
* @see UnsubscribeForm * @see UnsubscribeForm
*/ */
class SubscribePeopletagForm extends Form class SubscribePeopletagForm extends Form
{ {
/** /**
* peopletag for the user to join * peopletag for the user to join
*/ */
var $peopletag = null; var $peopletag = null;
/** /**
@ -59,7 +57,6 @@ class SubscribePeopletagForm extends Form
* @param HTMLOutputter $out output channel * @param HTMLOutputter $out output channel
* @param peopletag $peopletag peopletag to subscribe to * @param peopletag $peopletag peopletag to subscribe to
*/ */
function __construct($out=null, $peopletag=null) function __construct($out=null, $peopletag=null)
{ {
parent::__construct($out); parent::__construct($out);
@ -72,7 +69,6 @@ class SubscribePeopletagForm extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'peopletag-subscribe-' . $this->peopletag->id; return 'peopletag-subscribe-' . $this->peopletag->id;
@ -83,7 +79,6 @@ class SubscribePeopletagForm extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_peopletag_subscribe'; return 'form_peopletag_subscribe';
@ -94,7 +89,6 @@ class SubscribePeopletagForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return common_local_url('subscribepeopletag', return common_local_url('subscribepeopletag',
@ -106,9 +100,9 @@ class SubscribePeopletagForm extends Form
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', _('Subscribe')); // TRANS: Button text for subscribing to a people tag.
$this->out->submit('submit', m('BUTTON','Subscribe'));
} }
} }

View File

@ -43,7 +43,6 @@ require_once INSTALLDIR.'/lib/profilelist.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class SubscriptionList extends ProfileList class SubscriptionList extends ProfileList
{ {
/** Owner of this list */ /** Owner of this list */

View File

@ -43,7 +43,6 @@ require_once INSTALLDIR.'/lib/form.php';
* *
* @see GroupEditForm * @see GroupEditForm
*/ */
class SearchProfileForm extends Form class SearchProfileForm extends Form
{ {
var $peopletag; var $peopletag;
@ -59,7 +58,6 @@ class SearchProfileForm extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'form_peopletag-add-' . $this->peopletag->id; return 'form_peopletag-add-' . $this->peopletag->id;
@ -70,7 +68,6 @@ class SearchProfileForm extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_peopletag_edit_user_search'; return 'form_peopletag_edit_user_search';
@ -81,7 +78,6 @@ class SearchProfileForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return common_local_url('profilecompletion'); return common_local_url('profilecompletion');
@ -92,9 +88,9 @@ class SearchProfileForm extends Form
* *
* @return void * @return void
*/ */
function formLegend() function formLegend()
{ {
// TRANS: Form legend.
$this->out->element('legend', null, sprintf(_('Search and list people'))); $this->out->element('legend', null, sprintf(_('Search and list people')));
} }
@ -103,21 +99,28 @@ class SearchProfileForm extends Form
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
$fields = array('fulltext' => 'Everything', // TRANS: Dropdown option for searching in profiles.
'nickname' => 'Nickname', $fields = array('fulltext' => _('Everything'),
'fullname' => 'Fullname', // TRANS: Dropdown option for searching in profiles.
'description' => 'Description', 'nickname' => _('Nickname'),
'location' => 'Location', // TRANS: Dropdown option for searching in profiles.
'uri' => 'Uri (Remote users)'); '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->hidden('peopletag_id', $this->peopletag->id);
$this->out->input('q', null); $this->out->input('q', null);
$this->out->dropdown('field', _('Search in'), $fields, // TRANS: Dropdown field label.
_('Choose a field to search'), false, 'fulltext'); $this->out->dropdown('field', _m('LABEL','Search in'), $fields,
// TRANS: Dropdown field title.
_('Choose a field to search.'), false, 'fulltext');
} }
/** /**
@ -125,10 +128,10 @@ class SearchProfileForm extends Form
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', _('Search')); // TRANS: Button text to search profiles.
$this->out->submit('submit', _m('BUTTON','Search'));
} }
} }
@ -149,7 +152,6 @@ class UntagButton extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'form_peopletag-' . $this->peopletag->id . '-remove-' . $this->profile->id; return 'form_peopletag-' . $this->peopletag->id . '-remove-' . $this->profile->id;
@ -160,7 +162,6 @@ class UntagButton extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_user_remove_peopletag'; return 'form_user_remove_peopletag';
@ -182,10 +183,11 @@ class UntagButton extends Form
* *
* @return void * @return void
*/ */
function formLegend() 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)); $this->profile->nickname, $this->peopletag->tag));
} }
@ -194,7 +196,6 @@ class UntagButton extends Form
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
$this->out->hidden('peopletag_id', $this->peopletag->id); $this->out->hidden('peopletag_id', $this->peopletag->id);
@ -206,14 +207,13 @@ class UntagButton extends Form
* *
* @return void * @return void
*/ */
function formActions() 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 class TagButton extends Form
{ {
var $profile; var $profile;
@ -231,7 +231,6 @@ class TagButton extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'form_peopletag-' . $this->peopletag->id . '-add-' . $this->profile->id; return 'form_peopletag-' . $this->peopletag->id . '-add-' . $this->profile->id;
@ -242,7 +241,6 @@ class TagButton extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_user_add_peopletag'; return 'form_user_add_peopletag';
@ -253,7 +251,6 @@ class TagButton extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return common_local_url('addpeopletag'); return common_local_url('addpeopletag');
@ -264,10 +261,11 @@ class TagButton extends Form
* *
* @return void * @return void
*/ */
function formLegend() 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)); $this->profile->nickname, $this->peopletag->tag));
} }
@ -276,7 +274,6 @@ class TagButton extends Form
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
UntagButton::formData(); UntagButton::formData();
@ -287,10 +284,10 @@ class TagButton extends Form
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', _('Add')); // TRANS: Button text to tag a profile.
$this->out->submit('submit', _m('BUTTON','Add'));
} }
} }

View File

@ -44,13 +44,11 @@ require_once INSTALLDIR.'/lib/form.php';
* *
* @see UnunsubscribeForm * @see UnunsubscribeForm
*/ */
class UnsubscribePeopletagForm extends Form class UnsubscribePeopletagForm extends Form
{ {
/** /**
* peopletag for the user to join * peopletag for the user to join
*/ */
var $peopletag = null; var $peopletag = null;
/** /**
@ -59,7 +57,6 @@ class UnsubscribePeopletagForm extends Form
* @param HTMLOutputter $out output channel * @param HTMLOutputter $out output channel
* @param peopletag $peopletag peopletag to unsubscribe to * @param peopletag $peopletag peopletag to unsubscribe to
*/ */
function __construct($out=null, $peopletag=null) function __construct($out=null, $peopletag=null)
{ {
parent::__construct($out); parent::__construct($out);
@ -72,7 +69,6 @@ class UnsubscribePeopletagForm extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'peopletag-unsubscribe-' . $this->peopletag->id; return 'peopletag-unsubscribe-' . $this->peopletag->id;
@ -83,7 +79,6 @@ class UnsubscribePeopletagForm extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_peopletag_unsubscribe'; return 'form_peopletag_unsubscribe';
@ -94,7 +89,6 @@ class UnsubscribePeopletagForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return common_local_url('unsubscribepeopletag', return common_local_url('unsubscribepeopletag',
@ -106,9 +100,9 @@ class UnsubscribePeopletagForm extends Form
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', _('Unsubscribe')); // TRANS: Button text for unsubscribing from a people tag.
$this->out->submit('submit', _m('BUTTON','Unsubscribe'));
} }
} }