From: Siebrand Mazeland Date: Thu, 24 Mar 2011 08:59:01 +0000 (+0100) Subject: Update translator documentation. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3be26565fb7af59342325d513e7e74c546091e3a;p=quix0rs-gnu-social.git Update translator documentation. i18n/L10n updates. Superfluous whitespace removed. Add FIXME in files with missing documentation. --- diff --git a/actions/approvegroup.php b/actions/approvegroup.php index c102c64cd5..690c76360f 100644 --- a/actions/approvegroup.php +++ b/actions/approvegroup.php @@ -98,6 +98,7 @@ class ApprovegroupAction extends Action $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; } @@ -105,10 +106,12 @@ class ApprovegroupAction extends Action 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; } @@ -117,15 +120,18 @@ class ApprovegroupAction extends Action '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; diff --git a/actions/cancelgroup.php b/actions/cancelgroup.php index 68d7f39139..57df1a10a7 100644 --- a/actions/cancelgroup.php +++ b/actions/cancelgroup.php @@ -68,7 +68,6 @@ class CancelgroupAction extends Action $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); @@ -98,6 +97,7 @@ class CancelgroupAction extends Action $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; } @@ -105,6 +105,8 @@ class CancelgroupAction extends Action 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; } @@ -116,6 +118,8 @@ class CancelgroupAction extends Action '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; @@ -149,6 +153,7 @@ class CancelgroupAction extends Action $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)); diff --git a/actions/groupqueue.php b/actions/groupqueue.php index 1b4a8b7b6e..dca0ff7bd5 100644 --- a/actions/groupqueue.php +++ b/actions/groupqueue.php @@ -52,7 +52,7 @@ class GroupqueueAction extends GroupDesignAction 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); @@ -96,6 +96,7 @@ class GroupqueueAction extends GroupDesignAction $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; } @@ -105,12 +106,12 @@ class GroupqueueAction extends GroupDesignAction 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, diff --git a/actions/joingroup.php b/actions/joingroup.php index f302b39e79..bb7b835915 100644 --- a/actions/joingroup.php +++ b/actions/joingroup.php @@ -154,7 +154,8 @@ class JoingroupAction extends Action $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'); diff --git a/classes/Profile.php b/classes/Profile.php index c5dd2dfda9..a36024842e 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -403,7 +403,8 @@ class Profile extends Memcached_DataObject 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(); @@ -414,7 +415,7 @@ class Profile extends Memcached_DataObject /** * Leave a group that this profile is a member of. * - * @param User_group $group + * @param User_group $group */ function leaveGroup(User_group $group) { diff --git a/lib/approvegroupform.php b/lib/approvegroupform.php index 3ad74e0486..561b204ea9 100644 --- a/lib/approvegroupform.php +++ b/lib/approvegroupform.php @@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/form.php'; * * @see UnsubscribeForm */ - class ApproveGroupForm extends Form { /** @@ -62,7 +61,6 @@ 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); @@ -76,7 +74,6 @@ class ApproveGroupForm extends Form * * @return string ID of the form */ - function id() { return 'group-queue-' . $this->group->id; @@ -87,7 +84,6 @@ class ApproveGroupForm extends Form * * @return string of the form class */ - function formClass() { return 'form_group_queue ajax'; @@ -98,7 +94,6 @@ class ApproveGroupForm extends Form * * @return string URL of the action */ - function action() { $params = array(); @@ -117,7 +112,9 @@ class ApproveGroupForm extends Form 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')); } } diff --git a/lib/cancelgroupform.php b/lib/cancelgroupform.php index f945a847f7..c328f358c8 100644 --- a/lib/cancelgroupform.php +++ b/lib/cancelgroupform.php @@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/form.php'; * * @see UnsubscribeForm */ - class CancelGroupForm extends Form { /** @@ -62,7 +61,6 @@ 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); @@ -76,7 +74,6 @@ class CancelGroupForm extends Form * * @return string ID of the form */ - function id() { return 'group-cancel-' . $this->group->id; @@ -87,7 +84,6 @@ class CancelGroupForm extends Form * * @return string of the form class */ - function formClass() { return 'form_group_leave ajax'; @@ -98,7 +94,6 @@ class CancelGroupForm extends Form * * @return string URL of the action */ - function action() { $params = array(); @@ -114,9 +109,9 @@ class CancelGroupForm extends Form * * @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')); } } diff --git a/lib/groupblockform.php b/lib/groupblockform.php index 279ddf66fb..918a5902fd 100644 --- a/lib/groupblockform.php +++ b/lib/groupblockform.php @@ -1,5 +1,5 @@ out->element('legend', null, _('Create a new group')); } @@ -142,44 +143,58 @@ class GroupEditForm extends Form 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')), @@ -188,9 +203,11 @@ class GroupEditForm extends Form } $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); @@ -207,6 +224,7 @@ class GroupEditForm extends Form */ function formActions() { + // TRANS: Text for save button on group edit form. $this->out->submit('submit', _m('BUTTON','Save')); } } diff --git a/lib/groupmemberlist.php b/lib/groupmemberlist.php index 92dc4029c6..ba608213a4 100644 --- a/lib/groupmemberlist.php +++ b/lib/groupmemberlist.php @@ -1,4 +1,5 @@ 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')); } } @@ -102,4 +103,3 @@ class GroupMemberListItem extends ProfileListItem return $args; } } - diff --git a/lib/groupnav.php b/lib/groupnav.php index 6a4f5f7e30..13795721ae 100644 --- a/lib/groupnav.php +++ b/lib/groupnav.php @@ -48,7 +48,6 @@ require_once INSTALLDIR.'/lib/widget.php'; * * @see HTMLOutputter */ - class GroupNav extends Menu { var $group = null; @@ -58,7 +57,6 @@ class GroupNav extends Menu * * @param Action $action current action, used for output */ - function __construct($action=null, $group=null) { parent::__construct($action); @@ -70,7 +68,6 @@ class GroupNav extends Menu * * @return void */ - function show() { $action_name = $this->action->trimmed('action'); @@ -105,7 +102,8 @@ class GroupNav extends Menu $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), diff --git a/lib/mail.php b/lib/mail.php index d90fe6e8f2..8ca6e67fd8 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -277,7 +277,7 @@ function mail_footer_block() * Format a block of profile info for a plaintext notification email. * * @param Profile $profile - * @return string + * @return string */ 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: %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[] = ""; @@ -498,7 +498,7 @@ function mail_confirm_sms($code, $nickname, $address) // 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"; diff --git a/lib/makeadminform.php b/lib/makeadminform.php index de245f3d66..f1280d3b69 100644 --- a/lib/makeadminform.php +++ b/lib/makeadminform.php @@ -1,4 +1,5 @@