Commit f0d762f1 authored by Siebrand Mazeland's avatar Siebrand Mazeland

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:e75c9988).
parent cad040ce
......@@ -34,9 +34,9 @@ if (!defined('STATUSNET')) {
require_once INSTALLDIR . '/lib/togglepeopletag.php';
/**
*
*
* Action to tag a profile with a single tag.
*
*
* Takes parameters:
*
* - tagged: the ID of the profile being tagged
......@@ -52,7 +52,6 @@ require_once INSTALLDIR . '/lib/togglepeopletag.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
class AddpeopletagAction extends Action
{
var $user;
......@@ -66,7 +65,6 @@ class AddpeopletagAction extends Action
*
* @return boolean success flag
*/
function prepare($args)
{
parent::prepare($args);
......@@ -76,6 +74,7 @@ class AddpeopletagAction extends Action
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token.'.
' Try again, please.'));
return false;
......@@ -86,6 +85,7 @@ class AddpeopletagAction extends Action
$this->user = common_current_user();
if (empty($this->user)) {
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
$this->clientError(_('Not logged in.'));
return false;
}
......@@ -97,6 +97,7 @@ class AddpeopletagAction extends Action
$this->tagged = Profile::staticGet('id', $tagged_id);
if (empty($this->tagged)) {
// TRANS: Client error displayed trying to perform an action related to a non-existing profile.
$this->clientError(_('No such profile.'));
return false;
}
......@@ -105,7 +106,8 @@ class AddpeopletagAction extends Action
$this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) {
$this->clientError(_('No such peopletag.'));
// TRANS: Client error displayed trying to reference a non-existing people tag.
$this->clientError(_('No such people tag.'));
return false;
}
......@@ -115,6 +117,7 @@ class AddpeopletagAction extends Action
$omb01 = Remote_profile::staticGet('id', $tagged_id);
if (!empty($omb01)) {
// TRANS: Client error displayed trying to tag an OMB 0.1 remote profile.
$this->clientError(_('You cannot tag an OMB 0.1'.
' remote profile with this action.'));
return false;
......@@ -132,10 +135,8 @@ class AddpeopletagAction extends Action
*
* @return void
*/
function handle($args)
{
// Throws exception on error
$ptag = Profile_tag::setTag($this->user->id, $this->tagged->id,
$this->peopletag->tag);
......@@ -144,9 +145,13 @@ class AddpeopletagAction extends Action
$user = User::staticGet('id', $id);
if ($user) {
$this->clientError(
sprintf(_('There was an unexpected error while tagging %s'),
// TRANS: Client error displayed when an unknown error occurs while tagging a user.
// TRANS: %s is a username.
sprintf(_('There was an unexpected error while tagging %s.'),
$user->nickname));
} else {
// TRANS: Client error displayed when an unknown error occurs while tagging a user.
// TRANS: %s is a profile URL.
$this->clientError(sprintf(_('There was a problem tagging %s.' .
'The remote server is probably not responding correctly, ' .
'please try retrying later.'), $this->profile->profileurl));
......@@ -156,6 +161,7 @@ class AddpeopletagAction extends Action
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Title after subscribing to a people tag.
$this->element('title', null, _('Subscribed'));
$this->elementEnd('head');
$this->elementStart('body');
......
......@@ -37,19 +37,16 @@ class ApiListAction extends ApiBareAuthAction
/**
* The list in question in the current request
*/
var $list = null;
/**
* Is this an update request?
*/
var $update = false;
/**
* Is this a delete request?
*/
var $delete = false;
/**
......@@ -64,7 +61,6 @@ class ApiListAction extends ApiBareAuthAction
*
* @return boolean success flag
*/
function prepare($args)
{
parent::prepare($args);
......@@ -81,7 +77,8 @@ class ApiListAction extends ApiBareAuthAction
$this->list = $this->getTargetList($this->arg('user'), $this->arg('id'));
if (empty($this->list)) {
$this->clientError(_('Not found'), 404, $this->format);
// TRANS: Client error displayed when referring to a non-existing list.
$this->clientError(_('List not found.'), 404, $this->format);
return false;
}
......@@ -93,7 +90,6 @@ class ApiListAction extends ApiBareAuthAction
*
* @return boolean success flag
*/
function handle($args)
{
parent::handle($args);
......@@ -117,6 +113,7 @@ class ApiListAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -129,7 +126,6 @@ class ApiListAction extends ApiBareAuthAction
* require authentication if it is a write action or user is ambiguous
*
*/
function requiresAuth()
{
return parent::requiresAuth() ||
......@@ -141,12 +137,12 @@ class ApiListAction extends ApiBareAuthAction
*
* @return boolean success
*/
function handlePut()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
_('You can not update lists that don\'t belong to you.'),
// TRANS: Client error displayed when trying to update another user's list.
_('You cannot update lists that do not belong to you.'),
401,
$this->format
);
......@@ -161,6 +157,7 @@ class ApiListAction extends ApiBareAuthAction
if(!$result) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs updating a list.
_('An error occured.'),
503,
$this->format
......@@ -176,6 +173,7 @@ class ApiListAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -189,12 +187,12 @@ class ApiListAction extends ApiBareAuthAction
*
* @return boolean success
*/
function handleDelete()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
_('You can not delete lists that don\'t belong to you.'),
// TRANS: Client error displayed when trying to delete another user's list.
_('You cannot delete lists that do not belong to you.'),
401,
$this->format
);
......@@ -212,6 +210,7 @@ class ApiListAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -225,7 +224,6 @@ class ApiListAction extends ApiBareAuthAction
*
* @return boolean is_read-only=false
*/
function isReadOnly($args)
{
return false;
......@@ -236,7 +234,6 @@ class ApiListAction extends ApiBareAuthAction
*
* @return String time_last_modified
*/
function lastModified()
{
if(!empty($this->list)) {
......@@ -253,7 +250,6 @@ class ApiListAction extends ApiBareAuthAction
*
* @return string etag
*/
function etag()
{
if (!empty($this->list)) {
......@@ -271,5 +267,4 @@ class ApiListAction extends ApiBareAuthAction
return null;
}
}
......@@ -42,7 +42,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
* @link http://status.net/
* @see ApiBareAuthAction
*/
class ApiListMemberAction extends ApiBareAuthAction
{
/**
......@@ -59,7 +58,6 @@ class ApiListMemberAction extends ApiBareAuthAction
*
* @return boolean success flag
*/
function prepare($args)
{
parent::prepare($args);
......@@ -68,12 +66,14 @@ class ApiListMemberAction extends ApiBareAuthAction
$this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id'));
if (empty($this->list)) {
$this->clientError(_('Not found'), 404, $this->format);
// TRANS: Client error displayed when referring to a non-existing list.
$this->clientError(_('List not found.'), 404, $this->format);
return false;
}
if (empty($this->user)) {
$this->clientError(_('No such user'), 404, $this->format);
// TRANS: Client error displayed when referring to a non-existing user.
$this->clientError(_('No such user.'), 404, $this->format);
return false;
}
return true;
......@@ -84,7 +84,6 @@ class ApiListMemberAction extends ApiBareAuthAction
*
* @return boolean success flag
*/
function handle($args)
{
parent::handle($args);
......@@ -96,7 +95,8 @@ class ApiListMemberAction extends ApiBareAuthAction
if(empty($ptag)) {
$this->clientError(
_('The specified user is not a member of this list'),
// TRANS: Client error displayed when referring to a non-list member.
_('The specified user is not a member of this list.'),
400,
$this->format
);
......@@ -113,6 +113,7 @@ class ApiListMemberAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......
......@@ -39,12 +39,12 @@ class ApiListMembersAction extends ApiListUsersAction
*
* @return boolean success
*/
function handlePost()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
_('You aren\'t allowed to add members to this list'),
// TRANS: Client error displayed when trying to add members to a list without having the right to do so.
_('You are not allowed to add members to this list.'),
401,
$this->format
);
......@@ -53,7 +53,8 @@ class ApiListMembersAction extends ApiListUsersAction
if($this->user === false) {
$this->clientError(
_('You must specify a member'),
// TRANS: Client error displayed when trying to modify list members without specifying them.
_('You must specify a member.'),
400,
$this->format
);
......@@ -65,6 +66,7 @@ class ApiListMembersAction extends ApiListUsersAction
if(empty($result)) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs viewing list members.
_('An error occured.'),
500,
$this->format
......@@ -81,6 +83,7 @@ class ApiListMembersAction extends ApiListUsersAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -95,12 +98,12 @@ class ApiListMembersAction extends ApiListUsersAction
*
* @return boolean success
*/
function handleDelete()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
_('You aren\'t allowed to remove members from this list'),
// TRANS: Client error displayed when trying to remove members from a list without having the right to do so.
_('You are not allowed to remove members from this list.'),
401,
$this->format
);
......@@ -109,7 +112,8 @@ class ApiListMembersAction extends ApiListUsersAction
if($this->user === false) {
$this->clientError(
_('You must specify a member'),
// TRANS: Client error displayed when trying to modify list members without specifying them.
_('You must specify a member.'),
400,
$this->format
);
......@@ -123,7 +127,8 @@ class ApiListMembersAction extends ApiListUsersAction
if(empty($ptag)) {
$this->clientError(
_('The user you are trying to remove from the list is not a member'),
// TRANS: Client error displayed when trying to remove a list member that is not part of a list.
_('The user you are trying to remove from the list is not a member.'),
400,
$this->format
);
......@@ -134,6 +139,7 @@ class ApiListMembersAction extends ApiListUsersAction
if(empty($result)) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs viewing list members.
_('An error occured.'),
500,
$this->format
......@@ -150,6 +156,7 @@ class ApiListMembersAction extends ApiListUsersAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -163,7 +170,6 @@ class ApiListMembersAction extends ApiListUsersAction
/**
* List the members of a list (people tagged)
*/
function getUsers()
{
$fn = array($this->list, 'getTagged');
......
......@@ -43,7 +43,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
* @link http://status.net/
* @see ApiBareAuthAction
*/
class ApiListMembershipsAction extends ApiBareAuthAction
{
var $lists = array();
......@@ -60,7 +59,6 @@ class ApiListMembershipsAction extends ApiBareAuthAction
* @return boolean success flag
*
*/
function prepare($args)
{
parent::prepare($args);
......@@ -69,6 +67,7 @@ class ApiListMembershipsAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('user'));
if (empty($this->user)) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......@@ -87,7 +86,6 @@ class ApiListMembershipsAction extends ApiBareAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -101,6 +99,7 @@ class ApiListMembershipsAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
400,
$this->format
......@@ -118,7 +117,6 @@ class ApiListMembershipsAction extends ApiBareAuthAction
*
* @return boolean is read only action?
*/
function isReadOnly($args)
{
return true;
......
......@@ -42,7 +42,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
* @link http://status.net/
* @see ApiBareAuthAction
*/
class ApiListsAction extends ApiBareAuthAction
{
var $lists = null;
......@@ -64,7 +63,6 @@ class ApiListsAction extends ApiBareAuthAction
*
* @return boolean success flag
*/
function prepare($args)
{
parent::prepare($args);
......@@ -76,6 +74,7 @@ class ApiListsAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('user'));
if (empty($this->user)) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404, $this->format);
return false;
}
......@@ -89,7 +88,6 @@ class ApiListsAction extends ApiBareAuthAction
* require authentication if it is a write action or user is ambiguous
*
*/
function 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
* Create a new list by diferring to handlePost() if it is POST.
*/
function handle($args)
{
parent::handle($args);
......@@ -119,6 +116,7 @@ class ApiListsAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -132,13 +130,13 @@ class ApiListsAction extends ApiBareAuthAction
*
* @return boolean success
*/
function handlePost()
{
$name=$this->arg('name');
if(empty($name)) {
// mimick twitter
print _("A list's name can't be blank.");
// TRANS: Client error displayed when trying to create a list without a name.
print _("A list must have a name.");
exit(1);
}
......@@ -170,6 +168,7 @@ class ApiListsAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -182,7 +181,6 @@ class ApiListsAction extends ApiBareAuthAction
/**
* Get lists
*/
function getLists()
{
$cursor = (int) $this->arg('cursor', -1);
......@@ -220,7 +218,6 @@ class ApiListsAction extends ApiBareAuthAction
*
* @return string etag
*/
function etag()
{
if (!$this->create && !empty($this->lists) && (count($this->lists) > 0)) {
......@@ -240,5 +237,4 @@ class ApiListsAction extends ApiBareAuthAction
return null;
}
}
......@@ -43,12 +43,14 @@ class ApiListSubscriberAction extends ApiBareAuthAction
$this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id'));
if (empty($this->list)) {
$this->clientError(_('Not found'), 404, $this->format);
// TRANS: Client error displayed trying to perform an action related to a non-existing list.
$this->clientError(_('List not found.'), 404, $this->format);
return false;
}
if (empty($this->user)) {
$this->clientError(_('No such user'), 404, $this->format);
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404, $this->format);
return false;
}
return true;
......@@ -64,7 +66,8 @@ class ApiListSubscriberAction extends ApiBareAuthAction
if(empty($sub)) {
$this->clientError(
_('The specified user is not a subscriber of this list'),
// TRANS: Client error displayed when a membership check for a user is nagative.
_('The specified user is not a subscriber of this list.'),
400,
$this->format
);
......@@ -81,6 +84,7 @@ class ApiListSubscriberAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......
......@@ -38,7 +38,6 @@ class ApiListSubscribersAction extends ApiListUsersAction
*
* @return boolean success
*/
function handlePost()
{
$result = Profile_tag_subscription::add($this->list,
......@@ -46,6 +45,7 @@ class ApiListSubscribersAction extends ApiListUsersAction
if(empty($result)) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs in the list subscribers action.
_('An error occured.'),
500,
$this->format
......@@ -62,6 +62,7 @@ class ApiListSubscribersAction extends ApiListUsersAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -79,7 +80,8 @@ class ApiListSubscribersAction extends ApiListUsersAction
if(empty($ptag)) {
$this->clientError(
_('You are not subscribed to this list'),
// TRANS: Client error displayed when trying to unsubscribe from a non-subscribed list.
_('You are not subscribed to this list.'),
400,
$this->format
);
......@@ -90,6 +92,7 @@ class ApiListSubscribersAction extends ApiListUsersAction
if(empty($result)) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs unsubscribing from a list.
_('An error occured.'),
500,
$this->format
......@@ -106,6 +109,7 @@ class ApiListSubscribersAction extends ApiListUsersAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......
......@@ -48,7 +48,6 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
* @return boolean success flag
*
*/
function prepare($args)
{
parent::prepare($args);
......@@ -69,12 +68,12 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
if (empty($this->user)) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......@@ -88,6 +87,7 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
400,
$this->format
......@@ -105,7 +105,6 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
*
* @return boolean is read only action?
*/
function isReadOnly($args)
{
return true;
......
......@@ -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
* @link http://status.net/
*/
class ApiTimelineListAction extends ApiPrivateAuthAction
{
......@@ -68,7 +67,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
* @return boolean success flag
*
*/
function prepare($args)
{
parent::prepare($args);
......@@ -88,12 +86,12 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
if (empty($this->list)) {
// TRANS: Client error displayed trying to perform an action related to a non-existing list.
$this->clientError(_('List not found.'), 404, $this->format);
return false;
}
......@@ -107,7 +105,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
*
* @return void
*/
function showTimeline()
{
// We'll pull common formatting out of this for other formats
......@@ -145,7 +142,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
);
break;
case 'atom':
header('Content-Type: application/atom+xml; charset=utf-8');
try {
......@@ -154,9 +150,9 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
$atom->addEntryFromNotices($this->notices);
$this->raw($atom->getString());
} catch (Atom10FeedException $e) {
$this->serverError(
'Could not generate feed for list - ' . $e->getMessage()
);
// TRANS: Server error displayed whe trying to get a timeline fails.
// TRANS: %s is the error message.
$this->serverError( sprintf(_('Could not generate feed for list - %s'),$e->getMessage()));
return;
}
......@@ -182,6 +178,7 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
break;
default:
$this->clientError(
// TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
......@@ -195,7 +192,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
*
* @return array notices
*/
function getNotices()
{
$fn = array($this->list, 'getNotices');
......@@ -213,7 +209,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
*
* @return boolean true
*/
function isReadOnly($args)
{
return true;
......@@ -224,7 +219,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
*
* @return string datestamp of the latest notice in the stream
*/
function lastModified()
{
if (!empty($this->notices) && (count($this->notices) > 0)) {
......@@ -242,7 +236,6 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
*
* @return string etag
*/
function etag()
{
if (!empty($this->notices) && (count($this->notices) > 0)) {
......@@ -262,5 +255,4 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
return null;
}
}
......@@ -42,14 +42,17 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
class EditpeopletagAction extends OwnerDesignAction
{
var $msg, $confirm, $confirm_args=array();