Update translator documentation.

i18n/L10n updates.
Superfluous whitespace removed.
Add FIXME in files with missing documentation.
This commit is contained in:
Siebrand Mazeland 2011-03-24 09:59:01 +01:00
parent 483922f1c4
commit 3be26565fb
15 changed files with 62 additions and 39 deletions

View File

@ -98,6 +98,7 @@ class ApprovegroupAction extends Action
$cur = common_current_user(); $cur = common_current_user();
if (empty($cur)) { if (empty($cur)) {
// TRANS: Client error displayed trying to approve group membership while not logged in.
$this->clientError(_('Must be logged in.'), 403); $this->clientError(_('Must be logged in.'), 403);
return false; return false;
} }
@ -105,10 +106,12 @@ class ApprovegroupAction extends Action
if ($cur->isAdmin($this->group)) { if ($cur->isAdmin($this->group)) {
$this->profile = Profile::staticGet('id', $this->arg('profile_id')); $this->profile = Profile::staticGet('id', $this->arg('profile_id'));
} else { } 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); $this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
return false; return false;
} }
} else { } else {
// TRANS: Client error displayed trying to approve group membership without specifying a profile to approve.
$this->clientError(_('Must specify a profile.')); $this->clientError(_('Must specify a profile.'));
return false; return false;
} }
@ -117,15 +120,18 @@ class ApprovegroupAction extends Action
'group_id' => $this->group->id)); 'group_id' => $this->group->id));
if (empty($this->request)) { 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->clientError(sprintf(_('%s is not in the moderation queue for this group.'), $this->profile->nickname), 403);
} }
$this->approve = (bool)$this->arg('approve'); $this->approve = (bool)$this->arg('approve');
$this->cancel = (bool)$this->arg('cancel'); $this->cancel = (bool)$this->arg('cancel');
if (!$this->approve && !$this->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.')); $this->clientError(_('Internal error: received neither cancel nor abort.'));
} }
if ($this->approve && $this->cancel) { if ($this->approve && $this->cancel) {
// TRANS: Client error displayed trying to approve/deny group membership.
$this->clientError(_('Internal error: received both cancel and abort.')); $this->clientError(_('Internal error: received both cancel and abort.'));
} }
return true; return true;

View File

@ -68,7 +68,6 @@ class CancelgroupAction extends Action
$nickname = common_canonical_nickname($nickname_arg); $nickname = common_canonical_nickname($nickname_arg);
// Permanent redirect on non-canonical nickname // Permanent redirect on non-canonical nickname
if ($nickname_arg != $nickname) { if ($nickname_arg != $nickname) {
$args = array('nickname' => $nickname); $args = array('nickname' => $nickname);
common_redirect(common_local_url('leavegroup', $args), 301); common_redirect(common_local_url('leavegroup', $args), 301);
@ -98,6 +97,7 @@ class CancelgroupAction extends Action
$cur = common_current_user(); $cur = common_current_user();
if (empty($cur)) { if (empty($cur)) {
// TRANS: Client error displayed when trying to leave a group while not logged in.
$this->clientError(_('Must be logged in.'), 403); $this->clientError(_('Must be logged in.'), 403);
return false; return false;
} }
@ -105,6 +105,8 @@ class CancelgroupAction extends Action
if ($cur->isAdmin($this->group)) { if ($cur->isAdmin($this->group)) {
$this->profile = Profile::staticGet('id', $this->arg('profile_id')); $this->profile = Profile::staticGet('id', $this->arg('profile_id'));
} else { } 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); $this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
return false; return false;
} }
@ -116,6 +118,8 @@ class CancelgroupAction extends Action
'group_id' => $this->group->id)); 'group_id' => $this->group->id));
if (empty($this->request)) { 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); $this->clientError(sprintf(_('%s is not in the moderation queue for this group.'), $this->profile->nickname), 403);
} }
return true; return true;
@ -149,6 +153,7 @@ class CancelgroupAction extends Action
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $this->elementStart('head');
// TRANS: Title for leave group page after leaving. // 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->element('title', null, sprintf(_m('TITLE','%1$s left group %2$s'),
$this->profile->nickname, $this->profile->nickname,
$this->group->nickname)); $this->group->nickname));

View File

@ -52,7 +52,7 @@ class GroupqueueAction extends GroupDesignAction
return true; 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) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -96,6 +96,7 @@ class GroupqueueAction extends GroupDesignAction
$cur = common_current_user(); $cur = common_current_user();
if (!$cur || !$cur->isAdmin($this->group)) { 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.')); $this->clientError(_('Only the group admin may approve users.'));
return false; return false;
} }
@ -105,12 +106,12 @@ class GroupqueueAction extends GroupDesignAction
function title() function title()
{ {
if ($this->page == 1) { 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. // TRANS: %s is the name of the group.
return sprintf(_('%s group members awaiting approval'), return sprintf(_('%s group members awaiting approval'),
$this->group->nickname); $this->group->nickname);
} else { } 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. // 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'), return sprintf(_('%1$s group members awaiting approval, page %2$d'),
$this->group->nickname, $this->group->nickname,

View File

@ -154,7 +154,8 @@ class JoingroupAction extends Action
$form = new CancelGroupForm($this, $this->group); $form = new CancelGroupForm($this, $this->group);
} else { } else {
// wtf? // 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(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');

View File

@ -403,7 +403,8 @@ class Profile extends Memcached_DataObject
Event::handle('EndJoinGroup', array($group, $this)); Event::handle('EndJoinGroup', array($group, $this));
} }
} else { } 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) { if ($join) {
$join->notify(); $join->notify();
@ -414,7 +415,7 @@ class Profile extends Memcached_DataObject
/** /**
* Leave a group that this profile is a member of. * Leave a group that this profile is a member of.
* *
* @param User_group $group * @param User_group $group
*/ */
function leaveGroup(User_group $group) function leaveGroup(User_group $group)
{ {

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/form.php';
* *
* @see UnsubscribeForm * @see UnsubscribeForm
*/ */
class ApproveGroupForm extends Form class ApproveGroupForm extends Form
{ {
/** /**
@ -62,7 +61,6 @@ class ApproveGroupForm extends Form
* @param HTMLOutputter $out output channel * @param HTMLOutputter $out output channel
* @param group $group group to leave * @param group $group group to leave
*/ */
function __construct($out=null, $group=null, $profile=null) function __construct($out=null, $group=null, $profile=null)
{ {
parent::__construct($out); parent::__construct($out);
@ -76,7 +74,6 @@ class ApproveGroupForm extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'group-queue-' . $this->group->id; return 'group-queue-' . $this->group->id;
@ -87,7 +84,6 @@ class ApproveGroupForm extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_group_queue ajax'; return 'form_group_queue ajax';
@ -98,7 +94,6 @@ class ApproveGroupForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
$params = array(); $params = array();
@ -117,7 +112,9 @@ class ApproveGroupForm extends Form
function formActions() function formActions()
{ {
$this->out->submit('approve', _('Accept')); // TRANS: Submit button text to accept a group membership request on approve group form.
$this->out->submit('cancel', _('Reject')); $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'));
} }
} }

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/form.php';
* *
* @see UnsubscribeForm * @see UnsubscribeForm
*/ */
class CancelGroupForm extends Form class CancelGroupForm extends Form
{ {
/** /**
@ -62,7 +61,6 @@ class CancelGroupForm extends Form
* @param HTMLOutputter $out output channel * @param HTMLOutputter $out output channel
* @param group $group group to leave * @param group $group group to leave
*/ */
function __construct($out=null, $group=null, $profile=null) function __construct($out=null, $group=null, $profile=null)
{ {
parent::__construct($out); parent::__construct($out);
@ -76,7 +74,6 @@ class CancelGroupForm extends Form
* *
* @return string ID of the form * @return string ID of the form
*/ */
function id() function id()
{ {
return 'group-cancel-' . $this->group->id; return 'group-cancel-' . $this->group->id;
@ -87,7 +84,6 @@ class CancelGroupForm extends Form
* *
* @return string of the form class * @return string of the form class
*/ */
function formClass() function formClass()
{ {
return 'form_group_leave ajax'; return 'form_group_leave ajax';
@ -98,7 +94,6 @@ class CancelGroupForm extends Form
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
$params = array(); $params = array();
@ -114,9 +109,9 @@ class CancelGroupForm extends Form
* *
* @return void * @return void
*/ */
function formActions() 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'));
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
// @todo FIXME: standard file header missing.
/** /**
* Form for blocking a user from a group * Form for blocking a user from a group
* *

View File

@ -112,6 +112,7 @@ class GroupEditForm extends Form
*/ */
function formLegend() function formLegend()
{ {
// TRANS: Form legend for group edit form.
$this->out->element('legend', null, _('Create a new group')); $this->out->element('legend', null, _('Create a new group'));
} }
@ -142,44 +143,58 @@ class GroupEditForm extends Form
if (Event::handle('StartGroupEditFormData', array($this))) { if (Event::handle('StartGroupEditFormData', array($this))) {
$this->out->elementStart('li'); $this->out->elementStart('li');
$this->out->hidden('groupid', $id); $this->out->hidden('groupid', $id);
// TRANS: Field label on group edit form.
$this->out->input('nickname', _('Nickname'), $this->out->input('nickname', _('Nickname'),
($this->out->arg('nickname')) ? $this->out->arg('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->elementEnd('li');
$this->out->elementStart('li'); $this->out->elementStart('li');
// TRANS: Field label on group edit form.
$this->out->input('fullname', _('Full name'), $this->out->input('fullname', _('Full name'),
($this->out->arg('fullname')) ? $this->out->arg('fullname') : $fullname); ($this->out->arg('fullname')) ? $this->out->arg('fullname') : $fullname);
$this->out->elementEnd('li'); $this->out->elementEnd('li');
$this->out->elementStart('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->input('homepage', _('Homepage'),
($this->out->arg('homepage')) ? $this->out->arg('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.')); _('URL of the homepage or blog of the group or topic.'));
$this->out->elementEnd('li'); $this->out->elementEnd('li');
$this->out->elementStart('li'); $this->out->elementStart('li');
$desclimit = User_group::maxDescription(); $desclimit = User_group::maxDescription();
if ($desclimit == 0) { 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 { } else {
$descinstr = sprintf(_m('Describe the group or topic in %d character or less', // TRANS: Text area title for group description.
'Describe the group or topic in %d characters or less', // 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),
$desclimit); $desclimit);
} }
// TRANS: Text area label on group edit form; contains description of group.
$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);
$this->out->elementEnd('li'); $this->out->elementEnd('li');
$this->out->elementStart('li'); $this->out->elementStart('li');
// TRANS: Field label on group edit form.
$this->out->input('location', _('Location'), $this->out->input('location', _('Location'),
($this->out->arg('location')) ? $this->out->arg('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".')); _('Location for the group, if any, like "City, State (or Region), Country".'));
$this->out->elementEnd('li'); $this->out->elementEnd('li');
if (common_config('group', 'maxaliases') > 0) { if (common_config('group', 'maxaliases') > 0) {
$aliases = (empty($this->group)) ? array() : $this->group->getAliases(); $aliases = (empty($this->group)) ? array() : $this->group->getAliases();
$this->out->elementStart('li'); $this->out->elementStart('li');
// TRANS: Field label on group edit form.
$this->out->input('aliases', _('Aliases'), $this->out->input('aliases', _('Aliases'),
($this->out->arg('aliases')) ? $this->out->arg('aliases') : ($this->out->arg('aliases')) ? $this->out->arg('aliases') :
(!empty($aliases)) ? implode(' ', $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.', 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.', 'Extra nicknames for the group, separated with commas or spaces. Maximum %d aliases allowed.',
common_config('group', 'maxaliases')), common_config('group', 'maxaliases')),
@ -188,9 +203,11 @@ class GroupEditForm extends Form
} }
$this->out->elementStart('li'); $this->out->elementStart('li');
$this->out->dropdown('join_policy', $this->out->dropdown('join_policy',
// TRANS: Dropdown fieldd label on group edit form.
_('Membership policy'), _('Membership policy'),
array(User_group::JOIN_POLICY_OPEN => _('Open to all'), array(User_group::JOIN_POLICY_OPEN => _('Open to all'),
User_group::JOIN_POLICY_MODERATE => _('Admin must approve all members')), 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.'), _('Whether admin approval is required to join this group.'),
false, false,
(empty($this->group->join_policy)) ? User_group::JOIN_POLICY_OPEN : $this->group->join_policy); (empty($this->group->join_policy)) ? User_group::JOIN_POLICY_OPEN : $this->group->join_policy);
@ -207,6 +224,7 @@ class GroupEditForm extends Form
*/ */
function formActions() function formActions()
{ {
// TRANS: Text for save button on group edit form.
$this->out->submit('submit', _m('BUTTON','Save')); $this->out->submit('submit', _m('BUTTON','Save'));
} }
} }

View File

@ -1,4 +1,5 @@
<?php <?php
// @todo FIXME: add documentation.
class GroupMemberList extends ProfileList class GroupMemberList extends ProfileList
{ {

View File

@ -1,4 +1,5 @@
<?php <?php
// @todo FIXME: add documentation.
class GroupMemberListItem extends ProfileListItem class GroupMemberListItem extends ProfileListItem
{ {
@ -17,7 +18,7 @@ class GroupMemberListItem extends ProfileListItem
if ($this->profile->isAdmin($this->group)) { if ($this->profile->isAdmin($this->group)) {
$this->out->text(' '); // for separating the classes. $this->out->text(' '); // for separating the classes.
// TRANS: Indicator in group members list that this user is a group administrator. // 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'));
} }
} }
@ -102,4 +103,3 @@ class GroupMemberListItem extends ProfileListItem
return $args; return $args;
} }
} }

View File

@ -48,7 +48,6 @@ require_once INSTALLDIR.'/lib/widget.php';
* *
* @see HTMLOutputter * @see HTMLOutputter
*/ */
class GroupNav extends Menu class GroupNav extends Menu
{ {
var $group = null; var $group = null;
@ -58,7 +57,6 @@ class GroupNav extends Menu
* *
* @param Action $action current action, used for output * @param Action $action current action, used for output
*/ */
function __construct($action=null, $group=null) function __construct($action=null, $group=null)
{ {
parent::__construct($action); parent::__construct($action);
@ -70,7 +68,6 @@ class GroupNav extends Menu
* *
* @return void * @return void
*/ */
function show() function show()
{ {
$action_name = $this->action->trimmed('action'); $action_name = $this->action->trimmed('action');
@ -105,7 +102,8 @@ class GroupNav extends Menu
$this->out->menuItem(common_local_url('groupqueue', array('nickname' => $this->out->menuItem(common_local_url('groupqueue', array('nickname' =>
$nickname)), $nickname)),
// TRANS: Menu item in the group navigation page. Only shown for group administrators. // 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: Tooltip for menu item in the group navigation page. Only shown for group administrators.
// TRANS: %s is the nickname of the group. // TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','%s pending members'), $nickname), sprintf(_m('TOOLTIP','%s pending members'), $nickname),

View File

@ -277,7 +277,7 @@ function mail_footer_block()
* Format a block of profile info for a plaintext notification email. * Format a block of profile info for a plaintext notification email.
* *
* @param Profile $profile * @param Profile $profile
* @return string * @return string
*/ */
function mail_profile_block($profile) function mail_profile_block($profile)
{ {
@ -313,9 +313,9 @@ function mail_profile_block($profile)
// TRANS: This is a paragraph in a new-subscriber e-mail. // TRANS: This is a paragraph in a new-subscriber e-mail.
// TRANS: %s is a URL where the subscriber can be reported as abusive. // TRANS: %s is a URL where the subscriber can be reported as abusive.
$out[] = sprintf(_("If you believe this account is being used abusively, " . $out[] = sprintf(_('If you believe this account is being used abusively, ' .
"you can block them from your subscribers list and " . 'you can block them from your subscribers list and ' .
"report as spam to site administrators at %s"), 'report as spam to site administrators at %s.'),
$blocklink); $blocklink);
$out[] = ""; $out[] = "";
@ -498,7 +498,7 @@ function mail_confirm_sms($code, $nickname, $address)
// TRANS: Main body heading for SMS-by-email address confirmation message. // TRANS: Main body heading for SMS-by-email address confirmation message.
// TRANS: %s is the addressed user's nickname. // 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 .= "\n\n";
$body .= $code; $body .= $code;
$body .= "\n\n"; $body .= "\n\n";

View File

@ -1,4 +1,5 @@
<?php <?php
// @todo FIXME: add standard file header.
/** /**
* Form for making a user an admin for a group * Form for making a user an admin for a group

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc. * Copyright (C) 2011, StatusNet, Inc.
* *
* A stream of notices * A stream of notices
* *
* 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
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class NoticeStream class NoticeStream
{ {
const CACHE_WINDOW = 200; const CACHE_WINDOW = 200;