Translator documentation added/updated.

Superfluous whitespace removed.
L10n update.
This commit is contained in:
Siebrand Mazeland 2011-03-18 20:37:04 +01:00
parent 902990bb72
commit 84e5ca6158
5 changed files with 50 additions and 19 deletions

View File

@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/feedlist.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 RepliesAction extends OwnerDesignAction class RepliesAction extends OwnerDesignAction
{ {
var $page = null; var $page = null;
@ -60,7 +59,6 @@ class RepliesAction extends OwnerDesignAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -70,6 +68,7 @@ class RepliesAction extends OwnerDesignAction
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed when trying to reply to a non-exsting user.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return false; return false;
} }
@ -77,6 +76,7 @@ class RepliesAction extends OwnerDesignAction
$profile = $this->user->getProfile(); $profile = $this->user->getProfile();
if (!$profile) { if (!$profile) {
// TRANS: Server error displayed when trying to reply to a user without a profile.
$this->serverError(_('User has no profile.')); $this->serverError(_('User has no profile.'));
return false; return false;
} }
@ -105,7 +105,6 @@ class RepliesAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -119,12 +118,15 @@ class RepliesAction extends OwnerDesignAction
* *
* @return string title of page * @return string title of page
*/ */
function title() function title()
{ {
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Title for first page of replies for a user.
// TRANS: %s is a user nickname.
return sprintf(_("Replies to %s"), $this->user->nickname); return sprintf(_("Replies to %s"), $this->user->nickname);
} else { } else {
// TRANS: Title for all but the first page of replies for a user.
// TRANS: %1$s is a user nickname, %2$d is a page number.
return sprintf(_('Replies to %1$s, page %2$d'), return sprintf(_('Replies to %1$s, page %2$d'),
$this->user->nickname, $this->user->nickname,
$this->page); $this->page);
@ -136,12 +138,13 @@ class RepliesAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function getFeeds() function getFeeds()
{ {
return array(new Feed(Feed::RSS1, return array(new Feed(Feed::RSS1,
common_local_url('repliesrss', common_local_url('repliesrss',
array('nickname' => $this->user->nickname)), array('nickname' => $this->user->nickname)),
// TRANS: Link for feed with replies for a user.
// TRANS: %s is a user nickname.
sprintf(_('Replies feed for %s (RSS 1.0)'), sprintf(_('Replies feed for %s (RSS 1.0)'),
$this->user->nickname)), $this->user->nickname)),
new Feed(Feed::RSS2, new Feed(Feed::RSS2,
@ -149,6 +152,8 @@ class RepliesAction extends OwnerDesignAction
array( array(
'id' => $this->user->nickname, 'id' => $this->user->nickname,
'format' => 'rss')), 'format' => 'rss')),
// TRANS: Link for feed with replies for a user.
// TRANS: %s is a user nickname.
sprintf(_('Replies feed for %s (RSS 2.0)'), sprintf(_('Replies feed for %s (RSS 2.0)'),
$this->user->nickname)), $this->user->nickname)),
new Feed(Feed::ATOM, new Feed(Feed::ATOM,
@ -156,6 +161,8 @@ class RepliesAction extends OwnerDesignAction
array( array(
'id' => $this->user->nickname, 'id' => $this->user->nickname,
'format' => 'atom')), 'format' => 'atom')),
// TRANS: Link for feed with replies for a user.
// TRANS: %s is a user nickname.
sprintf(_('Replies feed for %s (Atom)'), sprintf(_('Replies feed for %s (Atom)'),
$this->user->nickname))); $this->user->nickname)));
} }
@ -167,7 +174,6 @@ class RepliesAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$nl = new NoticeList($this->notice, $this); $nl = new NoticeList($this->notice, $this);
@ -184,17 +190,27 @@ class RepliesAction extends OwnerDesignAction
function showEmptyListMessage() function showEmptyListMessage()
{ {
$message = sprintf(_('This is the timeline showing replies to %1$s but %2$s hasn\'t received a notice to them yet.'), $this->user->nickname, $this->user->nickname) . ' '; // TRANS: Empty list message for page with replies for a user.
// TRANS: %1$s and %s$s are the user nickname.
$message = sprintf(_('This is the timeline showing replies to %1$s but %2$s hasn\'t received a notice to them yet.'),
$this->user->nickname,
$this->user->nickname) . ' ';
if (common_logged_in()) { if (common_logged_in()) {
$current_user = common_current_user(); $current_user = common_current_user();
if ($this->user->id === $current_user->id) { if ($this->user->id === $current_user->id) {
// TRANS: Empty list message for page with replies for a user for the logged in user.
// TRANS: This message contains a Markdown link in the form [link text](link).
$message .= _('You can engage other users in a conversation, subscribe to more people or [join groups](%%action.groups%%).'); $message .= _('You can engage other users in a conversation, subscribe to more people or [join groups](%%action.groups%%).');
} else { } else {
// TRANS: Empty list message for page with replies for a user for all logged in users but the user themselves.
// TRANS: %1$s, %2$s and %3$s are a user nickname. This message contains a Markdown link in the form [link text](link).
$message .= sprintf(_('You can try to [nudge %1$s](../%2$s) or [post something to them](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname); $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) or [post something to them](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
} }
} }
else { else {
// TRANS: Empty list message for page with replies for a user for not logged in users.
// TRANS: %1$s is a user nickname. This message contains a Markdown link in the form [link text](link).
$message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->user->nickname); $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->user->nickname);
} }

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class RevokeRoleAction extends ProfileFormAction class RevokeRoleAction extends ProfileFormAction
{ {
/** /**
@ -50,7 +49,6 @@ class RevokeRoleAction extends ProfileFormAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
if (!parent::prepare($args)) { if (!parent::prepare($args)) {
@ -59,10 +57,12 @@ class RevokeRoleAction extends ProfileFormAction
$this->role = $this->arg('role'); $this->role = $this->arg('role');
if (!Profile_role::isValid($this->role)) { if (!Profile_role::isValid($this->role)) {
// TRANS: Client error displayed when trying to revoke an invalid role.
$this->clientError(_('Invalid role.')); $this->clientError(_('Invalid role.'));
return false; return false;
} }
if (!Profile_role::isSettable($this->role)) { if (!Profile_role::isSettable($this->role)) {
// TRANS: Client error displayed when trying to revoke a reserved role.
$this->clientError(_('This role is reserved and cannot be set.')); $this->clientError(_('This role is reserved and cannot be set.'));
return false; return false;
} }
@ -72,6 +72,7 @@ class RevokeRoleAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::REVOKEROLE)) { if (!$cur->hasRight(Right::REVOKEROLE)) {
// TRANS: Client error displayed when trying to revoke a role without having the right to do that.
$this->clientError(_('You cannot revoke user roles on this site.')); $this->clientError(_('You cannot revoke user roles on this site.'));
return false; return false;
} }
@ -79,7 +80,8 @@ class RevokeRoleAction extends ProfileFormAction
assert(!empty($this->profile)); // checked by parent assert(!empty($this->profile)); // checked by parent
if (!$this->profile->hasRole($this->role)) { if (!$this->profile->hasRole($this->role)) {
$this->clientError(_("User doesn't have this role.")); // TRANS: Client error displayed when trying to revoke a role that is not set.
$this->clientError(_('User does not have this role.'));
return false; return false;
} }
@ -91,7 +93,6 @@ class RevokeRoleAction extends ProfileFormAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
$this->profile->revokeRole($this->role); $this->profile->revokeRole($this->role);

View File

@ -110,6 +110,7 @@ class RsdAction extends Action
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }
@ -139,6 +140,7 @@ class RsdAction extends Action
$this->elementStart('rsd', array('version' => '1.0', $this->elementStart('rsd', array('version' => '1.0',
'xmlns' => $rsdNS)); 'xmlns' => $rsdNS));
$this->elementStart('service'); $this->elementStart('service');
// TRANS: Engine name for RSD.
$this->element('engineName', null, _('StatusNet')); $this->element('engineName', null, _('StatusNet'));
$this->element('engineLink', null, 'http://status.net/'); $this->element('engineLink', null, 'http://status.net/');
$this->elementStart('apis'); $this->elementStart('apis');

View File

@ -142,6 +142,7 @@ class UserauthorizationAction extends Action
'alt' => $nickname)); 'alt' => $nickname));
} }
// TRANS: Label for nickname on user authorisation page.
$this->element('div', 'entity_nickname', _('Nickname')); $this->element('div', 'entity_nickname', _('Nickname'));
$hasFN = ($fullname !== '') ? 'nickname' : 'fn nickname'; $hasFN = ($fullname !== '') ? 'nickname' : 'fn nickname';
@ -196,12 +197,14 @@ class UserauthorizationAction extends Action
'userauthorization'))); 'userauthorization')));
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
// TRANS: Button text on Authorise Subscription page. $this->submit('accept',
$this->submit('accept', _m('BUTTON','Accept'), 'submit accept', null, // TRANS: Button text on Authorise Subscription page.
_m('BUTTON','Accept'), 'submit accept', null,
// TRANS: Title for button on Authorise Subscription page. // TRANS: Title for button on Authorise Subscription page.
_('Subscribe to this user.')); _('Subscribe to this user.'));
// TRANS: Button text on Authorise Subscription page. $this->submit('reject',
$this->submit('reject', _m('BUTTON','Reject'), 'submit reject', null, // TRANS: Button text on Authorise Subscription page.
_m('BUTTON','Reject'), 'submit reject', null,
// TRANS: Title for button on Authorise Subscription page. // TRANS: Title for button on Authorise Subscription page.
_('Reject this subscription.')); _('Reject this subscription.'));
$this->elementEnd('form'); $this->elementEnd('form');

View File

@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/grouplist.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 UsergroupsAction extends OwnerDesignAction class UsergroupsAction extends OwnerDesignAction
{ {
var $page = null; var $page = null;
@ -59,10 +58,12 @@ class UsergroupsAction extends OwnerDesignAction
function title() function title()
{ {
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Message is used as a page title. %s is a nick name. // TRANS: Page title for first page of groups for a user.
// TRANS: %s is a nickname.
return sprintf(_('%s groups'), $this->user->nickname); return sprintf(_('%s groups'), $this->user->nickname);
} else { } else {
// TRANS: Message is used as a page title. %1$s is a nick name, %2$d is a page number. // TRANS: Page title for all but the first page of groups for a user.
// TRANS: %1$s is a nickname, %2$d is a page number.
return sprintf(_('%1$s groups, page %2$d'), return sprintf(_('%1$s groups, page %2$d'),
$this->user->nickname, $this->user->nickname,
$this->page); $this->page);
@ -90,6 +91,7 @@ class UsergroupsAction extends OwnerDesignAction
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed requesting groups for a non-existing user.
$this->clientError(_('No such user.'), 404); $this->clientError(_('No such user.'), 404);
return false; return false;
} }
@ -97,6 +99,7 @@ class UsergroupsAction extends OwnerDesignAction
$this->profile = $this->user->getProfile(); $this->profile = $this->user->getProfile();
if (!$this->profile) { if (!$this->profile) {
// TRANS: Server error displayed requesting groups for a user without a profile.
$this->serverError(_('User has no profile.')); $this->serverError(_('User has no profile.'));
return false; return false;
} }
@ -123,12 +126,14 @@ class UsergroupsAction extends OwnerDesignAction
$this->elementStart('p', array('id' => 'new_group')); $this->elementStart('p', array('id' => 'new_group'));
$this->element('a', array('href' => common_local_url('newgroup'), $this->element('a', array('href' => common_local_url('newgroup'),
'class' => 'more'), 'class' => 'more'),
// TRANS: Link text on group page to create a new group.
_('Create a new group')); _('Create a new group'));
$this->elementEnd('p'); $this->elementEnd('p');
$this->elementStart('p', array('id' => 'group_search')); $this->elementStart('p', array('id' => 'group_search'));
$this->element('a', array('href' => common_local_url('groupsearch'), $this->element('a', array('href' => common_local_url('groupsearch'),
'class' => 'more'), 'class' => 'more'),
// TRANS: Link text on group page to search for groups.
_('Search for more groups')); _('Search for more groups'));
$this->elementEnd('p'); $this->elementEnd('p');
@ -156,11 +161,15 @@ class UsergroupsAction extends OwnerDesignAction
function showEmptyListMessage() function showEmptyListMessage()
{ {
// TRANS: Text on group page for a user that is not a member of any group.
// TRANS: %s is a user nickname.
$message = sprintf(_('%s is not a member of any group.'), $this->user->nickname) . ' '; $message = sprintf(_('%s is not a member of any group.'), $this->user->nickname) . ' ';
if (common_logged_in()) { if (common_logged_in()) {
$current_user = common_current_user(); $current_user = common_current_user();
if ($this->user->id === $current_user->id) { if ($this->user->id === $current_user->id) {
// TRANS: Text on group page for a user that is not a member of any group. This message contains
// TRANS: a Markdown link in the form [link text](link) and a variable that should not be changed.
$message .= _('Try [searching for groups](%%action.groupsearch%%) and joining them.'); $message .= _('Try [searching for groups](%%action.groupsearch%%) and joining them.');
} }
} }