i18n/L10n updates.
Superfluous whitespace removed.
Add FIXME in files with missing documentation.
$cur = common_current_user();
if (empty($cur)) {
+ // TRANS: Client error displayed trying to approve group membership while not logged in.
$this->clientError(_('Must be logged in.'), 403);
return false;
}
if ($cur->isAdmin($this->group)) {
$this->profile = Profile::staticGet('id', $this->arg('profile_id'));
} else {
+ // TRANS: Client error displayed trying to approve group membership while not a group administrator.
$this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
return false;
}
} else {
+ // TRANS: Client error displayed trying to approve group membership without specifying a profile to approve.
$this->clientError(_('Must specify a profile.'));
return false;
}
'group_id' => $this->group->id));
if (empty($this->request)) {
+ // TRANS: Client error displayed trying to approve group membership for a non-existing request.
$this->clientError(sprintf(_('%s is not in the moderation queue for this group.'), $this->profile->nickname), 403);
}
$this->approve = (bool)$this->arg('approve');
$this->cancel = (bool)$this->arg('cancel');
if (!$this->approve && !$this->cancel) {
+ // TRANS: Client error displayed trying to approve/deny group membership.
$this->clientError(_('Internal error: received neither cancel nor abort.'));
}
if ($this->approve && $this->cancel) {
+ // TRANS: Client error displayed trying to approve/deny group membership.
$this->clientError(_('Internal error: received both cancel and abort.'));
}
return true;
$nickname = common_canonical_nickname($nickname_arg);
// Permanent redirect on non-canonical nickname
-
if ($nickname_arg != $nickname) {
$args = array('nickname' => $nickname);
common_redirect(common_local_url('leavegroup', $args), 301);
$cur = common_current_user();
if (empty($cur)) {
+ // TRANS: Client error displayed when trying to leave a group while not logged in.
$this->clientError(_('Must be logged in.'), 403);
return false;
}
if ($cur->isAdmin($this->group)) {
$this->profile = Profile::staticGet('id', $this->arg('profile_id'));
} else {
+ // TRANS: Client error displayed when trying to approve or cancel a group join request without
+ // TRANS: being a group administrator.
$this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
return false;
}
'group_id' => $this->group->id));
if (empty($this->request)) {
+ // TRANS: Client error displayed when trying to approve a non-existing group join request.
+ // TRANS: %s is a user nickname.
$this->clientError(sprintf(_('%s is not in the moderation queue for this group.'), $this->profile->nickname), 403);
}
return true;
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Title for leave group page after leaving.
+ // TRANS: %s$s is the leaving user's name, %2$s is the group name.
$this->element('title', null, sprintf(_m('TITLE','%1$s left group %2$s'),
$this->profile->nickname,
$this->group->nickname));
return true;
}
- // fixme most of this belongs in a base class, sounds common to most group actions?
+ // @todo FIXME: most of this belongs in a base class, sounds common to most group actions?
function prepare($args)
{
parent::prepare($args);
$cur = common_current_user();
if (!$cur || !$cur->isAdmin($this->group)) {
+ // TRANS: Client error displayed when trying to approve group applicants without being a group administrator.
$this->clientError(_('Only the group admin may approve users.'));
return false;
}
function title()
{
if ($this->page == 1) {
- // TRANS: Title of the page showing pending group members still awaiting approval to join the group.
+ // TRANS: Title of the first page showing pending group members still awaiting approval to join the group.
// TRANS: %s is the name of the group.
return sprintf(_('%s group members awaiting approval'),
$this->group->nickname);
} else {
- // TRANS: Title of the page showing pending group members still awaiting approval to join the group.
+ // TRANS: Title of all but the first page showing pending group members still awaiting approval to join the group.
// TRANS: %1$s is the name of the group, %2$d is the page number of the members list.
return sprintf(_('%1$s group members awaiting approval, page %2$d'),
$this->group->nickname,
$form = new CancelGroupForm($this, $this->group);
} else {
// wtf?
- throw new Exception(_m("Unknown error joining group."));
+ // TRANS: Exception thrown when there is an unknown error joining a group.
+ throw new Exception(_("Unknown error joining group."));
}
$form->show();
$this->elementEnd('body');
Event::handle('EndJoinGroup', array($group, $this));
}
} else {
- throw new Exception(_m('Invalid group join approval: not pending.'));
+ // TRANS: Exception thrown trying to approve a non-existing group join request.
+ throw new Exception(_('Invalid group join approval: not pending.'));
}
if ($join) {
$join->notify();
/**
* Leave a group that this profile is a member of.
*
- * @param User_group $group
+ * @param User_group $group
*/
function leaveGroup(User_group $group)
{
*
* @see UnsubscribeForm
*/
-
class ApproveGroupForm extends Form
{
/**
* @param HTMLOutputter $out output channel
* @param group $group group to leave
*/
-
function __construct($out=null, $group=null, $profile=null)
{
parent::__construct($out);
*
* @return string ID of the form
*/
-
function id()
{
return 'group-queue-' . $this->group->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_group_queue ajax';
*
* @return string URL of the action
*/
-
function action()
{
$params = array();
function formActions()
{
- $this->out->submit('approve', _('Accept'));
- $this->out->submit('cancel', _('Reject'));
+ // TRANS: Submit button text to accept a group membership request on approve group form.
+ $this->out->submit('approve', _m('BUTTON','Accept'));
+ // TRANS: Submit button text to reject a group membership request on approve group form.
+ $this->out->submit('cancel', _m('BUTTON','Reject'));
}
}
*
* @see UnsubscribeForm
*/
-
class CancelGroupForm extends Form
{
/**
* @param HTMLOutputter $out output channel
* @param group $group group to leave
*/
-
function __construct($out=null, $group=null, $profile=null)
{
parent::__construct($out);
*
* @return string ID of the form
*/
-
function id()
{
return 'group-cancel-' . $this->group->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_group_leave ajax';
*
* @return string URL of the action
*/
-
function action()
{
$params = array();
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Cancel join request'));
+ // TRANS: Submit button text on form to cancel group join request.
+ $this->out->submit('submit', _('BUTTON','Cancel join request'));
}
}
<?php
-
+// @todo FIXME: standard file header missing.
/**
* Form for blocking a user from a group
*
*/
function formLegend()
{
+ // TRANS: Form legend for group edit form.
$this->out->element('legend', null, _('Create a new group'));
}
if (Event::handle('StartGroupEditFormData', array($this))) {
$this->out->elementStart('li');
$this->out->hidden('groupid', $id);
+ // TRANS: Field label on group edit form.
$this->out->input('nickname', _('Nickname'),
($this->out->arg('nickname')) ? $this->out->arg('nickname') : $nickname,
- _('1-64 lowercase letters or numbers, no punctuation or spaces'));
+ // TRANS: Field title on group edit form.
+ _('1-64 lowercase letters or numbers, no punctuation or spaces.'));
$this->out->elementEnd('li');
$this->out->elementStart('li');
+ // TRANS: Field label on group edit form.
$this->out->input('fullname', _('Full name'),
($this->out->arg('fullname')) ? $this->out->arg('fullname') : $fullname);
$this->out->elementEnd('li');
$this->out->elementStart('li');
+ // TRANS: Field label on group edit form; points to "more info" for a group.
$this->out->input('homepage', _('Homepage'),
($this->out->arg('homepage')) ? $this->out->arg('homepage') : $homepage,
+ // TRANS: Field title on group edit form.
_('URL of the homepage or blog of the group or topic.'));
$this->out->elementEnd('li');
$this->out->elementStart('li');
$desclimit = User_group::maxDescription();
if ($desclimit == 0) {
- $descinstr = _('Describe the group or topic');
+ // TRANS: Text area title for group description when there is no text limit.
+ $descinstr = _('Describe the group or topic.');
} else {
- $descinstr = sprintf(_m('Describe the group or topic in %d character or less',
- 'Describe the group or topic in %d characters or less',
+ // TRANS: Text area title for group description.
+ // TRANS: %d is the number of characters available for the description.
+ $descinstr = sprintf(_m('Describe the group or topic in %d character or less.',
+ 'Describe the group or topic in %d characters or less.',
$desclimit),
$desclimit);
}
+ // TRANS: Text area label on group edit form; contains description of group.
$this->out->textarea('description', _('Description'),
($this->out->arg('description')) ? $this->out->arg('description') : $description,
$descinstr);
$this->out->elementEnd('li');
$this->out->elementStart('li');
+ // TRANS: Field label on group edit form.
$this->out->input('location', _('Location'),
($this->out->arg('location')) ? $this->out->arg('location') : $location,
+ // TRANS: Field title on group edit form.
_('Location for the group, if any, like "City, State (or Region), Country".'));
$this->out->elementEnd('li');
if (common_config('group', 'maxaliases') > 0) {
$aliases = (empty($this->group)) ? array() : $this->group->getAliases();
$this->out->elementStart('li');
+ // TRANS: Field label on group edit form.
$this->out->input('aliases', _('Aliases'),
($this->out->arg('aliases')) ? $this->out->arg('aliases') :
(!empty($aliases)) ? implode(' ', $aliases) : '',
+ // TRANS: Input field title for group aliases.
+ // TRANS: %d is the maximum number of group aliases available.
sprintf(_m('Extra nicknames for the group, separated with commas or spaces. Maximum %d alias allowed.',
'Extra nicknames for the group, separated with commas or spaces. Maximum %d aliases allowed.',
common_config('group', 'maxaliases')),
}
$this->out->elementStart('li');
$this->out->dropdown('join_policy',
+ // TRANS: Dropdown fieldd label on group edit form.
_('Membership policy'),
array(User_group::JOIN_POLICY_OPEN => _('Open to all'),
User_group::JOIN_POLICY_MODERATE => _('Admin must approve all members')),
+ // TRANS: Dropdown field title on group edit form.
_('Whether admin approval is required to join this group.'),
false,
(empty($this->group->join_policy)) ? User_group::JOIN_POLICY_OPEN : $this->group->join_policy);
*/
function formActions()
{
+ // TRANS: Text for save button on group edit form.
$this->out->submit('submit', _m('BUTTON','Save'));
}
}
<?php
+// @todo FIXME: add documentation.
class GroupMemberList extends ProfileList
{
<?php
+// @todo FIXME: add documentation.
class GroupMemberListItem extends ProfileListItem
{
if ($this->profile->isAdmin($this->group)) {
$this->out->text(' '); // for separating the classes.
// TRANS: Indicator in group members list that this user is a group administrator.
- $this->out->element('span', 'role', _('Admin'));
+ $this->out->element('span', 'role', _m('GROUPADMIN','Admin'));
}
}
return $args;
}
}
-
*
* @see HTMLOutputter
*/
-
class GroupNav extends Menu
{
var $group = null;
*
* @param Action $action current action, used for output
*/
-
function __construct($action=null, $group=null)
{
parent::__construct($action);
*
* @return void
*/
-
function show()
{
$action_name = $this->action->trimmed('action');
$this->out->menuItem(common_local_url('groupqueue', array('nickname' =>
$nickname)),
// TRANS: Menu item in the group navigation page. Only shown for group administrators.
- sprintf(_m('MENU','Pending members (%d)'), $pending),
+ // TRANS: %d is the number of pending members.
+ sprintf(_m('MENU','Pending members (%d)','Pending members (%d)',$pending), $pending),
// TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','%s pending members'), $nickname),
* Format a block of profile info for a plaintext notification email.
*
* @param Profile $profile
- * @return string
+ * @return string
*/
function mail_profile_block($profile)
{
// TRANS: This is a paragraph in a new-subscriber e-mail.
// TRANS: %s is a URL where the subscriber can be reported as abusive.
- $out[] = sprintf(_("If you believe this account is being used abusively, " .
- "you can block them from your subscribers list and " .
- "report as spam to site administrators at %s"),
+ $out[] = sprintf(_('If you believe this account is being used abusively, ' .
+ 'you can block them from your subscribers list and ' .
+ 'report as spam to site administrators at %s.'),
$blocklink);
$out[] = "";
// TRANS: Main body heading for SMS-by-email address confirmation message.
// TRANS: %s is the addressed user's nickname.
- $body = sprintf(_("%s: confirm you own this phone number with this code:"), $nickname);
+ $body = sprintf(_('%s: confirm you own this phone number with this code:'), $nickname);
$body .= "\n\n";
$body .= $code;
$body .= "\n\n";
<?php
+// @todo FIXME: add standard file header.
/**
* Form for making a user an admin for a group
* Copyright (C) 2011, StatusNet, Inc.
*
* A stream of notices
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class NoticeStream
{
const CACHE_WINDOW = 200;